Skip to content

Latest commit

 

History

History
94 lines (75 loc) · 2.36 KB

kubernetes_spec_template.md

File metadata and controls

94 lines (75 loc) · 2.36 KB
page_title subcategory description
morpheus_kubernetes_spec_template Resource - terraform-provider-morpheus
Provides a Morpheus kubernetes spec template resource

morpheus_kubernetes_spec_template

Provides a Morpheus kubernetes spec template resource

Example Usage

Creating the kubernetes spec template with local content:

resource "morpheus_kubernetes_spec_template" "tfexample_kubernetes_spec_template_local" {
  name         = "tf-terraform-spec-example-local"
  source_type  = "local"
  spec_content = <<TFEOF
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
  labels:
    app: nginx
spec:
  replicas: 3
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:1.14.2
        ports:
        - containerPort: 80
TFEOF
}

Creating the kubernetes spec template with the template fetched from a url:

resource "morpheus_kubernetes_spec_template" "tfexample_kubernetes_spec_template_url" {
  name        = "tf-kubernetes-spec-example-url"
  source_type = "url"
  spec_path   = "http://example.com/spec.yaml"
}

Creating the kubernetes spec template with the template fetched via git:

resource "morpheus_kubernetes_spec_template" "tfexample_kubernetes_spec_template_git" {
  name          = "tf-kubernetes-spec-example-git"
  source_type   = "repository"
  repository_id = 2
  version_ref   = "main"
  spec_path     = "./spec.yaml"
}

Schema

Required

  • name (String) The name of the kubernetes spec template
  • source_type (String) The source of the kubernetes spec template (local, url or repository)

Optional

  • repository_id (Number) The ID of the git repository integration
  • spec_content (String) The content of the kubernetes spec template. Used when the local source type is specified
  • spec_path (String) The path of the kubernetes spec template, either the url or the path in the repository
  • version_ref (String) The git reference of the repository to pull (main, master, etc.)

Read-Only

  • id (String) The ID of the kubernetes spec template

Import

Import is supported using the following syntax:

terraform import morpheus_kubernetes_spec_template.tf_example_kubernetes_spec_template 1