2

I am using the Elastic Beanstalk web UI to create an environment, for a single Docker container. I would like to put all the environment options into a .config file in the application bundle. I'm getting close to this. With the options below I'm nearly there. However, I do have to use the web UI "Configure more options" and change "Capacity" "Environment type" to "Load balanced". Without that my environment fails to start and I get error messages like:

"Load Balancer ListenerEnabled setting cannot be applied because AWSEBLoadBalancer doesn't exist."

Ideas?

Here is the .config file I'm using in my application bundle:

option_settings:  
  aws:elasticbeanstalk:environment:
    ServiceRole: aws-elasticbeanstalk-service-role
    LoadBalancerType: classic
    EnvironmentType: LoadBalanced
  aws:elb:loadbalancer:
    CrossZone: 'false'
  aws:elb:listener:
    ListenerEnabled: 'false'
  aws:elb:listener:443:
    ListenerProtocol: HTTPS
    SSLCertificateId: <snip>
    InstancePort: 80
    InstanceProtocol: HTTP
  aws:elasticbeanstalk:healthreporting:system:
    SystemType: enhanced
  aws:autoscaling:launchconfiguration:
    IamInstanceProfile: aws-elasticbeanstalk-ec2-role
    InstanceType: t2.micro
    EC2KeyName: amazon1    
  aws:autoscaling:asg:
    MaxSize: '1'

Followup, 11/19/17

I've changed things a little and perhaps made a little headway. I didn't know about giving Resources in .config files before. So, I've added a second .config file. I give my current config files below. My situation now is that while the environment startup proceeds farther, it doesn't succeed. The environment launches and all looks good until the very last minute, but where I'd expect the health to transition to Ok, it transitions to Severe:

Environment health has transitioned from Pending to Severe. Initialization completed 45 seconds ago and took 2 minutes. ELB health is failing or not available for all instances.

I have tried changing the ordering of the config files by prepending their names with 00_ and 01_ but independent of the order of the two files, I get exactly the same outcome as above ("Environment health has transitioned..."). Also, I've looked at the logs and see nothing useful there. In fact, there's nothing indicating an error in the logs as far as I can see.

Resources file:

Resources:
  AWSEBLoadBalancer:
    Type: AWS::ElasticLoadBalancing::LoadBalancer
    Properties:
      CrossZone: False

Options file:

option_settings:
  aws:elasticbeanstalk:environment:
    ServiceRole: aws-elasticbeanstalk-service-role
  aws:elb:listener:
    ListenerEnabled: 'false'
  aws:elb:listener:443:
    ListenerProtocol: HTTPS
    SSLCertificateId: <snip>
    InstancePort: 80
    InstanceProtocol: HTTP
  aws:elasticbeanstalk:healthreporting:system:
    SystemType: enhanced
  aws:autoscaling:launchconfiguration:
    IamInstanceProfile: aws-elasticbeanstalk-ec2-role
    InstanceType: t2.micro
    EC2KeyName: amazon1    
  aws:autoscaling:asg:
    MaxSize: '1'

Update:

At least part of what is going on here, I believe, is that the environment, after it starts has "Environment type: Single instance" according to the Elastic Beanstalk web UI.

And I'm getting this with the following (consolidated) .config file:

Resources:
  AWSEBLoadBalancer:
    Type: AWS::ElasticLoadBalancing::LoadBalancer
    Properties:
      Listeners:
      - InstancePort: 80
        InstanceProtocol: HTTP
        LoadBalancerPort: 443
        Protocol: HTTPS
        SSLCertificateId: <snip>
option_settings:
  aws:elb:listener:
    ListenerEnabled: 'false'
  aws:elasticbeanstalk:healthreporting:system:
    SystemType: enhanced
  aws:autoscaling:launchconfiguration:
    IamInstanceProfile: aws-elasticbeanstalk-ec2-role
    InstanceType: t2.micro
    EC2KeyName: amazon1    
  aws:autoscaling:asg:
    MaxSize: '1'
  aws:elasticbeanstalk:environment:
    EnvironmentType: LoadBalanced
    LoadBalancerType: classic
    ServiceRole: aws-elasticbeanstalk-service-role
  • I've now given up on this, at least for now. After trying many variations on this, I can't seem to put most of the parameters needed to start an environment from the EB web UI into the application bundle. My guess is that there's a precedence issue, at least when using Docker, which sets up "Environment type: Single instance" and I can't override it with the application bundle settings. HOWEVER, I've very quickly gotten the same application bundle as I was using above to work with the eb cli. So, I'll be using that. – Chris Prince Nov 20 '17 at 2:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.