Skip to content

Fixed incorrect secret creation on drift detection of secret value - #2499

Closed
jorgecarleitao wants to merge 1 commit into
integrations:mainfrom
jorgecarleitao:fix
Closed

jorgecarleitao wants to merge 1 commit into
integrations:mainfrom
jorgecarleitao:fix

Conversation

@jorgecarleitao

@jorgecarleitao jorgecarleitao commented Dec 5, 2024 •

Copy link
Copy Markdown

Resolves #1383
Resolves #2288


Before the change?

Given a .tf with a resource with any secret
When .tf is applied
And the secret's value is externally modified
And .tf is applied
Then the new plan results in the creation of a new secret

After the change?

Given a .tf with a resource with any secret
When .tf is applied
And the secret's value is externally modified
And .tf is applied
Then the plan results in the update of the existing secret

In particular, this behavior enables the use of the lifecycle meta argument to ignore changes to externally updated secrets.

Pull request checklist

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)

NOTE: I could not find any test that I could re-use to introduce an external change to an existing resource. Need support.

Does this introduce a breaking change?

Please see our docs on breaking changes to help!

  • Yes
  • No

@jorgecarleitao jorgecarleitao changed the title Fixed incorrect secrets creation on externally updated secret Fixed incorrect secrets creation on drift detection of secret value Dec 5, 2024
@jorgecarleitao jorgecarleitao changed the title Fixed incorrect secrets creation on drift detection of secret value Fixed incorrect secret creation on drift detection of secret value Dec 5, 2024

@nbali nbali left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, pretty much what I had in mind, ty for your time

@mothilraj

Copy link
Copy Markdown

Please let us know when this fix will be merged.

@dcfsc

dcfsc commented Mar 12, 2025

Copy link
Copy Markdown
Contributor

This issue is making me reconsider the use of Terraform to manage repository secrets, or split secrets into a new configuration.

We create a placeholder secret and ignore the changes, so the team can update the secrets and we will not detect a drift.
Every plan now shows dirty if the value is changed, and if I apply without a target, it replaces the new desired value with the placeholder value. So I have to warn teams NOT to apply when secrets are changed. In most cases the secret comes from somewhere else, but that is additional work AND the plan is now dirty AGAIN.
I will probably grab the code for the latest provider and try to make a patched version for myself. Would love if we could merge this.

@dcfsc

dcfsc commented Mar 14, 2025

Copy link
Copy Markdown
Contributor

I built the latest version of the provider and cherry picked your 1 commit on the "fix" branch. It works like a dream.

@jacobkretz-bf

Copy link
Copy Markdown

@nbali This is a really big issue. Any ETA.

@nbali

nbali commented Apr 24, 2025

Copy link
Copy Markdown

@jacobkretz-bf I'm not sure why are you mentioning me :) I just suggested a solution to the issue, that @jorgecarleitao essentially implemented.

@grobbinsBF

Copy link
Copy Markdown

@kfcampbell What does it take to get this PR approved and released?

@mseelye-bishopfox

Copy link
Copy Markdown

Bumping this again as this is something that is impacting getting clean plans.

@Hibot12

Hibot12 commented Jul 23, 2025

Copy link
Copy Markdown

Seems like an "approving review" is required to merge this PR. When can we expect this patch to land in the source tree?

@nickfloyd nickfloyd moved this from Backlog to In Progress in Terraform Provider Nov 10, 2025
@deiga deiga mentioned this pull request Jan 17, 2026
4 of 5 tasks
@github-project-automation github-project-automation Bot moved this from 👀 In review to ✅ Done in 🧰 Octokit Active Feb 3, 2026
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Terraform Provider Feb 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

9 participants