作者:安彬2502936127 | 来源:互联网 | 2023-09-05 12:41
This issue was originally opened by as hashicorp/terraform#5979. It was migrated here as part of the provider split. The original body of the issue is below.
For the following config:
1 2 3 4 5 6 7 8 9 10 11
| resource "aws_iam_role" "emr" {
name = "matching-spark-emr-${var.env}"
assume_role_policy = "${file("${path.module}/iam-policy-emr-trust-relationship.tpl")}"
}
# the generic role provided by amazon
resource "aws_iam_policy_attachment" "AmazonElasticMapReduceRole" {
name = "AmazonElasticMapReduceRole"
roles = [ "${aws_iam_role.emr.name}" ]
policy_arn = "arn:aws:iam::aws:policy/service-role/AmazonElasticMapReduceRole"
} |
I Occasionally, get the following error:
1 2 3
| * aws_iam_policy_attachment.AmazonElasticMapReduceRole: [WARN] Error updating user, role, or group list from IAM Policy Attachment AmazonElasticMapReduceRole:
– NoSuchEntity: Policy arn:aws:iam::aws:policy/service-role/AmazonElasticMapReduceRole was not found.
status code: 404, request id: be6c2f10-f824-11e5-9241-eb1509222747 |
Note that I only seem to get this when attaching amazon "managed" policies to a role. A second run results in success. Also, as a note, the above code is in a module, and I call that module multiple times (despite the warning in the documentation about only using "aws_iam_policy_attachment" once per policy.
该提问来源于开源项目:hashicorp/terraform-provider-aws
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!