Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create a single instance Elastic Beanstalk application with eb-cli

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
like image 442
Rohan Panchal Avatar asked Jul 23 '26 02:07

Rohan Panchal


2 Answers

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"
    },
  ]
}
like image 151
Rohan Panchal Avatar answered Jul 24 '26 16:07

Rohan Panchal


// Create single instance (without load balancers)

eb create -s
like image 42
s_m_lima Avatar answered Jul 24 '26 16:07

s_m_lima



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!