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

Lambda version updates not reflected in trigger #230

Closed
1 task done
fatmcgav opened this issue Aug 28, 2024 · 3 comments · Fixed by #231
Closed
1 task done

Lambda version updates not reflected in trigger #230

fatmcgav opened this issue Aug 28, 2024 · 3 comments · Fixed by #231

Comments

@fatmcgav
Copy link
Contributor

Description

When attempting to update the slack_channel that a set of notifications target, I observed that the notifications were still being sent to the "old" channel.

Upon reviewing the AWS config, I could see a new version of the lambda had been published. However there was an error on the triggers section for the new lambda version as follows:
Screenshot 2024-08-28 at 09 56 06

After looking at this module code, I believe the issue is here:

endpoint = module.lambda.lambda_function_arn

Instead of using the lambda_function_arn output, the lambda_function_qualified_arn1 should be used, as that includes the "current" version.

Alternatively, an alias could be defined, using the alias submodule[2] and that alias is then referenced by the trigger.

[2] https://github.com/terraform-aws-modules/terraform-aws-lambda/tree/v3.2.0/modules/alias

  • ✋ I have searched the open/closed issues and my issue is not listed.

Versions

  • Module version [Required]: ~> 6.0

  • Terraform version: 1.5.7

  • Provider version(s): 5.63.0

Reproduction Code [Required]

Steps to reproduce the behavior:

  • Deploy module with slack_channel set to channel-a
  • Test notifications
  • Update slack_channel value to channel-b
  • Test notifications

Expected behavior

Notifications should be sent to #channel-b

Actual behavior

Notification is still sent to #channel-a

Terminal Output Screenshot(s)

Additional context

The current terraform-aws-modules/lambda/aws version (3.2.0) is 3 years old!!!
The latest version is 7.8.1...

fatmcgav added a commit to MoloFinance/terraform-aws-notify-slack that referenced this issue Aug 28, 2024
This commit updates the `aws_sns_topic_subscription` resource to use the `lambda_function_qualified_arn` output for the `endpoint` value.

Also bump the `lambda` module to `6.8.0`, which is the latest version that maintains compatability with `aws` v4 provider.

Fixes: terraform-aws-modules#230
fatmcgav added a commit to MoloFinance/terraform-aws-notify-slack that referenced this issue Aug 28, 2024
This commit updates the `aws_sns_topic_subscription` resource to use the `lambda_function_qualified_arn` output for the `endpoint` value.

Also bump the `lambda` module to `6.8.0`, which is the latest version that maintains compatability with `aws` v4 provider.

Fixes: terraform-aws-modules#230
@fatmcgav
Copy link
Contributor Author

I went with option 1 above in #231.

Testing the changes locally and this correctly results in an update to the SNS trigger on a lambda update :D

bryantbiggs pushed a commit that referenced this issue Sep 3, 2024
#231)

This commit updates the `aws_sns_topic_subscription` resource to use the `lambda_function_qualified_arn` output for the `endpoint` value.

Also bump the `lambda` module to `6.8.0`, which is the latest version that maintains compatability with `aws` v4 provider.

Fixes: #230
antonbabenko pushed a commit that referenced this issue Sep 3, 2024
## [6.4.1](v6.4.0...v6.4.1) (2024-09-03)

### Bug Fixes

* Update `aws_sns_topic_subscription` endpoint to use qualified arn ([#231](#231)) ([e95cde8](e95cde8)), closes [#230](#230)
@antonbabenko
Copy link
Member

This issue has been resolved in version 6.4.1 🎉

Copy link

github-actions bot commented Oct 4, 2024

I'm going to lock this issue 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 similar to this, 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 Oct 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants