Skip to content

Latest commit

 

History

History
87 lines (68 loc) · 2.27 KB

helm_spec_template.md

File metadata and controls

87 lines (68 loc) · 2.27 KB
page_title subcategory description
morpheus_helm_spec_template Resource - terraform-provider-morpheus
Provides a Morpheus helm spec template resource

morpheus_helm_spec_template

Provides a Morpheus helm spec template resource

Example Usage

Creating the helm spec template with local content:

resource "morpheus_helm_spec_template" "tfexample_helm_spec_template_local" {
  name         = "tf-helm-spec-example-local"
  source_type  = "local"
  spec_content = <<TFEOF
apiVersion: v1
kind: Service
metadata:
name: {{ template "fullname" . }}
labels:
    chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.externalPort }}
    targetPort: {{ .Values.service.internalPort }}
    protocol: TCP
    name: {{ .Values.service.name }}
selector:
    app: {{ template "fullname" . }}
TFEOF
}

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

resource "morpheus_helm_spec_template" "tfexample_helm_spec_template_url" {
  name        = "tf-helm-spec-example-url"
  source_type = "url"
  spec_path   = "http://example.com/chart.yaml"
}

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

resource "morpheus_helm_spec_template" "tfexample_helm_spec_template_git" {
  name          = "tf-helm-spec-example-git"
  source_type   = "repository"
  repository_id = 2
  version_ref   = "main"
  spec_path     = "./spec.yaml"
}

Schema

Required

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

Optional

  • repository_id (Number) The ID of the git repository integration
  • spec_content (String) The content of the helm spec template. Used when the local source type is specified
  • spec_path (String) The path of the helm 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 helm spec template

Import

Import is supported using the following syntax:

terraform import morpheus_helm_spec_template.tf_example_helm_spec_template 1