Amazon web services 跨区域的Elastic Beanstalk命令行工具

Amazon web services 跨区域的Elastic Beanstalk命令行工具,amazon-web-services,amazon-elastic-beanstalk,Amazon Web Services,Amazon Elastic Beanstalk,我有最新的eb命令行工具设置,最初使用我的两个git分支配置了它 eb init 最近我不得不处理两个不同的地区 us-west-1 branchA branchB us-west-2 branchC 在我这么做之前 git checkout branchA eb deploy 现在我要做什么 git checkout branchC eb init --region=us-west-2 eb deploy 有没有办法根据分支名称使init状态自动?我看到文件.e

我有最新的eb命令行工具设置,最初使用我的两个git分支配置了它

eb init
最近我不得不处理两个不同的地区

us-west-1
   branchA
   branchB
us-west-2
   branchC   
在我这么做之前

git checkout branchA
eb deploy
现在我要做什么

git checkout branchC
eb init --region=us-west-2
eb deploy

有没有办法根据分支名称使init状态自动?我看到文件.elasticbeanstalk.config.yml中有配置信息,我可以在其中的某个位置指定此信息吗?

您应该能够在.elasticbeanstalk/config.yml中指定它。我没有在
default\u region
中尝试过,但在
profile
中效果很好

现在看起来可能是这样的:

branch-defaults:
  develop:
    environment: project-dev
  master:
    environment: project-prod
  staging:
    environment: project-staging
global:
  application_name: application_name
  default_ec2_keyname: key_name
  default_platform: Python 2.7
  default_region: ap-southeast-1
  profile: eb-cli
  sc: git
如果需要特定于分支的区域,只需将该值从全局部分移动到分支设置

branch-defaults:
  develop:
    environment: project-dev
    default_region: eu-west-1
  master:
    environment: project-prod
    default_region: ap-southeast-1
  staging:
    environment: project-staging
    default_region: ap-southeast-1
global:
  application_name: application_name
  default_ec2_keyname: key_name
  default_platform: Python 2.7
  profile: eb-cli
  sc: git