I'm trying to create a new Elastic Beanstalk environment with the EB CLI but it's failing because of an invalid option, even though that option isn't set in my config.

The command I'm running:

$ eb create my-new-environment -v --timeout 15

The error I'm getting:

2020-09-27 08:45:00    ERROR   "option_settings" in one of the configuration files failed validation. More details to follow.
2020-09-27 08:45:00    ERROR   Invalid option value: '1.0' (Namespace: 'aws:autoscaling:updatepolicy:rollingupdate', OptionName: 'MinInstancesInService'): You can't enable rolling updates for a single-instance environment.
2020-09-27 08:45:01    ERROR   Failed to launch environment.

But I don't have aws:autoscaling:updatepolicy:rollingupdate specified in my config file!

# .ebextensions/settings.config

option_settings:
    aws:elasticbeanstalk:managedactions:
        ManagedActionsEnabled: true
        PreferredStartTime: "Thu:04:00"
    aws:elasticbeanstalk:managedactions:platformupdate:
        UpdateLevel: minor
        InstanceRefreshEnabled: true
    aws:elasticbeanstalk:command:
        DeploymentPolicy: AllAtOnce
    aws:elasticbeanstalk:environment:
        EnvironmentType: SingleInstance
    aws:ec2:instances:
        InstanceTypes: t3.medium
    aws:elasticbeanstalk:cloudwatch:logs:
        StreamLogs: true
        DeleteOnTerminate: true
        RetentionInDays: 1
    aws:elasticbeanstalk:application:
        Application Healthcheck URL: /health
    aws:autoscaling:launchconfiguration:
        MonitoringInterval: 1 minute

Here's my .elasticbeanstalk/config.yml:

# .elasticbeanstalk/config.yml

deploy:
  artifact: out.zip
global:
  application_name: my-application
  branch: null
  default_ec2_keyname: null
  default_platform: 64bit Amazon Linux 2 v2.0.2 running .NET Core
  default_region: eu-west-1
  include_git_submodules: true
  instance_profile: null
  platform_name: null
  platform_version: null
  profile: null
  repository: null
  sc: git
  workspace_type: Application

If it helps I think I did have the MinInstancesInService option set in a previous attempt but I've since deleted that from my config; and I have double and tripled checked that only the new version of my config is in my out.zip artefact.

2

There are 2 answers

1
Marcin On BEST ANSWER

Based on the comments.

The issue was caused by the fact that EB CLI ignores some settings from the config files. From docs:

Because the recommended values are set at the API level, they will override values for the same options that you set in configuration files or saved configurations.

The solution was to explicitly set the EB environment to single-instance type, using EB CLI option --single.

eb create my-new-environment -v --timeout 15 --single
2
us_david On

It's easy to disable "rolling update" from AWS console by selecting the EB instance and select configuration, and then select Rolling Update, and disabled it. You can. now specify a single instance with no load balancing.

This is what I did to save some $ when the instance is deployed mostly for testing purpose or you don't anticipate much traffic on the backend.

David