gpt4 book ai didi

"aws_cloudformation_stack"的 Terraform 不受支持的 block 类型错误

转载 作者:行者123 更新时间:2023-12-04 00:25:58 25 4
gpt4 key购买 nike

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

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

最佳答案

代替

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

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

关于 "aws_cloudformation_stack"的 Terraform 不受支持的 block 类型错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56872826/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com