如何将CloudFormation输出发送到SNS主题? (实际上是其他端点?)

问题描述 投票:0回答:1

我有一个CloudFormation模板,其中有一个Output部分。我想将输出发送到SNS主题,但是到目前为止,我发现的只是notificationsARN,它发送堆栈事件(而不是输出)

amazon-web-services amazon-cloudformation amazon-sns
1个回答
0
投票

您可以使用boto3获取cloudformation的输出并将其发送到sns

cloudformation_client = session.client('cloudformation')
response = cloudformation_client.describe_stacks(
    StackName=StackName,
)
outputs_list = response['Stacks'][0]['Outputs']

然后将其发布到snshttps://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/sns.html

© www.soinside.com 2019 - 2024. All rights reserved.