【问题标题】:Terraform Unsupported block type error for "aws_cloudformation_stack"“aws_cloudformation_stack”的 Terraform 不支持的块类型错误
【发布时间】:2019-07-03 14:51:30
【问题描述】:

我正在设置“部署到 AWS ECR/ECS(以下链接)”,我完成了 1-4。 https://circleci.com/docs/2.0/ecs-ecr/#section=deployment

$ terraform plan

Error: Unsupported block type

  on terraform.tf line 30, in resource "aws_cloudformation_stack" "vpc":
  30:   parameters {

Blocks of type "parameters" are not expected here. Did you mean to define
argument "parameters"? If so, use the equals sign to assign it a value.

这是我的代码。

resource "aws_cloudformation_stack" "vpc" {
  name = "${local.aws_vpc_stack_name}"
  template_body = "${file("cloudformation-templates/public-vpc.yml")}"
  capabilities = ["CAPABILITY_NAMED_IAM"]
  parameters {
    ClusterName = "${local.aws_ecs_cluster_name}"
    ExecutionRoleName = "${local.aws_ecs_execution_role_name}"
  }
}

我应该怎么做才能成功地“改造计划”? 谢谢,

【问题讨论】:

    标签: terraform circleci


    【解决方案1】:

    代替

    parameters {
      ClusterName = "${local.aws_ecs_cluster_name}"
      ExecutionRoleName = "${local.aws_ecs_execution_role_name}"
    }
    

    试试

    parameters = {
      ClusterName = "${local.aws_ecs_cluster_name}"
      ExecutionRoleName = "${local.aws_ecs_execution_role_name}"
    }
    

    第一个被解释为一个块,第二个被解释为一个参数。因此出现错误。

    【讨论】:

      猜你喜欢
      • 2021-11-11
      • 2020-10-13
      • 1970-01-01
      • 2019-09-08
      • 2022-01-22
      • 1970-01-01
      • 1970-01-01
      • 2019-11-03
      • 2017-06-02
      相关资源
      最近更新 更多