简体   繁体   中英

How can a SNS topic be specified as a trigger for a CodeDeploy deployment group using CloudFormation?

I have a SNS topic set up to which I can send messages when a CodeDeploy deployment takes place. In the AWS console, the SNS topic is specified in the CodeDeploy deployment group configuration. I can successfully send notifications for deployments if I configure the desired SNS topic manually through the console UI.

I would like to be able to create this association inside of a CloudFormation template at deployment group creation time. The CloudFormation documentation, however, lists no trigger/SNS/target property for the AWS::CodeDeploy::DeploymentGroup resource type.

Is this a limitation of the current CloudFormation implementation or am I simply going about this wrong?

There's no mistake, it does seem that the AWS::CodeDeploy::DeploymentGroup resource doesn't currently contain a Property corresponding to the triggerConfigurations Request Parameter in the CreateDeploymentGroup API.

This is presumably due to the fact that according to the CodeDeploy Document History , the CloudFormation implementation was initially published on Oct 1, 2015, while SNS Event Notification support was added later on Feb 27, 2016, so the CloudFormation implementation has not been updated to reflect the new API features.

As a workaround, you could use an AWS::Events::Rule with an SNS Target. See Monitoring Deployments with Amazon CloudWatch Events for instructions on setting up the CloudWatch event rule for this event type.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM