update permission boundary on an IAM role with a non existing policy does catch NoSuchEntity error but updates the tfstate #15246
Labels
service/iam
Issues and PRs that pertain to the iam service.
stale
Old or inactive issues managed by automation, if no further action taken these will get closed.
upstream-terraform
Addresses functionality related to the Terraform core binary.
Community Note
Terraform CLI and Terraform AWS Provider Version
terraform version: 12.24
Affected Resource(s)
Terraform Configuration Files
First Apply
tfstate
Second Apply
Output
Expected Behavior
The terraform state remains unmodified
Actual Behavior
The terraform state now contains:
The object in the state should not have the reference to a permission boundary since the first apply has failed and no resource has been modified on AWS, in our case, a third apply works fine and see no changes even if the permission boundary may now exist.
Steps to Reproduce
terraform init
with a file named main.tfterraform apply
with the first codeterraform apply
with the second code, you see the error but the state is updatedterraform apply
again with the same code, no error is shown as if the permission boundary is set but not in reality.The text was updated successfully, but these errors were encountered: