aws-samples / aws-health-aware

AHA is an incident management & communication framework to provide real-time alert customers when there are active AWS event(s). For customers with AWS Organizations, customers can get aggregated active account level events of all the accounts in the Organization. Customers not using AWS Organizations still benefit alerting at the account level.
MIT No Attribution
348 stars 143 forks source link

Slack Workflow #39

Closed andy-townsend closed 11 months ago

andy-townsend commented 2 years ago

Has anyone ran into issues in getting this to work with Slack Workflows?

I've created as per the docs but the workflow just reports Received a webhook request that was missing a required field. No indication of what it received. If I call the workflow via its webhook via curl and the following input it works fine.

curl -X POST https://hooks.slack.com/workflows/<redacted> -H 'Content-Type: application/json' -d '{"text":"test","account":"1234","resources":"my_resource","service":"my_service","region":"my_region","status":"my_status","start_time":"start_time","event_arn":"my_arn","updates":"none"}'

Wondering if anyone had ran into this at all before?

mbc3k commented 2 years ago

I have it working as a Slack workflow. I wonder if maybe the lambda logs show anything about what it's sending to your webhook? I was looking at my deployment's logs in CloudWatch and saw that it does output the JSON that comes from the Health API to the logs. It still doesn't quite show what's being shunted over to the Slack webhook, but maybe the lambda code could be adjusted to output that to logs too.

andy-townsend commented 2 years ago

Cheers @mbc3k . I switched to a webhook and it worked straight away.

Also pinched the code from your fork for filtering events as well, cheers for that! :)