-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
r/role_policy_attachments_exclusive: Fix 'Value Conversion Error' on … #40076
r/role_policy_attachments_exclusive: Fix 'Value Conversion Error' on … #40076
Conversation
…Create. Signed-off-by: Mohamed Medhat Mohamed Ibrahim Shalaby <[email protected]>
Community NoteVoting for Prioritization
For Submitters
|
Signed-off-by: Mohamed Medhat Mohamed Ibrahim Shalaby <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Welcome @MS99-9 👋
It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTOR guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.
Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.
Thanks again, and welcome to the community! 😃
…ValueConversionError
This custom validator checks for the presence of null values within a set, raising a plan time validation error if detected. ```console % go test ./internal/framework/validators/... ok github.com/hashicorp/terraform-provider-aws/internal/framework/validators 0.773s ```
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🎉
% make testacc PKG=iam TESTS="TestAccIAM.*PolicyAttachmentsExclusive_"
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.2 test ./internal/service/iam/... -v -count 1 -parallel 20 -run='TestAccIAM.*PolicyAttachmentsExclusive_' -timeout 360m
2024/11/11 15:31:02 Initializing Terraform AWS Provider...
--- PASS: TestAccIAMGroupPolicyAttachmentsExclusive_basic (27.53s)
=== CONT TestAccIAMGroupPolicyAttachmentsExclusive_empty
--- PASS: TestAccIAMUserPolicyAttachmentsExclusive_basic (27.64s)
--- PASS: TestAccIAMGroupPolicyAttachmentsExclusive_disappears_Policy (35.79s)
--- PASS: TestAccIAMRolePolicyAttachmentsExclusive_disappears_Role (35.82s)
--- PASS: TestAccIAMRolePolicyAttachmentsExclusive_disappears_Policy (35.84s)
--- PASS: TestAccIAMUserPolicyAttachmentsExclusive_disappears_User (36.03s)
--- PASS: TestAccIAMUserPolicyAttachmentsExclusive_empty (37.76s)
--- PASS: TestAccIAMUserPolicyAttachmentsExclusive_disappears_Policy (40.78s)
--- PASS: TestAccIAMGroupPolicyAttachmentsExclusive_disappears_Group (40.80s)
--- PASS: TestAccIAMRolePolicyAttachmentsExclusive_empty (42.78s)
--- PASS: TestAccIAMRolePolicyAttachmentsExclusive_basic (45.26s)
--- PASS: TestAccIAMGroupPolicyAttachmentsExclusive_multiple (46.06s)
--- PASS: TestAccIAMUserPolicyAttachmentsExclusive_multiple (46.32s)
--- PASS: TestAccIAMUserPolicyAttachmentsExclusive_outOfBandAddition (48.83s)
--- PASS: TestAccIAMRolePolicyAttachmentsExclusive_outOfBandAddition (49.06s)
--- PASS: TestAccIAMGroupPolicyAttachmentsExclusive_outOfBandRemoval (49.82s)
--- PASS: TestAccIAMGroupPolicyAttachmentsExclusive_outOfBandAddition (49.96s)
--- PASS: TestAccIAMUserPolicyAttachmentsExclusive_outOfBandRemoval (49.97s)
--- PASS: TestAccIAMGroupPolicyAttachmentsExclusive_empty (22.48s)
--- PASS: TestAccIAMRolePolicyAttachmentsExclusive_outOfBandRemoval (52.07s)
--- PASS: TestAccIAMRolePolicyAttachmentsExclusive_multiple (54.38s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/iam 59.389s
% make testacc PKG=iam TESTS="TestAccIAM.*PoliciesExclusive_"
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.2 test ./internal/service/iam/... -v -count 1 -parallel 20 -run='TestAccIAM.*PoliciesExclusive_' -timeout 360m
2024/11/11 15:35:35 Initializing Terraform AWS Provider...
--- PASS: TestAccIAMUserPoliciesExclusive_empty (29.75s)
--- PASS: TestAccIAMRolePoliciesExclusive_empty (30.14s)
--- PASS: TestAccIAMGroupPoliciesExclusive_disappears_Group (31.95s)
--- PASS: TestAccIAMGroupPoliciesExclusive_basic (33.12s)
--- PASS: TestAccIAMUserPoliciesExclusive_basic (33.23s)
--- PASS: TestAccIAMRolePoliciesExclusive_basic (34.02s)
--- PASS: TestAccIAMUserPoliciesExclusive_disappears_User (34.02s)
--- PASS: TestAccIAMGroupPoliciesExclusive_empty (35.27s)
--- PASS: TestAccIAMRolePoliciesExclusive_disappears_Role (35.30s)
--- PASS: TestAccIAMGroupPoliciesExclusive_outOfBandAddition (43.21s)
--- PASS: TestAccIAMGroupPoliciesExclusive_outOfBandRemoval (43.65s)
--- PASS: TestAccIAMRolePoliciesExclusive_outOfBandRemoval (43.94s)
--- PASS: TestAccIAMUserPoliciesExclusive_outOfBandRemoval (44.03s)
--- PASS: TestAccIAMUserPoliciesExclusive_multiple (44.14s)
--- PASS: TestAccIAMGroupPoliciesExclusive_multiple (44.15s)
--- PASS: TestAccIAMUserPoliciesExclusive_outOfBandAddition (44.27s)
--- PASS: TestAccIAMRolePoliciesExclusive_outOfBandAddition (44.37s)
--- PASS: TestAccIAMRolePoliciesExclusive_multiple (46.41s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/iam 51.423s
Thanks for your contribution, @MS99-9 ! 👍 I modified the change slightly to use a custom set validator which checks for the presence of null values. I also applied this validator to the other
Appreciate you picking this up! |
This is my first contribution so your feedback is really appreciated @jar-b, I also learned from the commits you added to make the validator more dynamic so we can re-use it for other resources. I will take this into consideration for my next contributions. |
This functionality has been released in v5.76.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
Description
Error raised here: https://github.com/hashicorp/terraform-plugin-framework/blob/c9bbe5e02cfc78b6efe82a227a55c26dc2a1daa9/internal/reflect/into.go#L130-L149. As Allowing Unhandled Nulls was set to false here: https://github.com/hashicorp/terraform-provider-aws/blob/main/internal/service/iam/role_policy_attachments_exclusive.go#L71
Please find attached a screenshot for the new error message after building the development provider and running it locally.
Relations
Closes #39786
References
Output from Acceptance Testing