本文介绍了使用eb-cli创建单个实例Elastic Beanstalk应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

我已经在scratch的Elastic Beanstalk环境中运行过eb create,但是我必须进行手动配置更改以使其成为单一实例类型而实现负载平衡.

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.

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

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

有一个.elasticbeanstalk/config.yml

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

推荐答案

我知道了.您必须在项目的目录.ebextensions下创建一个扩展名为.config的文件.

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

这篇关于使用eb-cli创建单个实例Elastic Beanstalk应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 16:39