IAM Role not added to state when inline IAM Policy is invalid #23124
Labels
bug
Addresses a defect in current functionality.
service/iam
Issues and PRs that pertain to the iam service.
Community Note
Terraform CLI and Terraform AWS Provider Version
Terraform Configuration Files
This config is invalid due to the
inline_policy
missing theactions
.Debug Output
Plan, Apply and Import logs showing the issue.
Debug Logs
Panic Output
N/A
Expected Behavior
The IAM Role should be added to the state, allowing a second
terraform apply
to fix the IAM Policy.terraform apply
creates the role, ERRORMalformedPolicyDocument
on the policyterraform plan
shows only the IAM Policy to be updatedterraform apply
updates the IAM Policy and finishes successfully.Actual Behavior
terraform apply
creates the IAM Role. ERRORMalformedPolicyDocument
on the policyterraform plan
shows the IAM Policy and the IAM Role to be createdterraform apply
ERROREntityAlreadyExists
as the IAM Role was created on the first run, but not added to state.Steps to Reproduce
Just run the config above twice.
terraform apply
-MalformedPolicyDocument
terraform apply
-EntityAlreadyExists
Important Factoids
References
The text was updated successfully, but these errors were encountered: