Deploy to elastic beanstalk across accounts

0

Currently we have all our environments on one account, we use CodePipeline to deploy to a test environment then approve to production environment. We are splitting our environments to exist in different accounts.

How can we get codepipeline to deploy to elastic beanstalk in another account? Ideally we still want the ability to see it is/has deployed successfully/failed

Looking at CloudFormation for CodePipeline creation, i cannot see anything about deploying across accounts for beanstalk. I cannot see anything in CloudFormation to deploy the update via CloudFormation. It seems the only option is using the EB cli or aws cli.

Thanks

3개 답변
1

I have used cloudformation to deploy EB environments with a lot of success. I didn't use cross account but see no obvious technical blockers however there is some additional iam complexity. Here is some steps.

  1. build your application artifact as normal eg WAR file
  2. Create a deploy action to copy WAR file to cross account bucket - see here
  3. Trigger a cross account cloudformation stack with the updated WAR artifact as a parameter - see here. When cloudformation detects the ApplicationVersion source files have changed this will trigger a new resource which will trigger the version attribute with the environment resource to be updated triggering the deployment
AWS
전문가
Peter_G
답변함 2년 전
  • Think is I cannot find what properties I would need to update in the cloudformation stack that would deploy that code, which attribute do I need to change? I've taken a look at my existing environments and cannot find any reference to the application version.

1

CloudFormation manages all the calls to the backend AWS APIs for you. You can run the same CloudFormation template in multiple accounts or multiple regions, and it will create identical environments across them.

profile picture
답변함 2년 전
0
수락된 답변

Resolved, support gave me some help.

Basically for the action stage you can set a RoleARN, this role should be on the account you wish to deploy to, then the beanstalk app and environment is scoped to that account rather than the account where the pipeline is running.

I found you will need to allow the target account to have access to the pipeline account artifact bucket.

Also it's best to set your own KMS key for the source stage as you can then allow the target accounts use this KMS key

Support gave me some links as well

https://aws.amazon.com/blogs/devops/cross-account-ci-cd-pipeline-single-tenant-saas/

https://aws.amazon.com/blogs/devops/aws-building-a-secure-cross-account-continuous-delivery-pipeline/

PaulR
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠