Skip to content

Conversation

@maxrabin
Copy link
Contributor

Description

In the Notification module create a new variable a new create_lambda_policy that functions similar to create_sqs_policy and create_sns_policy

Motivation and Context

I define and manage my Lambda Policy separate from the Terraform where I manage my S3 Notifications. I don't want this module to force me to manage the Lambda policy here.

Fixes #301

Breaking Changes

I think that migrating aws_lambda_permission.allow from a single to a count this will cause the Resource to be recreated.
This can be avoided by performing terraform state mv

There are 3 types of notifications, and this change brings Lambda in line with SQS and SNS that support create_sqs_policy and create_sns_policy

How Has This Been Tested?

  • I have updated at least one of the examples/* to demonstrate and validate my change(s)
  • I have tested and validated these changes using one or more of the provided examples/* projects
  • I have executed pre-commit run -a on my pull request

@maxrabin maxrabin changed the title Add variable in Notification module. Closes #301 feat: Add variable in Notification module. Closes #301 Jan 12, 2025
Copy link
Member

@antonbabenko antonbabenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, but let's rename var from create_lambda_policy to create_lambda_permission since Lambda has permissions, but SNS/SQS has policies.

@antonbabenko antonbabenko changed the title feat: Add variable in Notification module. Closes #301 feat: Add variable create_lambda_permission in notification module Jan 13, 2025
@antonbabenko
Copy link
Member

This doesn't seem like a breaking change, since for_each is used, so we are good.

@maxrabin
Copy link
Contributor Author

This doesn't seem like a breaking change, since for_each is used, so we are good.

I realized you're right!

@maxrabin
Copy link
Contributor Author

Good idea, but let's rename var from create_lambda_policy to create_lambda_permission since Lambda has permissions, but SNS/SQS has policies.

I renamed it to create_lambda_policy

@maxrabin maxrabin changed the title feat: Add variable create_lambda_permission in notification module feat: Add variable create_lambda_policy in notification module Jan 13, 2025
@antonbabenko antonbabenko changed the title feat: Add variable create_lambda_policy in notification module feat: Add variable create_lambda_permission in notification module Jan 13, 2025
@antonbabenko antonbabenko merged commit 5b71671 into terraform-aws-modules:master Jan 13, 2025
4 checks passed
antonbabenko pushed a commit that referenced this pull request Jan 13, 2025
## [4.4.0](v4.3.0...v4.4.0) (2025-01-13)

### Features

* Add variable create_lambda_permission in notification module ([#302](#302)) ([5b71671](5b71671))
@antonbabenko
Copy link
Member

This PR is included in version 4.4.0 🎉

@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 Feb 13, 2025
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.

Add boolean varaible aws_lambda_permission to the Notifications module

2 participants