amazon-web-services - 将 ENI 主干附加到 cloudform 中的自定义安全组

标签 amazon-web-services amazon-ec2 aws-cloudformation amazon-ecs

我最近在 ECS 中启用了 ENI 中继功能。将创建一个额外的 ENI 接口(interface)并将其附加到默认安全组。

Cloudformation(ec2启动模板)用于启动ec2实例。如何在启动模板中将额外的 ENI 中继接口(interface)与自定义安全组附加在一起?网络接口(interface)中分配的组不生效。

ECSAutoScalingGroup:
    Type: AWS::AutoScaling::AutoScalingGroup
    Properties:
      AutoScalingGroupName: MyECSAutoScalingGroup
      VPCZoneIdentifier: !Ref Subnets
      MixedInstancesPolicy:
        LaunchTemplate:
          LaunchTemplateSpecification:
            LaunchTemplateId: !Ref ECSLaunchTemplate
            Version: !GetAtt ECSLaunchTemplate.LatestVersionNumber
      MinSize: !Ref ClusterSize
      MaxSize: !Ref ClusterMaxSize
      DesiredCapacity: !Ref DesiredSize

  ECSLaunchTemplate:
    Type: AWS::EC2::LaunchTemplate
    Properties:
      LaunchTemplateName: MyECSLaunchTemplate
      LaunchTemplateData: 
        KeyName: MyKey
        ImageId: !Ref ImageId
        InstanceType: !Ref InstanceType
        SecurityGroupIds:
          - !Ref SecurityGroup
        IamInstanceProfile:
          Arn: !GetAtt ECSInstanceProfile.Arn
        NetworkInterfaces:
          - AssociatePublicIpAddress: false
            DeviceIndex: 1
            Groups:
              - !Ref SecurityGroup

最佳答案

ECS 目前不支持此功能。它包含在功能请求中,但没有预计何时发布。 因此,最好的解决方法是将默认安全组限制为与自定义安全组相同的规则集。

关于amazon-web-services - 将 ENI 主干附加到 cloudform 中的自定义安全组,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/75966647/

相关文章:

amazon-web-services - AWS Application Load Balancer HTTP 到 HTTPS 与 EC2 实例

amazon-web-services - 导出 AppSync 状态/配置?

ssl-certificate - 云形成的 Elastic beanstalk 上的 SSL 证书

php - 缺少 Amazon AMI PDO MYSQL 驱动程序。没有适用于 PHP 7.1 的软件包。如何安装 7.1 PDO_MYSQL 驱动程序?

hadoop - AWS China hadoop master-将hdfs文件复制到S3的S3DistCp命令抛出NoClassDefFoundError:com/google/gson/internal/Pair

amazon-web-services - Lambda 返回有效负载 botocore.response.StreamingBody 对象打印但随后在变量中为空

amazon-web-services - AWS Config - MaxNumberOfDeliveryChannelsExceededException

java - 使用 CDK 创建 ssh key 对/将其关联到 ec2 实例

linux - 使用 spark 的 s3 上传性能不佳

amazon ec2 中的 docker app 此站点无法提供安全连接