Terraform 12无法部署豆茎健康报告设置



我在地形部署中包含了健康报告,但我收到了这个错误

错误

Error: Unsupported argument
on ../mods/environment/environment.tf line 210, in resource "aws_elastic_beanstalk_environment" "environment":
210:   setting = {
An argument named "setting" is not expected here. Did you mean to define a
block of type "setting"?

我在模板文件夹上使用这个json文件

hc.tpl文件=位于/mods/environment/hc文件夹

{
"CloudWatchMetrics": {
"Environment": {
"ApplicationRequests2xx": 60,
"ApplicationRequests5xx": 60,
"ApplicationRequests4xx": 60
},
"Instance": {
"ApplicationRequestsTotal": 60
}
},
"Version": 1
}

我的Terraform代码部署(我删除了一些块以减少您的阅读量(

data "template_file" "hc" {
template = "${file("../mods/environment/hc/hc.tpl")}"
}
resource "aws_elastic_beanstalk_environment" "pogi" {
name                    = "pogi-poc"
application             = "pogi-poc"
solution_stack_name     = "64bit Amazon Linux 2018.03 v2.9.8 running PHP 7.0"
setting {
namespace = "aws:ec2:vpc"
name      = "VPCId"
value     = "vpc-12345"
}
setting {
namespace = "aws:ec2:vpc"
name = "ELBScheme"
value = "internal"
}
setting {
namespace = "aws:ec2:vpc"
name = "AssociatePublicIpAddress"
value = "false"
}
setting = {
namespace = "aws:elasticbeanstalk:healthreporting:system"
name = "ConfigDocument"
value = data.template_file.hc.rendered
}
}

我也使用了这种方法,但我得到了相同的错误消息

您在中有=

setting = {
namespace = "aws:elasticbeanstalk:healthreporting:system"
name = "ConfigDocument"
value = data.template_file.hc.rendered
}

应该是:

setting {
namespace = "aws:elasticbeanstalk:healthreporting:system"
name = "ConfigDocument"
value = data.template_file.hc.rendered
}

最新更新