terraform-aws-modules / terraform-aws-lambda

Terraform module, which takes care of a lot of AWS Lambda/serverless tasks (build dependencies, packages, updates, deployments) in countless combinations 🇺🇦
https://registry.terraform.io/modules/terraform-aws-modules/lambda/aws
Apache License 2.0
886 stars 657 forks source link

Add principal_org_id permission as option for the Lambda function #403

Closed denissimonovski closed 1 year ago

denissimonovski commented 1 year ago

Is your request related to a new offering from AWS?

It's not a new offering. It was released in 4.9.0 on April 07, 2022.

Is your request related to a problem? Please describe.

I'm using this module to deploy lambdas for AWS Config organisation custom rules. And I need to allow all accounts in that organisation to access the lambda in management account. There is an option to list a couple of hundreds of accounts and add them in a list in source_account but the principal_org_id option has been released for a while, and it will be a much cleaner solution.

Describe the solution you'd like.

Just add principal_org_id as an optional allowed trigger in the two aws_lambda_permission, as: principal_org_id = try(each.value.principal_org_id, null)

Describe alternatives you've considered.

  1. Writing 200+ account IDs in the source_account property.
  2. Adding a resource "aws_lambda_permission" in my terraform to append this permission. But this is one line fix that is very easily remediated, and I can submit a PR if allowed.
github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this issue will be closed in 10 days

github-actions[bot] commented 1 year ago

This issue was automatically closed because of stale in 10 days

github-actions[bot] commented 1 year ago

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.