英文:
Terraform code with the json format are not supported
问题
`在用 Terraform 创建事件桥接时,当 ENI 修改时通过 SNS 主题获取警报,此时 Json 格式未在 Terraform 运行时验证。
event_pattern = <<EOF { "source":"aws.config", "detail-type":"Config Configuration Item Change", "detail": { "messageType":"ConfigurationItemChangeNotification", "configurationItem": { "resourceType":"AWS::EC2::NetworkInterface", "resourceId":"eni-030512620140c240d","eni-0626261dd4743a0fc" } } } EOF
最终阶段出现错误,我需要代码来进行 Terraform 验证。
英文:
`In the Terraform for creating the Event bridge with getting alert through SNS topic when the ENI getting modification for this the Json format have not validated at the terraform running time
event_pattern = <<EOF
{
"source":"aws.config",
"detail-type":"Config Configuration Item Change",
"detail":
{
"messageType":"ConfigurationItemChangeNotification",
"configurationItem":
{
"resourceType":"AWS::EC2::NetworkInterface",
"resourceId":"eni-030512620140c240d","eni-0626261dd4743a0fc"
}
}
}
EOF
At the final stage it through the error as
I need the code to get Terraform validation `
答案1
得分: 1
Your JSON is not valid.
{
"source": "aws.config",
"detail-type": "Config Configuration Item Change",
"detail": {
"messageType": "ConfigurationItemChangeNotification",
"configurationItem": {
"resourceType": "AWS::EC2::NetworkInterface",
"resourceId": "eni-030512620140c240d",
"eni-0626261dd4743a0fc" <---- This is incorrect
}
}
}
I believe this is what you want:
{
"source": "aws.config",
"detail-type": "Config Configuration Item Change",
"detail": {
"messageType": "ConfigurationItemChangeNotification",
"configurationItem": {
"resourceType": "AWS::EC2::NetworkInterface",
"resourceId": ["eni-030512620140c240d", "eni-0626261dd4743a0fc"]
}
}
}
英文:
Your JSON is not valid.
{
"source": "aws.config",
"detail-type": "Config Configuration Item Change",
"detail": {
"messageType": "ConfigurationItemChangeNotification",
"configurationItem": {
"resourceType": "AWS::EC2::NetworkInterface",
"resourceId": "eni-030512620140c240d",
"eni-0626261dd4743a0fc" <---- This is incorrect
}
}
}
I believe this is what you want:
{
"source": "aws.config",
"detail-type": "Config Configuration Item Change",
"detail": {
"messageType": "ConfigurationItemChangeNotification",
"configurationItem": {
"resourceType": "AWS::EC2::NetworkInterface",
"resourceId": [ "eni-030512620140c240d", "eni-0626261dd4743a0fc" ]
}
}
}
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论