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

Correct notify_slack.py msg and remove lifecycle ignore_changes from … #13

Closed
wants to merge 1 commit into from

Conversation

nutrienrob
Copy link

When applying, originally saw the following error message in CloudWatch when running the lambda function.

Expecting value: line 1 column 1 (char 0): JSONDecodeError
Traceback (most recent call last):
File "/var/task/notify_slack.py", line 75, in lambda_handler
message = json.loads(event['Records'][0]['Sns']['Message'])
File "/var/lang/lib/python3.6/json/__init__.py", line 354, in loads
return _default_decoder.decode(s)
File "/var/lang/lib/python3.6/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/var/lang/lib/python3.6/json/decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Also, when switching the module source from the terraform module repository source location, terraform-aws-modules/notify-slack/aws, to this fork, github.com/nutrienrob/terraform-aws-notify-slack.git, the following error was seen in terraform as the appropriate updates were not happening.

* module.foo.aws_lambda_function.notify_slack: 1 error(s) occurred:
* aws_lambda_function.notify_slack: Unable to load "/terraform/.terraform/modules/c05689c7d2a45375e2d2e872cc29412f/terraform-aws-modules-terraform-aws-notify-slack-969628e/functions/notify_slack.zip": open /terraform/.terraform/modules/c05689c7d2a45375e2d2e872cc29412f/terraform-aws-modules-terraform-aws-notify-slack-969628e/functions/notify_slack.zip: no such file or directory

These changes correct both issues.

@antonbabenko
Copy link
Member

I believe the problem you have faced with function name has been fixed yesterday in #17, so please try v1.7.0.

The error with message format happens when incorrect message has been received by the function. It currently supports only SNS messages formatted as JSON.

@github-actions
Copy link

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 10, 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