2

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

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

我将如何使用 eb-clieb 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
4

1 回答 1

9

我想通了。您必须在项目的 .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"
    },
  ]
}
于 2016-12-27T17:05:13.163 回答