Skip to content
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

helper/schema: Add validation to prevent write-only attributes in set nested blocks #1427

Merged
merged 3 commits into from
Feb 18, 2025

Conversation

SBGoods
Copy link
Contributor

@SBGoods SBGoods commented Feb 18, 2025

Write-only attributes when used with ephemeral data cannot be used within any set and set-based data due to limitations in Terraform Core. This PR adds validation to block write-only attributes from being used within set nested blocks.

@SBGoods SBGoods requested review from a team as code owners February 18, 2025 22:14
@SBGoods SBGoods added this to the v2.36.1 milestone Feb 18, 2025
@SBGoods SBGoods force-pushed the SBGoods/write-only-set-validation branch from 75f6c6e to cca1351 Compare February 18, 2025 23:31
Copy link
Contributor Author

@SBGoods SBGoods left a comment

Choose a reason for hiding this comment

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

Failing CI checks will be resolved after #1428 is merged

Copy link
Member

@austinvalle austinvalle left a comment

Choose a reason for hiding this comment

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

LGTM :shipit:

Copy link
Member

Choose a reason for hiding this comment

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

I don't think we have to repeat this changelog, but I'm not expressly against it 😆

@@ -5303,7 +5303,7 @@ func TestSchemaMap_InternalValidate(t *testing.T) {
},
true,
},
"Set configuration block nested attribute with WriteOnly set returns no errors": {
"Set configuration block nested attribute with WriteOnly set returns error": {
Copy link
Member

Choose a reason for hiding this comment

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

Nice that we already had tests for it!

@SBGoods SBGoods added the bug Something isn't working label Feb 18, 2025
@SBGoods SBGoods merged commit b7f3e6f into main Feb 18, 2025
23 checks passed
@SBGoods SBGoods deleted the SBGoods/write-only-set-validation branch February 18, 2025 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants