【问题标题】:How to fix : VALIDATION_ERROR: You must also specify a ServiceAccessSecurityGroup Terraform如何修复:VALIDATION_ERROR:您还必须指定 ServiceAccessSecurityGroup Terraform
【发布时间】:2018-11-01 02:44:49
【问题描述】:

我是 terraform 的新手。我在私有子网中启动一个简单的 EMR 集群时遇到了一个问题

失败并显示以下错误消息:

  • aws_emr_cluster.emr-test-cluster:[WARN] 等待 EMR 集群状态为“WAITING”或“RUNNING”时出错:TERMINATED_WITH_ERRORS:VALIDATION_ERROR:如果您在创建集群时使用自定义安全组,还必须指定 ServiceAccessSecurityGroup在私有子网中。

我确实检查了 github 似乎已针对已打开的问题进行了修复。但我使用的是最新版本的 terraform (0.11.7)

以下是 Github 中报告的问题的 github 链接 https://github.com/hashicorp/terraform/issues/9518 https://github.com/hashicorp/terraform/pull/9600

任何有关如何解决此问题的建议都会非常有帮助

谢谢

【问题讨论】:

    标签: terraform terraform-provider-aws


    【解决方案1】:

    此问题已在 Git 中得到修复,因为它在使用 emr_managed_master_security_groupemr_managed_slave_security_group 时显示一个错误,该错误应该要求输入 service_access_security_group

    因此,您需要在 EMR 资源中提及 service_access_security_group 参数。

    谢谢。

    【讨论】:

    • 非常感谢。我已经添加了参数,现在可以正常使用了。
    • 但是该参数的值应该是多少? SG 需要什么规则?
    • 同样的问题,安全组的参数应该是什么?
    • 好的,我在这里找到了回复:docs.aws.amazon.com/emr/latest/ManagementGuide/…
    【解决方案2】:

    我们知道要将 emr 组件放在私有子网中,您必须遵循

    这些安全组

    https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-man-sec-groups.html#emr-sg-elasticmapreduce-sa-private

    然后在 terraform 中,您必须从此 link 解决安全组之间的循环依赖关系,并如下所示进行以下配置

     ec2_attributes {
    subnet_id                         = element(var.subnet_ids, count.index)
    key_name                          = "${var.ssh_key_id}"
    emr_managed_master_security_group = aws_security_group.EmrManagedMasterSecurityGroup.id
    emr_managed_slave_security_group  = aws_security_group.EmrManagedSlaveSecurityGroup.id
    service_access_security_group = aws_security_group.ServiceAccessSecurityGroup.id
    
    #additional_master_security_groups = aws_security_group.allow_ssh.id
    instance_profile = aws_iam_instance_profile.example_ec2_profile.arn
    }
    

    来源:-https://github.com/hashicorp/terraform/pull/9600

    【讨论】:

      猜你喜欢
      • 2021-10-25
      • 2019-06-23
      • 2016-09-30
      • 1970-01-01
      • 2022-06-22
      • 1970-01-01
      • 2021-03-16
      • 2015-11-12
      • 2015-06-22
      相关资源
      最近更新 更多