Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CodeDeploy alerts are missing information in Slack #59

Open
andy-educake opened this issue May 5, 2020 · 0 comments
Open

CodeDeploy alerts are missing information in Slack #59

andy-educake opened this issue May 5, 2020 · 0 comments

Comments

@andy-educake
Copy link

We have set up alerts on various CodeDeploy events to come via the lambda (great tool btw, thanks!) to a Slack channel. Unfortunately the Slack messages are missing most of the relevant detail.
Screenshot 2020-05-05 at 11 56 15
Looking at the test data in the repo and comparing it to the actual event that came through from SNS it looks like the event's format might have changed.
Compare test/sns-codedeploy-event.json with

{
    "Records": [
        {
            "EventSource": "aws:sns",
            "EventVersion": "1.0",
            "EventSubscriptionArn": "arn:aws:sns:eu-west-1:xxxxxxxx:name:uuid",
            "Sns": {
                "Type": "Notification",
                "MessageId": "uuid",
                "TopicArn": "arn:aws:sns:eu-west-1:xxxxxxxx:name",
                "Subject": null,
                "Message": "{\"version\":\"0\",\"id\":\"uuid\",\"detail-type\":\"CodeDeploy Deployment State-change Notification\",\"source\":\"aws.codedeploy\",\"account\":\"xxxxxxx\",\"time\":\"2020-05-05T09:53:00Z\",\"region\":\"eu-west-1\",\"resources\":[\"arn:aws:codedeploy:eu-west-1:xxxxxx:deploymentgroup:name/name\",\"arn:aws:codedeploy:eu-west-1:xxxxxx:application:name\"],\"detail\":{\"region\":\"eu-west-1\",\"deploymentId\":\"id\",\"instanceGroupId\":\"uuid\",\"deploymentGroup\":\"name\",\"state\":\"SUCCESS\",\"application\":\"name\"}}",
                "Timestamp": "2020-05-05T09:53:00.502Z",
                "SignatureVersion": "1",
                "Signature": "XXXXXXXXXXXXX",
                "SigningCertUrl": "https://sns.eu-west-1.amazonaws.com/cert.pem",
                "UnsubscribeUrl": "https://sns.eu-west-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn",
                "MessageAttributes": {}
            }
        }
    ]
}

(data redacted to remove any sensitive info)

Am I right in thinking that the SNS payload has changed? In which case, I would be willing to do a PR to reflect these changes if that would help.

andy-educake added a commit to educake/lambda-cloudwatch-slack that referenced this issue May 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant