Do you have a DEV and PRD pipeline?

Hey everyone, question around building a multi-account automation solution.

I have been working on some AWS automation functions which are reasonably complicated and so have been testing and deploying it using a GitHub Actions pipeline. It basically deploys some CDK stacks, lambda functions and a bunch of tests.

Now that the automation has gone live, I am setting up a separate development and test environment to ensure the prod environment is stable. Don’t want to break anything, or send needless SNS notifications across the organisation.

I am looking at migrating the CICD work onto CodeBuild/CodePipeline. I am thinking of using a DEV pipeline to deploy the DEV CDK and Lambda functions, and a PROD pipeline to do the same for the PROD resources. This way I can only promote a new version into PROD when I am happy with the result in DEV.

Just want to know if any of you have had experience or advice in this area? Anyone tried a similar approach and if so, what did you learn?

Yep. We have a prod account and a dev account. We have various environments in each. But in dev we have an environment just for automated testing. Another for QA testing and another that’s supposed to be exactly like prod (in terms of enabled features etc). Once something is pushed through them it goes to an env in prod (set up in a green/blue style fashion).

yea. look at cdk pipeline. you define a pipeline and set of stages that can be multi account. that way all your deployments live with the rest of cdk

I second the recommendation for using CDK pipelines. I recently built one for a personal project, which includes a dev stage for ad hoc testing/experimentation, a beta stage for integ tests, and a prod stage.

Here are some resources I used to get started.

I used AWS Organizations / AWS SSO off of my main personal account to manage new accounts for beta/prod.

Yes, and no.

We have dev, prod, and sandbox pipelines. However, they are created with the same code.

Don’t hard code in anything to do with the environment - use parameters.

Sandbox is so you can make changes to how the pipeline works without slowing down your dev team by breaking things.

Yes, each time there is a commit inside a master/main or staging(dev) branch, the pipeline activate the whole CI/CD with the help of each .yml file inside the source repo.

This is for our web app that is in reactjs.

The whole code is tested inside EC2 during the build/test stage then upload the code to s3.

The private s3 is connected with Cloudfront/Route53, so when a build succeed, everyone can see the change.

It took me 2 whole weeks to implement the solution because I had not that much knowledge about the AWS codeSuite.

Today the whole CI/CD loop take about 10 minutes to be tested and deployed automatically,.

The success or the failure info are send to a slack channel via AWS SNS (cloudwatch event on the pipeline project)