gpt4 book ai didi

amazon-web-services - OptionSettings 的多个值

转载 作者:行者123 更新时间:2023-12-03 07:19:31 24 4
gpt4 key购买 nike

我需要将多个安全组添加到我的 EB 环境中。这是我的 EB 环境模板的一部分:

  Type: 'AWS::ElasticBeanstalk::Environment'
Properties:
...
OptionSettings:
- Namespace: 'aws:autoscaling:launchconfiguration'
OptionName: SecurityGroups
Value: ...

我尝试:

使用安全组 2x

但后者会覆盖前面的值

      - Namespace: 'aws:autoscaling:launchconfiguration'
OptionName: SecurityGroups
Value:
- !Sub ${EnvironmentPrefix}-ssh
- Namespace: 'aws:autoscaling:launchconfiguration'
OptionName: SecurityGroups
Value:
- launch-wizard-1

使用数组

但最终出现错误:

Value of property Value must be of type String

      - Namespace: 'aws:autoscaling:launchconfiguration'
OptionName: SecurityGroups
Value:
- !Sub ${EnvironmentPrefix}-ssh
- launch-wizard-1

如何为'AWS::ElasticBeanstalk::Environment'设置多个SecurityGroups

最佳答案

根据documentation您可以传递以逗号分隔的安全组列表作为值。

You can provide a single string of comma-separated values that contain the name of existing Amazon EC2 security groups or references to AWS::EC2::SecurityGroup resources created in the template. If you use Amazon VPC with Elastic Beanstalk so that your instances are launched within a virtual private cloud (VPC), specify security group IDs instead of a security group name.

所以:

  Type: 'AWS::ElasticBeanstalk::Environment'
Properties:
...
OptionSettings:
- Namespace: 'aws:autoscaling:launchconfiguration'
OptionName: SecurityGroups
Value: sg-1,sg-2,sg-3

关于amazon-web-services - OptionSettings 的多个值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47032426/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com