【问题标题】:Error with Instance profile role for EMR?EMR 的实例配置文件角色错误?
【发布时间】:2018-11-08 14:17:02
【问题描述】:

我正在尝试通过 terraform 构建 EMR 集群。但是我在应用代码时遇到了以下错误。 IAM_EMR_for_EC2 是我为集群中的 EC2 创建的要代入的实例配置文件角色。

发生了 1 个错误:

  • aws_emr_cluster.tf-test-cluster:发生 1 个错误:

  • aws_emr_cluster.tf-test-cluster:ValidationException:实例配置文件“arn:aws:iam:::role/IAM_EMR_for_EC2”不是 格式良好。需要一个 INSTANCE_PROFILE 类型的资源。 状态码:400,请求ID:6bd4461c-637f-11e8-8605-c930816c10b8

谁能帮助我,因为我无法理解此错误,也无法在 google 上找到任何详细信息。

【问题讨论】:

  • 你能提供一些示例 terraform 代码吗?这将有助于找出可能出现的问题

标签: amazon-web-services terraform amazon-emr


【解决方案1】:

您应用的是角色而不是实例配置文件,它们实际上是不同的。 ARN 的格式必须为arn:aws:iam::336924118301:instance-profile/ExampleInstanceProfile

角色需要附加到实例配置文件资源。

【讨论】:

    【解决方案2】:

    你应该写instance_profile = "${aws_iam_instance_profile.emr_profile.arn}"

    同时创建 emr_profile 资源: resource "aws_iam_instance_profile" "emr_profile" { name = "emr_profile" role = "${aws_iam_role.EMR_EC2_DefaultRole.name}" }

    【讨论】:

      猜你喜欢
      • 2018-04-03
      • 1970-01-01
      • 1970-01-01
      • 2018-10-20
      • 1970-01-01
      • 1970-01-01
      • 2021-11-10
      • 1970-01-01
      • 2016-06-27
      相关资源
      最近更新 更多