0
votes

How can I create an ElasticBeanstalk environment without a load balancer? I haven't any options to disable it in the aws:autoscaling:launchconfiguration.

It's possible to turn off load balancing manually from AWS Management Console.

This my Cloudformation stack template:

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

1 Answers

1
votes

I did it using EnvironmentType value as SingleInstance:

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