-
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
aws_iam_role : "must detach all policies first" when changing role path even with force_detach_policies = true #3104
Comments
@ebarault do you happen to have debug log output here and does this happen consistently for you? I'm thinking this doesn't have anything to do with updating the path specifically (that should just cause a regular destroy/create), but maybe we need to adjust the eventual consistency retry time currently present here: https://github.com/terraform-providers/terraform-provider-aws/blob/master/aws/resource_aws_iam_role.go#L326 |
It's also unfortunate that the AWS API does not support updating an IAM role path (unlike IAM groups and users). 😄 |
I just encountered same issue with aws_provider 1.8.0, with only change to the resource was defining the path. |
Reproduced the problem with TF_LOG=DEBUG. Willing to send logs directly to a developer or troubleshooter, but do not want to post publicly. |
Similar type of error, but I am trying to add tags to aws_iam_role resource: resource "aws_iam_role" "ecs_task_role" {
name = "${var.service_name}-task-role-${var.environment}"
description = "Main role for the ${var.service_name} tasks."
force_detach_policies = true
assume_role_policy = "${data.aws_iam_policy_document.ecs_task_assume_role.json}"
tags = "${local.tags}"
} And the error I see:
|
same for me. On aws provider 2.46 version all worked fine |
I'm also having this issue after upgrading. |
Have same issue when doing 'terrafom destroy' |
Same issue for me when a role name is updated. This is really annoying and force me to delete manually the resources. Same as : hashicorp/terraform#2761 and #5417. |
Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label. If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you! |
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. |
Terraform Version
Terraform v0.11.2
AWS provider 1.7.1
Affected Resource(s)
If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.
Terraform Configuration Files
Expected Behavior
when changing
aws_iam_role.path
, the policies should be detached, then the role destroyed and created againActual Behavior
References
Possibly linked
#2279
The text was updated successfully, but these errors were encountered: