-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Terraform Test wrongly removing sensitive marks and warning now Terraform Core can handle sensitive inputs #35011
Comments
Hi @seblatre, thanks for filing this! This has been fixed in the 1.8.0 release series, are you able to upgrade to the newly released v1.8.0? We're not currently planning any more releases to the v1.7 series. Thanks! |
Hello @liamcervante, I updated to the latest version and I can confirm that it's working now. |
Hi @seblatre, we don't have a specific issue for this as it seems to have been fixed by a change made to add additional support for an unrelated feature. The PR that fixed it is #34414, with this being the more specific commit: fc75657 In the current code the line that removes the marks you can see are being complained about in the error is here: https://github.com/hashicorp/terraform/blob/main/internal/terraform/context_plan.go#L287. |
Actually, I will reopen this. Within the test framework specifically we are checking for sensitive marks as a way to warn if they are being lost: https://github.com/hashicorp/terraform/blob/main/internal/backend/local/test.go#L1249-L1269 However, we are not checking the embedded values within complex types so that is probably the actual root cause of this issue originally. The fact the plan functionality now handles marked values does not address the bug in the test framework. As it is I think we don't need to print that warning anymore, as the plan can now handle sensitive marks on inputs properly. I'll leave this open as a bug, and we can stop stripping the sensitive marks from inputs within the test framework. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Terraform Version
Terraform Configuration Files
serviceprincipal/main.tf
testedmodule/main.tf
testedmodule/tests/unit.tftest.hcl
Debug Output
Expected Behavior
I'm expecting to be able to pass a secret from one Terraform test run block to another on 2 different modules
Actual Behavior
There is an error happening when I'm trying to pass a secret (sensitive variable) between one run block to the other. When the secret is replaced by an hardcoded value, it's working.
Steps to Reproduce
terraform init
terraform test
Additional Context
No special context, running locally on a Windows PC
References
No response
The text was updated successfully, but these errors were encountered: