-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
fix: Ensure role_name_condition
is set correctly
#389
fix: Ensure role_name_condition
is set correctly
#389
Conversation
Is this going to get merged and released? |
role_name_condition
is set correctly
### [5.23.1](v5.23.0...v5.23.1) (2023-06-29) ### Bug Fixes * Ensure `role_name_condition` is set correctly ([#389](#389)) ([0024928](0024928))
This PR is included in version 5.23.1 🎉 |
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. |
Description
When using the
iam-role-for-service-accounts-eks
module with theallow_self_assume_role
set totrue
a dynamic statement is generated for the policy. This policy uses a local role_name_condition computed using the coalesce function as follows:coalesce(var.role_name, "${var.role_name_prefix}*")
The issue comes from the fact that the
var.role_name_prefix
isnull
by default, and cannot be included in a string template. The error generated is:The expression result is null. Cannot include a null value in a string template.
Motivation and Context
This change solves the issue generated when the
allow_self_assume_role
set totrue
. It is a fix to handle the different cases properlyBreaking Changes
The PR does not introduce any breaking changes.
How Has This Been Tested?
examples/*
to demonstrate and validate my change(s)examples/*
projectsChanges have been tested by creating a new example taking the
module.cert_manager_irsa_role
as a base and settingallow_self_assume_role
totrue
. The new example is included in the PR to make sure this case is always properly handled, it is undermodule.cert_manager_irsa_role_self_assume
The original example has been tested with the new changes to make sure nothing is broken.
pre-commit run -a
on my pull request