我通过 aws 中的控制台创建了一个 eventbridge 规则。示例事件模式(见下文)。我想通过 cloudformation 创建此规则,并指定此规则的目标为 sns 主题。 有没有关于如何在云信息中执行此操作的示例?
"source": ["aws.sagemaker"],
"detail-type": ["SageMaker Training Job State Change"],
"detail": {
"TrainingJobStatus": ["Completed"]
}
AWS CloudFormation 文档非常详细地介绍了如何声明不同的资源及其属性。请参阅下面与 EventBridge 相关的链接。
EventBridge 服务相关文档中的简短示例(请参阅链接以获取详细说明):
Type: AWS::Events::Rule
Properties:
Description: String
EventBusName: String
EventPattern: Json
Name: String
RoleArn: String
ScheduleExpression: String
State: String
Targets:
- Target
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html