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

need to convert from json string to dict when extracting message from event #30

Merged
merged 2 commits into from
Feb 22, 2019

Conversation

alexgottscha
Copy link
Contributor

The value of event['Records'][0]['Sns']['Message'] is a json string, not a dictionary. I was getting this error prior to making the change:

string indices must be integers: TypeError
Traceback (most recent call last):
File "/var/task/notify_slack.py", line 79, in lambda_handler
notify_slack(subject, message, region)
File "/var/task/notify_slack.py", line 64, in notify_slack
payload['text'] = "AWS CloudWatch notification - " + message["AlarmName"]
TypeError: string indices must be integers

@alexgottscha alexgottscha changed the title need to convert from json to dict here need to convert from json string to dict when extracting message from event Feb 21, 2019
@antonbabenko
Copy link
Member

@invertigo We went back and forth with a similar change I believe. See #24, #23, #25 and maybe few more.

Can somebody also take a look at this/these?

@alexgottscha
Copy link
Contributor Author

@invertigo We went back and forth with a similar change I believe. See #24, #23, #25 and maybe few more.

Can somebody also take a look at this/these?

I updated the patch here based on the changes you linked - should take care of most cases and provide a meaningful error if not.

@antonbabenko
Copy link
Member

@invertigo 🤞 Ok, let's merge and see.

@ryron01 Do you have an opinion on this?

@antonbabenko antonbabenko merged commit 1d2381a into terraform-aws-modules:master Feb 22, 2019
@antonbabenko
Copy link
Member

v1.13.0 has been released.

@github-actions
Copy link

github-actions bot commented Nov 9, 2022

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants