Is it possible to execute a CloudFormation file in Terraform?

后端 未结 2 470
慢半拍i
慢半拍i 2021-02-07 12:58

One team has already written a cloudformation template as a .yml file that provisions a stack of resources.

Is it possible to leverage this file by executi

2条回答
  •  暖寄归人
    2021-02-07 13:18

    I can confirm that template_body with a file reference to a cloudformation template works. I assume template_url will also work great. Example

    resource "aws_cloudformation_stack" "my-new-stack" {
      name = "my-new-stack"
      parameters {
        Name="my-new-stack"
        Port="22"
        VpcId = "${var.vpc_id}"
      }
      template_body = "${file("${path.module}/mystack.yml")}"
    }
    

提交回复
热议问题