-
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
provider/aws: Add support for iam_role tp force_detach_policies #890
Conversation
Fixes: #883 ``` % make testacc TEST=./aws TESTARGS='-run=TestAccAWSIAMRole_' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws -v -run=TestAccAWSIAMRole_ -timeout 120m === RUN TestAccAWSIAMRole_importBasic --- PASS: TestAccAWSIAMRole_importBasic (90.60s) === RUN TestAccAWSIAMRole_basic --- PASS: TestAccAWSIAMRole_basic (63.38s) === RUN TestAccAWSIAMRole_basicWithDescription --- PASS: TestAccAWSIAMRole_basicWithDescription (160.94s) === RUN TestAccAWSIAMRole_namePrefix --- PASS: TestAccAWSIAMRole_namePrefix (82.85s) === RUN TestAccAWSIAMRole_testNameChange --- PASS: TestAccAWSIAMRole_testNameChange (104.43s) === RUN TestAccAWSIAMRole_badJSON --- PASS: TestAccAWSIAMRole_badJSON (5.03s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 507.244s ```
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM except one question about the comment wording.
RoleName: aws.String(d.Id()), | ||
}) | ||
if err != nil { | ||
return fmt.Errorf("Error listing Policies for IAM Role (%s) when trying to delete: %s", d.Id(), err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I appreciate the descriptive error message here ❤️
aws/resource_aws_iam_role.go
Outdated
if err != nil { | ||
return fmt.Errorf("Error listing Policies for IAM Role (%s) when trying to delete: %s", d.Id(), err) | ||
} | ||
// Loop and remove this Role from any Profiles |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and remove these Policies from the Role ? 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update made - will merge on green ;)
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! |
Fixes: #883