Skip to content

Latest commit

 

History

History
134 lines (109 loc) · 3.87 KB

terraform_app_blueprint.md

File metadata and controls

134 lines (109 loc) · 3.87 KB
page_title subcategory description
morpheus_terraform_app_blueprint Resource - terraform-provider-morpheus
Provides a Morpheus terraform app blueprint resource

morpheus_terraform_app_blueprint

Provides a Morpheus terraform app blueprint resource

Example Usage

Creating the terraform app blueprint with local content in hcl format:

resource "morpheus_terraform_app_blueprint" "tfapp_blueprint" {
  name              = "tfappbluedemo"
  description       = "testing terraform"
  category          = "terraformdemo"
  source_type       = "hcl"
  blueprint_content = <<EOF
variable "master_username" {
  type = string
}

variable "master_password" {
  type      = string
  sensitive = true
}

variable "engine_version" {
  type = string
}

variable "instance_class" {
  type = string
}

resource "local_file" "foo" {
    content  = "foo!"
    filename = "${path.module}/foo.bar"
}
EOF
  terraform_version = "1.1.1"
  terraform_options = "-var 'foo=bar'"
  tfvar_secret      = "tfvars/rdsdemo-secrets"
}

Creating the terraform app blueprint with local content in json format:

resource "morpheus_terraform_app_blueprint" "tfapp_blueprint_json" {
  name              = "tfappbluedemojson"
  description       = "testing terraform"
  category          = "terraformdemo"
  source_type       = "json"
  blueprint_content = <<EOF
{"test":"demo123"}
EOF
  terraform_version = "1.1.1"
  terraform_options = "-var 'foo=bar'"
  tfvar_secret      = "tfvars/rdsdemo-secrets"
  visibility        = "public"
}

Creating the terraform app blueprint with Terraform spec templates:

resource "morpheus_terraform_app_blueprint" "tfapp_blueprint_specs" {
  name              = "tfappbluedemospecs"
  description       = "testing terraform"
  category          = "terraformdemo"
  source_type       = "spec"
  spec_template_ids = [81]
  terraform_version = "1.1.1"
  terraform_options = "-var 'foo=bar'"
  tfvar_secret      = "tfvars/rdsdemo-secrets"
}

Creating the terraform app blueprint with the blueprint fetched via git:

resource "morpheus_terraform_app_blueprint" "tfapp_blueprint_git" {
  name              = "tfappbluedemogit"
  description       = "testing terraform"
  category          = "terraformdemo"
  source_type       = "repository"
  working_path      = "./test"
  integration_id    = 3
  repository_id     = 1
  version_ref       = "main"
  terraform_version = "1.1.1"
  terraform_options = "-var 'foo=bar'"
  tfvar_secret      = "tfvars/rdsdemo-secrets"
}

Schema

Required

  • name (String) The name of the terraform app blueprint
  • source_type (String) The source of the terraform app blueprint (hcl, json, spec or repository)

Optional

  • blueprint_content (String) The content of the terraform app blueprint. Used when the hcl or json source types are specified
  • category (String) The category of the terraform app blueprint
  • description (String) The description of the terraform app blueprint
  • integration_id (Number) The ID of the git integration
  • repository_id (Number) The ID of the git repository
  • spec_template_ids (List of Number) A list of terraform spec template ids associated with the app blueprint
  • terraform_options (String) The additional terraform options to add to the app blueprint
  • terraform_version (String) The terraform version associated with the app blueprint
  • tfvar_secret (String) The name of the tfvar cypher secret to associate with the app blueprint
  • version_ref (String) The git reference of the repository to pull (main, master, etc.)
  • working_path (String) The path of the terraform code in the git repository

Read-Only

  • id (String) The ID of the terraform app blueprint

Import

Import is supported using the following syntax:

terraform import morpheus_terraform_app_blueprint.tfexample_terraform_app_blueprint 1