Create a single instance Elastic Beanstalk application with eb-cli

断了今生、忘了曾经 提交于 2019-12-08 07:02:34

问题


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

回答1:


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"
    },
  ]
}


来源:https://stackoverflow.com/questions/41173575/create-a-single-instance-elastic-beanstalk-application-with-eb-cli

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!