Skip to content

Latest commit

 

History

History
112 lines (92 loc) · 3.94 KB

cloud_formation_spec_template.md

File metadata and controls

112 lines (92 loc) · 3.94 KB
page_title subcategory description
morpheus_cloud_formation_spec_template Resource - terraform-provider-morpheus
Provides a Morpheus cloud formation spec template resource

morpheus_cloud_formation_spec_template

Provides a Morpheus cloud formation spec template resource

Example Usage

Creating the cloud formation spec template with local content:

resource "morpheus_cloud_formation_spec_template" "tfexample_cloud_formation_spec_template_local" {
  name                   = "tf_cloud_formation_spec_example_local"
  source_type            = "local"
  spec_content           = <<TFEOF
{
  "AWSTemplateFormatVersion" : "2010-09-09",
  "Description" : "AWS CloudFormation Sample Template S3_Website_Bucket_With_Retain_On_Delete: Sample template showing how to create a publicly accessible S3 bucket configured for website access with a deletion policy of retain on delete. **WARNING** This template creates an S3 bucket that will NOT be deleted when the stack is deleted. You will be billed for the AWS resources used if you create a stack from this template.",
  "Resources" : {
    "S3Bucket" : {
      "Type" : "AWS::S3::Bucket",
      "Properties" : {
        "AccessControl" : "PublicRead",
        "WebsiteConfiguration" : {
          "IndexDocument" : "index.html",
          "ErrorDocument" : "error.html"
         }
      },
      "DeletionPolicy" : "Retain"
    }
  },

  "Outputs" : {
    "WebsiteURL" : {
      "Value" : { "Fn::GetAtt" : [ "S3Bucket", "WebsiteURL" ] },
      "Description" : "URL for website hosted on S3"
    },
    "S3BucketSecureURL" : {
      "Value" : { "Fn::Join" : [ "", [ "https://", { "Fn::GetAtt" : [ "S3Bucket", "DomainName" ] } ] ] },
      "Description" : "Name of S3 bucket to hold website content"
    }
  }
}
TFEOF
  capability_iam         = true
  capability_named_iam   = true
  capability_auto_expand = true
}

Creating the cloud formation spec template with the template fetched from a url:

resource "morpheus_cloud_formation_spec_template" "tfexample_cloud_formation_spec_template_url" {
  name                   = "tf_cloud_formation_spec_example_url"
  source_type            = "url"
  spec_path              = "http://example.com/spec.yaml"
  capability_iam         = true
  capability_named_iam   = true
  capability_auto_expand = true
}

Creating the cloud formation spec template with the template fetched via git:

resource "morpheus_cloud_formation_spec_template" "tfexample_cloud_formation_spec_template_git" {
  name                   = "tf-cloud-formation-spec-example-git"
  source_type            = "repository"
  repository_id          = 2
  version_ref            = "main"
  spec_path              = "./spec.yaml"
  capability_iam         = true
  capability_named_iam   = true
  capability_auto_expand = true
}

Schema

Required

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

Optional

  • capability_auto_expand (Boolean) Whether the auto expand capability is added to the cloud formation
  • capability_iam (Boolean) Whether the iam capability is added to the cloud formation
  • capability_named_iam (Boolean) Whether the named iam capability is added to the cloud formation
  • repository_id (Number) The ID of the git repository integration
  • spec_content (String) The content of the cloud formation spec template. Used when the local source type is specified
  • spec_path (String) The path of the cloud formation 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 cloud formation spec template

Import

Import is supported using the following syntax:

terraform import morpheus_cloud_formation_spec_template.tf_example_cloud_formation_spec_template 1