Skip to content

Conversation

@ohookins
Copy link
Contributor

Description

Applies the same dynamic trick to the secretsmanager part of the external secrets role policy, so that if we don't grant access to any secrets we don't end up with an apply error.

Motivation and Context

Without supplying any values for var.external_secrets_secrets_manager_arns we end up with a policy statement like this:

                  + {
                      + Action = [
                          + "secretsmanager:ListSecretVersionIds",
                          + "secretsmanager:GetSecretValue",
                          + "secretsmanager:GetResourcePolicy",
                          + "secretsmanager:DescribeSecret",
                        ]
                      + Effect = "Allow"
                    },

This is invalid since it lacks resources and cannot be applied.

Breaking Changes

No breaking change.

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

It's such a trivial change I don't believe these are necessary but can circle back to these if you like.

@ohookins ohookins changed the title Make secretsmanager policy statement dynamic. fix: Make secretsmanager policy statement dynamic. Aug 18, 2025
@bryantbiggs bryantbiggs changed the title fix: Make secretsmanager policy statement dynamic. fix: Remove any secretsmanager:* permissions if no secret ARNs are provided to IRSA external-secrets permissions Aug 18, 2025
@bryantbiggs bryantbiggs merged commit d610954 into terraform-aws-modules:master Aug 18, 2025
21 of 22 checks passed
antonbabenko pushed a commit that referenced this pull request Aug 18, 2025
## [6.1.1](v6.1.0...v6.1.1) (2025-08-18)

### Bug Fixes

* Remove any `secretsmanager:*` permissions if no secret ARNs are provided to IRSA external-secrets permissions ([#599](#599)) ([d610954](d610954))
@antonbabenko
Copy link
Member

This PR is included in version 6.1.1 🎉

@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 Sep 18, 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.

3 participants