gpt4 book ai didi

amazon-web-services - 如何为特定 CloudFormation 堆栈创建 "aws.cloudformation"CloudWatch 事件类型?

转载 作者:行者123 更新时间:2023-12-03 07:36:15 25 4
gpt4 key购买 nike

我需要为特定的 CloudFormation 堆栈创建一个 aws.cloudformation 事件类型。例如,当 StackA 收到 UpdateStack 事件时,我需要能够捕获该事件。

通过控制台,我能够创建以下事件规则(这是一个 AWS API Call via CloudTrail 类型事件):

{
"source": [
"aws.cloudformation"
],
"detail-type": [
"AWS API Call via CloudTrail"
],
"detail": {
"eventSource": [
"cloudformation.amazonaws.com"
],
"eventName": [
"UpdateStack",
"CreateStack"
]
}
}

但是,此事件不适用于任何特定的 CloudFormation 堆栈,并且我没有看到任何用于添加任何特定内容的选项(例如每当 StackA 获取 UpdateStack打电话。

documentation for event types给出其他事件类型的示例以及我们如何添加触发事件的特定资源。例如,使用 aws.codepipeline 事件,您可以指定一个与 PipelineA 相等的 pipeline 值,然后每当 PipelineA 到达您在 State 参数中指定的状态。

如何使用 aws.cloudformation 事件类型执行类似的操作?

最佳答案

不幸的是(据我发现)获取堆栈特定事件的唯一方法是堆栈内的通知配置,该配置只能在创建/更新时提供。

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-console-add-tags.html

关于amazon-web-services - 如何为特定 CloudFormation 堆栈创建 "aws.cloudformation"CloudWatch 事件类型?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56484566/

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