【发布时间】:2019-05-08 08:39:35
【问题描述】:
我正在尝试将供应商提供的 CloudFormation Stack 转换为 Terraform。有一个AWS::CloudFormation::CustomResource 用于发送 SNS 通知:
...
"RegistrationNotification": {
"Type": "AWS::CloudFormation::CustomResource",
"Version": "1.0",
"Properties": {
"ServiceToken": {"Ref" : "SnsTopicRegistration"},
"Version": "1.0",
"AccountID": {
"Ref": "AWS::AccountId"
},
"CloudTrailCreated": {
"Ref": "EnableNewCloudTrail"
},
"IamRoleARN": {
"Fn::GetAtt": [
"iamRole",
"Arn"
]
}
}
}
...
我的计划是为aws sns publish 提供一个本地执行资源。但是,CustomResource 属性是作为消息属性发送还是在消息正文中发送?
这是我迄今为止尝试过的,但我不相信它有效。
message.txt:
{
"AccountID":"111111111111",
"CloudTrailCreated":"false",
"IAMRoleArn":"arn:aws:iam::111111111111:role/TestRole"
}
aws sns publish --target-arn "arn:aws:sns:us-west-2:123456789012:test-topic" --message file://message.txt
【问题讨论】:
标签: amazon-web-services amazon-cloudformation terraform aws-cli