Closed MS99-9 closed 4 days ago
Voting for Prioritization
For Submitters
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 _exclusive
IAM resources (role, group, and user variants of both customer managed and inline policies). The resulting error still looks similar to the screenshot in the PR body:
│ Error: Null Set Value
│
│ with aws_iam_role_policy_attachments_exclusive.test,
│ on main.tf line 27, in resource "aws_iam_role_policy_attachments_exclusive" "test":
│ 27: policy_arns = [
│ 28: aws_iam_policy.test.arn,
│ 29: null, # test should trigger a plan time validation failure
│ 30: ]
│
│ This attribute contains a null value.
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. Thanks
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