- 最新
- 投票最多
- 评论最多
Hi Chandra, I'll be happy to help you with this issue. Basically there are 2 things I would like to isolate from your error, as I was able to successfully reproduce and fix it using your template.
- Make sure your template contains the right configuration for AWS::CodeStarNotifications::NotificationRule
- Make sure you are providing the right input in the SlackChannel parameter
Lets start with the first one. I noticed that there is one incorrect value in this part of your template
NotificationRule: Type: AWS::CodeStarNotifications::NotificationRule Properties: Name: MyPipelineNotificationRule DetailType: BASIC EventTypeIds: - codepipeline.PipelineExecutionStateChange
Where codepipeline.PipelineExecutionStateChange
it is not an allowed value for NotificationRules, please try one of the allowed values from this documentation [1]
Something like this worked for me
NotificationRule: Type: AWS::CodeStarNotifications::NotificationRule Properties: Name: MyPipelineNotificationRule DetailType: BASIC EventTypeIds: - codepipeline-pipeline-stage-execution-started Resource: !Sub 'arn:${AWS::Partition}:codepipeline:${AWS::Region}:${AWS::AccountId}:${MyPipeline}'
About the second point. I would like to make sure that you are setting the right value for the Slack Channel. The template might suggest that the right value for that parameter is the Slack Channel ID or URL.
Before deploying your template, you will need to configure AWS Chatbot for a Slack Channel integration following the steps in the following documentation [2]
Finally to successfully troubleshoot CloudFormation deployments, you can use CloudTrail logs [3]. From there you can identify what was the API call triggered by CloudFormation and what was the bad input.
Here I'll paste a piece of my error which helped me to identify what your issue was.
"requestParameters": { "EventTypeIds": [ "codepipeline.PipelineExecutionStateChange" ], "ClientRequestToken": "***", "DetailType": "BASIC", "Resource": "arn:aws:codepipeline:us-east-1:***:MyPipeline", "Targets": [ { "TargetType": "AWSChatbotSlack", "TargetAddress": "***" } ], "Name": "***" }, "responseElements": { "Message": "The notification rule cannot be created or modified because the following notification event type ID is not valid: codepipeline.PipelineExecutionStateChange. For more information, see the AWS CodeStar Notifications API Reference." }
I hope this information was useful.
Events for notification rules on pipelines
[1] https://docs.aws.amazon.com/dtconsole/latest/userguide/concepts.html#events-ref-pipeline
AWS Chatbot - Get started with Slack
[2] https://docs.aws.amazon.com/chatbot/latest/adminguide/slack-setup.html
Viewing recent CloudTrail management events in the CloudTrail console
[3] https://docs.aws.amazon.com/awscloudtrail/latest/userguide/view-cloudtrail-events-console.html
相关内容
- AWS 官方已更新 4 年前
Again the same error, I tried to create stack after the corrections you suggested
cloudtrail helped me in this, I was using slack channel id, instead target address needs arn