-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Changing terraform name of policy attachment caused provider bug: "Error: Provider produced inconsistent result after apply" #12127
Comments
The workaround seems to be to rerun the apply. |
Simply rerunning the apply from Terraform Cloud did not fix it for me. It still failed with the same error. I tried to destroy and reapply (which is an option for me but not for many), and destroying from Terraform Cloud also failed on the job role in question:
After manually deleting the role in the AWS console, the destroy succeeded, but then applying failed with the original error message. |
Despite the error message, the role and its policies were successfully created and function. |
…e resources Reference: #12127 Reference: #16247 Reference: #16796 Output from acceptance testing in AWS Commerical: ``` --- PASS: TestAccAWSIAMRole_badJSON (11.02s) --- PASS: TestAccAWSIAMRole_basic (23.54s) --- PASS: TestAccAWSIAMRole_basicWithDescription (53.20s) --- PASS: TestAccAWSIAMRole_disappears (46.04s) --- PASS: TestAccAWSIAMRole_force_detach_policies (51.73s) --- PASS: TestAccAWSIAMRole_MaxSessionDuration (87.07s) --- PASS: TestAccAWSIAMRole_namePrefix (24.63s) --- PASS: TestAccAWSIAMRole_PermissionsBoundary (124.99s) --- PASS: TestAccAWSIAMRole_policyBasicInline (100.26s) --- PASS: TestAccAWSIAMRole_policyBasicInlineEmpty (49.13s) --- PASS: TestAccAWSIAMRole_policyBasicManaged (97.33s) --- PASS: TestAccAWSIAMRole_policyOutOfBandAdditionIgnored_inlineNonExistent (94.08s) --- PASS: TestAccAWSIAMRole_policyOutOfBandAdditionIgnored_managedNonExistent (74.63s) --- PASS: TestAccAWSIAMRole_policyOutOfBandAdditionRemoved_inlineEmpty (76.32s) --- PASS: TestAccAWSIAMRole_policyOutOfBandAdditionRemoved_inlineNonEmpty (79.85s) --- PASS: TestAccAWSIAMRole_policyOutOfBandAdditionRemoved_managedEmpty (76.09s) --- PASS: TestAccAWSIAMRole_policyOutOfBandAdditionRemoved_managedNonEmpty (77.20s) --- PASS: TestAccAWSIAMRole_policyOutOfBandRemovalAddedBack_inlineNonEmpty (77.85s) --- PASS: TestAccAWSIAMRole_policyOutOfBandRemovalAddedBack_managedNonEmpty (77.66s) --- PASS: TestAccAWSIAMRole_tags (80.65s) --- PASS: TestAccAWSIAMRole_testNameChange (82.60s) --- PASS: TestAccAWSIAMRolePolicy_basic (49.38s) --- PASS: TestAccAWSIAMRolePolicy_disappears (46.58s) --- PASS: TestAccAWSIAMRolePolicy_generatedName (67.85s) --- PASS: TestAccAWSIAMRolePolicy_invalidJSON (4.22s) --- PASS: TestAccAWSIAMRolePolicy_namePrefix (56.10s) --- PASS: TestAccAWSIAMRolePolicy_Policy_InvalidResource (26.78s) --- PASS: TestAccAWSRolePolicyAttachment_basic (81.14s) --- PASS: TestAccAWSRolePolicyAttachment_disappears (28.61s) --- PASS: TestAccAWSRolePolicyAttachment_disappears_Role (32.83s) ``` Output from acceptance testing in AWS GovCloud (US): ``` --- PASS: TestAccAWSIAMRole_badJSON (15.80s) --- PASS: TestAccAWSIAMRole_basic (56.37s) --- PASS: TestAccAWSIAMRole_basicWithDescription (117.55s) --- PASS: TestAccAWSIAMRole_disappears (32.81s) --- PASS: TestAccAWSIAMRole_force_detach_policies (65.18s) --- PASS: TestAccAWSIAMRole_MaxSessionDuration (88.44s) --- PASS: TestAccAWSIAMRole_namePrefix (56.26s) --- PASS: TestAccAWSIAMRole_PermissionsBoundary (135.60s) --- PASS: TestAccAWSIAMRole_policyBasicInline (98.21s) --- PASS: TestAccAWSIAMRole_policyBasicInlineEmpty (39.47s) --- PASS: TestAccAWSIAMRole_policyBasicManaged (98.71s) --- PASS: TestAccAWSIAMRole_policyOutOfBandAdditionIgnored_inlineNonExistent (112.38s) --- PASS: TestAccAWSIAMRole_policyOutOfBandAdditionIgnored_managedNonExistent (82.67s) --- PASS: TestAccAWSIAMRole_policyOutOfBandAdditionRemoved_inlineEmpty (76.48s) --- PASS: TestAccAWSIAMRole_policyOutOfBandAdditionRemoved_inlineNonEmpty (85.73s) --- PASS: TestAccAWSIAMRole_policyOutOfBandAdditionRemoved_managedEmpty (84.34s) --- PASS: TestAccAWSIAMRole_policyOutOfBandAdditionRemoved_managedNonEmpty (86.56s) --- PASS: TestAccAWSIAMRole_policyOutOfBandRemovalAddedBack_inlineNonEmpty (66.74s) --- PASS: TestAccAWSIAMRole_policyOutOfBandRemovalAddedBack_managedNonEmpty (74.49s) --- PASS: TestAccAWSIAMRole_tags (74.03s) --- PASS: TestAccAWSIAMRole_testNameChange (93.57s) --- PASS: TestAccAWSIAMRolePolicy_basic (78.62s) --- PASS: TestAccAWSIAMRolePolicy_disappears (35.25s) --- PASS: TestAccAWSIAMRolePolicy_generatedName (100.35s) --- PASS: TestAccAWSIAMRolePolicy_invalidJSON (9.46s) --- PASS: TestAccAWSIAMRolePolicy_namePrefix (84.49s) --- PASS: TestAccAWSIAMRolePolicy_Policy_InvalidResource (27.87s) --- PASS: TestAccAWSRolePolicyAttachment_basic (88.63s) --- PASS: TestAccAWSRolePolicyAttachment_disappears (32.95s) --- PASS: TestAccAWSRolePolicyAttachment_disappears_Role (43.69s) ```
…e resources (#18435) * service/iam: Handle read-after-create eventual consistency in IAM Role resources Reference: #12127 Reference: #16247 Reference: #16796 Output from acceptance testing in AWS Commerical: ``` --- PASS: TestAccAWSIAMRole_badJSON (11.02s) --- PASS: TestAccAWSIAMRole_basic (23.54s) --- PASS: TestAccAWSIAMRole_basicWithDescription (53.20s) --- PASS: TestAccAWSIAMRole_disappears (46.04s) --- PASS: TestAccAWSIAMRole_force_detach_policies (51.73s) --- PASS: TestAccAWSIAMRole_MaxSessionDuration (87.07s) --- PASS: TestAccAWSIAMRole_namePrefix (24.63s) --- PASS: TestAccAWSIAMRole_PermissionsBoundary (124.99s) --- PASS: TestAccAWSIAMRole_policyBasicInline (100.26s) --- PASS: TestAccAWSIAMRole_policyBasicInlineEmpty (49.13s) --- PASS: TestAccAWSIAMRole_policyBasicManaged (97.33s) --- PASS: TestAccAWSIAMRole_policyOutOfBandAdditionIgnored_inlineNonExistent (94.08s) --- PASS: TestAccAWSIAMRole_policyOutOfBandAdditionIgnored_managedNonExistent (74.63s) --- PASS: TestAccAWSIAMRole_policyOutOfBandAdditionRemoved_inlineEmpty (76.32s) --- PASS: TestAccAWSIAMRole_policyOutOfBandAdditionRemoved_inlineNonEmpty (79.85s) --- PASS: TestAccAWSIAMRole_policyOutOfBandAdditionRemoved_managedEmpty (76.09s) --- PASS: TestAccAWSIAMRole_policyOutOfBandAdditionRemoved_managedNonEmpty (77.20s) --- PASS: TestAccAWSIAMRole_policyOutOfBandRemovalAddedBack_inlineNonEmpty (77.85s) --- PASS: TestAccAWSIAMRole_policyOutOfBandRemovalAddedBack_managedNonEmpty (77.66s) --- PASS: TestAccAWSIAMRole_tags (80.65s) --- PASS: TestAccAWSIAMRole_testNameChange (82.60s) --- PASS: TestAccAWSIAMRolePolicy_basic (49.38s) --- PASS: TestAccAWSIAMRolePolicy_disappears (46.58s) --- PASS: TestAccAWSIAMRolePolicy_generatedName (67.85s) --- PASS: TestAccAWSIAMRolePolicy_invalidJSON (4.22s) --- PASS: TestAccAWSIAMRolePolicy_namePrefix (56.10s) --- PASS: TestAccAWSIAMRolePolicy_Policy_InvalidResource (26.78s) --- PASS: TestAccAWSRolePolicyAttachment_basic (81.14s) --- PASS: TestAccAWSRolePolicyAttachment_disappears (28.61s) --- PASS: TestAccAWSRolePolicyAttachment_disappears_Role (32.83s) ``` Output from acceptance testing in AWS GovCloud (US): ``` --- PASS: TestAccAWSIAMRole_badJSON (15.80s) --- PASS: TestAccAWSIAMRole_basic (56.37s) --- PASS: TestAccAWSIAMRole_basicWithDescription (117.55s) --- PASS: TestAccAWSIAMRole_disappears (32.81s) --- PASS: TestAccAWSIAMRole_force_detach_policies (65.18s) --- PASS: TestAccAWSIAMRole_MaxSessionDuration (88.44s) --- PASS: TestAccAWSIAMRole_namePrefix (56.26s) --- PASS: TestAccAWSIAMRole_PermissionsBoundary (135.60s) --- PASS: TestAccAWSIAMRole_policyBasicInline (98.21s) --- PASS: TestAccAWSIAMRole_policyBasicInlineEmpty (39.47s) --- PASS: TestAccAWSIAMRole_policyBasicManaged (98.71s) --- PASS: TestAccAWSIAMRole_policyOutOfBandAdditionIgnored_inlineNonExistent (112.38s) --- PASS: TestAccAWSIAMRole_policyOutOfBandAdditionIgnored_managedNonExistent (82.67s) --- PASS: TestAccAWSIAMRole_policyOutOfBandAdditionRemoved_inlineEmpty (76.48s) --- PASS: TestAccAWSIAMRole_policyOutOfBandAdditionRemoved_inlineNonEmpty (85.73s) --- PASS: TestAccAWSIAMRole_policyOutOfBandAdditionRemoved_managedEmpty (84.34s) --- PASS: TestAccAWSIAMRole_policyOutOfBandAdditionRemoved_managedNonEmpty (86.56s) --- PASS: TestAccAWSIAMRole_policyOutOfBandRemovalAddedBack_inlineNonEmpty (66.74s) --- PASS: TestAccAWSIAMRole_policyOutOfBandRemovalAddedBack_managedNonEmpty (74.49s) --- PASS: TestAccAWSIAMRole_tags (74.03s) --- PASS: TestAccAWSIAMRole_testNameChange (93.57s) --- PASS: TestAccAWSIAMRolePolicy_basic (78.62s) --- PASS: TestAccAWSIAMRolePolicy_disappears (35.25s) --- PASS: TestAccAWSIAMRolePolicy_generatedName (100.35s) --- PASS: TestAccAWSIAMRolePolicy_invalidJSON (9.46s) --- PASS: TestAccAWSIAMRolePolicy_namePrefix (84.49s) --- PASS: TestAccAWSIAMRolePolicy_Policy_InvalidResource (27.87s) --- PASS: TestAccAWSRolePolicyAttachment_basic (88.63s) --- PASS: TestAccAWSRolePolicyAttachment_disappears (32.95s) --- PASS: TestAccAWSRolePolicyAttachment_disappears_Role (43.69s) ``` * Update CHANGELOG for #18435
This has been released in version 3.35.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 for triage. Thanks! |
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. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Community Note
Terraform Version
Terraform v0.12.20
Affected Resource(s)
Terraform Configuration Files
Not provided
Debug Output
Panic Output
Expected Behavior
Simple apply
Actual Behavior
Terraform errored out with a message to file a bug on the provider:
Steps to Reproduce
terraform apply
Important Factoids
The policy attachment
aws_iam_role_policy_attachment.tileservice_foreign_s3_access
already existed with the nameaws_iam_role_policy_attachment.foreign_s3_access
. There was no other change to this resource than changing the name of the block in terraform (should not have produced a change on the AWS side other than too the ID string).The text was updated successfully, but these errors were encountered: