2

So i have a java application with the appropriate Procfile/Buildfile.

I have ran eb create in our scratch Elastic Beanstalk environment but i have to follow up with a manual configuration change to make it a single instance type vs a load balanced.

How would i use the eb-cli where upon eb create $ENVIRONMENT_NAME it generates a single instance environment?

There is a .elasticbeanstalk/config.yml

branch-defaults:
  development:
    environment: development
    group_suffix: null
  staging:
    environment: staging
    group_suffix: null
  production:
    environment: production
    group_suffix: null
global:
  application_name: feed-engine
  branch: null
  default_ec2_keyname: null
  default_platform: Java 8
  default_region: us-east-1
  profile: prod
  repository: null
  sc: git
Rohan Panchal
  • 1,211
  • 1
  • 11
  • 28

2 Answers2

9

I figured out. You have to create a file with the extension .config under in the directory .ebextensions of your project.

{
  "option_settings" : [
    {
      "namespace" : "aws:elasticbeanstalk:application",
      "option_name" : "Application Healthcheck URL",
      "value" : "/"
    },
    {
      "namespace" : "aws:autoscaling:asg",
      "option_name" : "MinSize",
      "value" : "1"
    },
    {
      "namespace" : "aws:autoscaling:asg",
      "option_name" : "MaxSize",
      "value" : "1"
    },
    {
      "namespace" : "aws:autoscaling:asg",
      "option_name" : "Custom Availability Zones",
      "value" : "us-east-1a"
    },
    {
      "namespace" : "aws:elasticbeanstalk:environment",
      "option_name" : "EnvironmentType",
      "value" : "SingleInstance"
    },
  ]
}
Adrian Lopez
  • 2,601
  • 5
  • 31
  • 48
Rohan Panchal
  • 1,211
  • 1
  • 11
  • 28
0

// Create single instance (without load balancers)

eb create -s
Fedor
  • 17,146
  • 13
  • 40
  • 131
s_m_lima
  • 57
  • 6