温馨提示:本文翻译自stackoverflow.com,查看原文请点击:circleci - Terraform Unsupported block type error for "aws_cloudformation_stack"

circleci - “ aws_cloudformation_stack”的Terraform不支持​​的块类型错误

发布于 2020-03-27 11:31:10

我正在设置“部署到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}"
  }
}

我该怎么做才能成功进行“地形计划”?谢谢,

查看更多

查看更多

提问者
Yashy
被浏览
33
Blokje5 2019-07-03 22:55

代替

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}"
}

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

发布
问题

分享
好友

手机
浏览

扫码手机浏览