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

Terraform Lambda doesn't include env var for channels (Slack, Teams or Chime) #76

Open
diogozedan opened this issue Feb 9, 2024 · 4 comments

Comments

@diogozedan
Copy link

On Lambda handler.py lines 702 to 709 there are calls to get secrets in case environment variables are set for channels to be communicated. ( get_secret(secret_teams_name, client) if "Teams" in os.environ else "None")

The Terraform code, however, doesn't populate that variable dynamically, therefore there will never be those environment variables and the notifications won't be sent.

I corrected it on my code by making the lambda variables as a local variable and merging them to the notifications channel in case they're populated.

Hope this helps.

@carlaabanes
Copy link

Found the same problem in mine too. I fixed it on my code only.
Thanks for this post, else I would be facing a wall.

@totogtr
Copy link

totogtr commented Jun 10, 2024

Hi, are you able to share your fix ?
Thanks !

@carlaabanes
Copy link

Hi @totogtr , since we are only using teams channel in our org, i removed all other channels thats defined in the lambda functions. I also removed all other if elif conditions when sending the message.

@andrewcr7
Copy link
Contributor

Committed a few terraform updates including this one to https://github.com/aws-samples/aws-health-aware/tree/terraform-updates

Will plan to include in upcoming release.

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

4 participants