fix: Prevent perpetual drift on OIDC thumbprint when root CA thumbprint is disabled#3673
Open
raman1236 wants to merge 2 commits intoterraform-aws-modules:masterfrom
Open
Conversation
…nt is disabled When `include_oidc_root_ca_thumbprint` is set to `false` and no `custom_oidc_thumbprints` are provided, `thumbprint_list` resolves to an empty list `[]`. On apply, Terraform sets the empty list, but AWS auto-provisions a thumbprint for the OIDC provider. On the next plan, Terraform detects the AWS-managed thumbprint and proposes to remove it, causing a perpetual diff. Fix by setting `thumbprint_list` to `null` when both sources are empty. Per the AWS provider docs, when `thumbprint_list` is not set, the OIDC provider thumbprint is auto-managed by AWS and Terraform won't attempt to reconcile it. Fixes terraform-aws-modules#3607
Author
|
Friendly ping — this PR prevents perpetual drift on the OIDC thumbprint when root CA thumbprint is disabled. Would appreciate a review when you have a moment. Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When
include_oidc_root_ca_thumbprintis set tofalseand nocustom_oidc_thumbprintsare provided,thumbprint_listresolves to an empty list[]. On apply, Terraform sets the empty list on the OIDC provider, but AWS auto-provisions a thumbprint for the provider. On the nextterraform plan, Terraform detects the AWS-managed thumbprint and proposes to remove it — causing a perpetual diff:Fix
Set
thumbprint_listtonullwhen bothoidc_root_ca_thumbprintandcustom_oidc_thumbprintsare empty. Per the AWS provider docs, whenthumbprint_listis not set, the OIDC provider thumbprint is auto-managed by AWS and Terraform won't attempt to reconcile it.When either source provides thumbprints, the existing
concat()behavior is preserved.Reproduction
terraform apply— creates OIDC provider with empty thumbprint listterraform plan— shows removal of AWS-managed thumbprint (perpetual drift)Breaking Changes
None. When
include_oidc_root_ca_thumbprint = true(the default) orcustom_oidc_thumbprintsare provided, behavior is unchanged.How Has This Been Tested?
pre-commit run -aon my pull requestFixes #3607
Related to #3586 (prior fix attempt, closed for lack of reproduction)