terraform-aws-modules/terraform-aws-lambda

Add principal_org_id permission as option for the Lambda function

denissimonovski opened this issue · 3 comments

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.

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

This issue was automatically closed because of stale in 10 days