terraform-provider-awscc
terraform-provider-awscc copied to clipboard
awscc_iam_role destroy fails - must detach all policies first
Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
- Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment
- The resources and data sources in this provider are generated from the CloudFormation schema, so they can only support the actions that the underlying schema supports. For this reason submitted bugs should be limited to defects in the generation and runtime code of the provider. Customizing behavior of the resource, or noting a gap in behavior are not valid bugs and should be submitted as enhancements to AWS via the Cloudformation Open Coverage Roadmap.
Terraform CLI and Terraform AWS Cloud Control Provider Version
Terraform v1.0.10
on linux_amd64
+ provider registry.terraform.io/hashicorp/awscc v0.4.0
Affected Resource(s)
- awscc_iam_role
Terraform Configuration Files
Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.
provider "awscc" {
region = "eu-west-1"
}
resource "awscc_iam_role" "lambda" {
role_name = "foo"
assume_role_policy_document = jsonencode({
Version = "2012-10-17"
Statement = [
{
Action = "sts:AssumeRole"
Effect = "Allow"
Principal = {
Service = "lambda.amazonaws.com"
}
},
]
})
managed_policy_arns = ["arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"]
}
Error Output
│ Error: AWS SDK Go Service Operation Unsuccessful
│
│ Calling Cloud Control API service DeleteResource operation returned: waiter state transitioned to FAILED. StatusMessage: Cannot delete entity, must detach all policies first. (Service: Iam, Status Code: 409, Request ID: ea9bffec-e7bb-4da0-9d07-41e9b6de1dcd, Extended Request ID: null). ErrorCode: GeneralServiceException
╵
Expected Behavior
destroy succeeds.
Actual Behavior
destroy fails.
Steps to Reproduce
terraform applyterraform destroy