Currently, my project uses 2 AWS accounts - one is for staging that our clients can rely on for testing and the other one is for production/live. I am trying to set up a CodePipeline for a new serverless application. I was wondering if this set up is proper and if there are ways to improve it.
Staging AWS account: GitHub Source -> AWS CodeBuild (test and build in staging env) -> Manual Approval Gate -> Deploy app in staging
Then I'll verify the changes in staging before approving production deployment:
Production AWS account: GitHub Source -> AWS CodeBuild (test and build in prod env) -> Manual Approval Gate -> Deploy app in prod
It seems like the test and build will be redundant but it seems easier to set it up like this since I can basically use the same Cloudformation template for the pipeline. Plus I don't have to worry with cross-account resource access.
Whenever I push to master it'll basically trigger both of these pipelines. Is the redundancy a flaw that can be easily fixed? Is it simpler to just have the staging account have manual approval to promote to the prod account's pipeline and trigger it?