问题
If i use the eb-cli eb config save
to save the configuration of my current environment it works to start a new one using eb create
.
But if i want to create the same environment with a different AWS account obviously lines like the following make no sence:
aws:ec2:vpc:
Subnets: subnet-2d9a3c56
VPCId: vpc-1dff4c74
So how can i build the same elastic beanstalk environment within multiple accounts? Is there any way to tell AWS? Maybe an "Account Agnostic" config-save?
回答1:
It would not be possible to build the exact same ElasticBeanstalk environment across accounts. The environment is going to have resource IDs such as VPCs and Subnets that will be different.
A good way to build effectively the same ElasticBeanstalk application across multiple accounts would be to use CloudFormation to configure the environments. This requires a different approach to creating environments, but also means that the configuration can be more easily version controlled.
回答2:
With cloudformation you can specify the parameters to be selected to feed into the template when the stack is being created.
You can use the {"Ref" : ""} method to create drop down lists of Subnets in the VPC etc
This would be the way I would do it.
来源:https://stackoverflow.com/questions/34774380/copy-elastic-beanstalk-configuration-across-accounts