Cloudformation:在没有Load Balancer的情况下创建ElasticBeanstalk

时间:2017-09-01 13:15:51

标签: elastic-beanstalk amazon-cloudformation amazon-elastic-beanstalk

如何在没有负载均衡器的情况下创建ElasticBeanstalk environment?我没有在aws:autoscaling:launchconfiguration中禁用它的任何选项。

可以从AWS管理控制台turn off load balancing manually获得。

这是我的Cloudformation堆栈模板:

WsServerEBApp:
    Type: "AWS::ElasticBeanstalk::Application"
    Properties:
      ApplicationName: WS Server
      Description: App for Websocket Server that will hold EB Environments

  WsServerEBEnvironemt:
      Type: 'AWS::ElasticBeanstalk::Environment'
      Properties:
        EnvironmentName: staging
        ApplicationName: !Ref WsServerEBApp
        CNAMEPrefix: staging
        SolutionStackName: 64bit Amazon Linux 2017.03 v2.7.3 running Docker 17.03.1-ce
        VersionLabel: !Ref WsServerEBAppVersion
        OptionSettings:
          - Namespace: 'aws:autoscaling:launchconfiguration'
            OptionName: EC2KeyName
            Value: !Ref KeyName
          - Namespace: 'aws:autoscaling:launchconfiguration'
            OptionName: IamInstanceProfile
            Value: aws-elasticbeanstalk-ec2-role
          - Namespace: 'aws:autoscaling:launchconfiguration'
            OptionName: SecurityGroups
            Value:
              - launch-wizard-1

  WsServerEBAppVersion:
    Type: 'AWS::ElasticBeanstalk::ApplicationVersion'
    Properties:
      ApplicationName: !Ref WsServerEBApp

1 个答案:

答案 0 :(得分:1)

我使用EnvironmentType值作为 SingleInstance

WsServerEBEnvironemt:
      Type: 'AWS::ElasticBeanstalk::Environment'
      Properties:
        ....
        OptionSettings:
             ....
             - Namespace: aws:elasticbeanstalk:environment
                  OptionName: EnvironmentType
                  Value: SingleInstance