热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

aws_iam_policy_attachmenterrorwhenattachingamazon"managed"policies

Thisissuewasoriginallyopenedbyashashicorp/terraform#5979.Itwasmigratedhe

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!


推荐阅读
author-avatar
安彬2502936127
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有