instance_profile.role not updated when role detached #25646
Labels
service/ec2
Issues and PRs that pertain to the ec2 service.
service/iam
Issues and PRs that pertain to the iam service.
The instance_profile attached role does not get updated in the state when the role is detached via other means.
See:
Ref: https://github.com/hashicorp/terraform-provider-aws/blob/main/internal/service/iam/instance_profile.go#L262
Ref: https://github.com/hashicorp/terraform-provider-aws/blob/main/internal/service/iam/instance_profile.go#L323
When the role is removed
len(instanceProfile.Roles) == 0
so the update code block never runs.Community Note
Terraform CLI and Terraform AWS Provider Version
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
Terraform fails to notice the change in state. It is expected that terraform plan
would reconcile the state change.
Actual Behavior
The detachment of the Role was not reflected in the state when planning.
The text was updated successfully, but these errors were encountered: