Skip to content

Latest commit

 

History

History
76 lines (57 loc) · 2.14 KB

terraform_spec_template.md

File metadata and controls

76 lines (57 loc) · 2.14 KB
page_title subcategory description
morpheus_terraform_spec_template Resource - terraform-provider-morpheus
Provides a Morpheus terraform spec template resource

morpheus_terraform_spec_template

Provides a Morpheus terraform spec template resource

Example Usage

Creating the terraform spec template with local content:

resource "morpheus_terraform_spec_template" "tfexample_terraform_spec_template_local" {
  name         = "tf-terraform-spec-example-local"
  source_type  = "local"
  spec_content = <<EOF
resource "aws_instance" "instance_1" {
  ami           = "ami-0b91a410940e82c54"
  instance_type = "t2.micro"
}
EOF
}

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

resource "morpheus_terraform_spec_template" "tfexample_terraform_spec_template_url" {
  name        = "tf-terraform-spec-example-url"
  source_type = "url"
  spec_path   = "http://example.com/spec.tf"
}

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

resource "morpheus_terraform_spec_template" "tfexample_terraform_spec_template_git" {
  name          = "tf-terraform-spec-example-git"
  source_type   = "repository"
  repository_id = 2
  version_ref   = "main"
  spec_path     = "Instance Types/Terraform/CloudResource/aws/vpc.tf"
}

Schema

Required

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

Optional

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

Import

Import is supported using the following syntax:

terraform import morpheus_terraform_spec_template.tfexample_terraform_spec_template 1