使用eb-cli创建单个实例Elastic Beanstalk应用程序

时间:2016-12-15 21:25:19

标签: amazon-web-services elastic-beanstalk ebcli

所以我有一个带有相应Procfile / Buildfile的java应用程序。

我已经在我们的Elastic Beanstalk环境中运行了eb create,但我必须跟进手动配置更改,使其成为单一实例类型与负载平衡。

我如何使用eb-cli在eb create $ENVIRONMENT_NAME上生成单个实例环境?

有一个.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 个答案:

答案 0 :(得分:3)

我发现了。您必须在项目目录.ebextensions下创建扩展名为.config的文件。

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