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

feat: Add a way to define IAM policy name prefix #354

Merged
merged 4 commits into from
Oct 31, 2022

Conversation

alisson276
Copy link
Contributor

Description

Allow to give to the policy a name other than the var.role_name

Motivation and Context

Sometimes we want to import things already created by the AWS Console, and the default policy name is AWSLambdaBasicExecutionRole-<random_uuid>. So in order to be able to import without recreating the policy this change allow to set a new policy name. The default behavior if var.policy_name is not set is to use role_name exactly how this was doing before this change.

Breaking Changes

I don't think so

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

@alisson276 alisson276 changed the title feat: add policy_name variable feat: Add policy_name variable Oct 14, 2022
iam.tf Outdated Show resolved Hide resolved
@antonbabenko antonbabenko changed the title feat: Add policy_name variable feat: Add a way to define IAM policy name prefix Oct 31, 2022
@antonbabenko antonbabenko merged commit 7df6bbf into terraform-aws-modules:master Oct 31, 2022
antonbabenko pushed a commit that referenced this pull request Oct 31, 2022
## [4.4.0](v4.3.0...v4.4.0) (2022-10-31)

### Features

* Add a way to define IAM policy name prefix ([#354](#354)) ([7df6bbf](7df6bbf))
@antonbabenko
Copy link
Member

This PR is included in version 4.4.0 🎉

@monospacesoftware
Copy link

We're experiencing an error with version 4.4.0, appears to be caused by this change:

Error: Error in function call

 on .terraform/modules/lambda_package/iam.tf line 15, in locals:
 15:   policy_name = coalesce(var.policy_name, local.role_name)
   ├────────────────
   │ while calling coalesce(vals...)
   │ local.role_name is null
   │ var.policy_name is null

Call to function "coalesce" failed: no non-null, non-empty-string
arguments.

@antonbabenko
Copy link
Member

2 mins, I will correct it.

@github-actions
Copy link

github-actions bot commented Dec 1, 2022

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 Dec 1, 2022
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.

None yet

3 participants