CI/CD strategy for infrastructure and application code.

0

I am in the early stages of building my e-commerce application using AWS. I am confused about how to approach deployment of my infrastructure and application code and setup CI/CD codepipeline for them. Currently my thought process is to have a mono-repo for everything. My main point of confusion while approaching CI/CD for it goes like this - let's say, at some point in future, I make some changes in the application code for some feature or some bug fix. I push my changes in the repo which will trigger the codepipeline. Given that I already have my infrastructure up and running, all my code in the repo gets rebuilt and redeployed through the pipeline. Wouldn't that "re-deploy" all my infrastructure code and every other thing that need not change again? How to approach this kind of situation? Should I start thinking about having multiple repos for infra and app code that will deploy what has actually changed?

P.S. - I am not hands-on to AWS and I've been learning it for couple months now.

asked a year ago404 views
3 Answers
1
Accepted Answer

Hi, if you have Terraform, once you have made the small change, it will just apply the small change (not redeploy all infra). If you have a team of developers, it makes sense to use 2 repos (one for infra managed by you, another for app code for devs).

In your case, one monorepo is fine.

profile picture
answered a year ago
profile picture
EXPERT
reviewed a year ago
  • I am using AWS CDK. I believe the case will be same right?

1

Got a blog post, admittedly old, but also thanks AWS, works the same way now as it did then, on how I do multi-accounts deployments pipelines. The git repo contains all the CFN templates (should be familiar given you are using CDK) and there is a "more recent" version of that in this repo which has a blog post associated with that.

If you are not going to use AWS CodePipeline, then this is probably only good on paper. But with that said, I very much recommend to use the same IAM architecture with your CICD tool of choice to limit the surface of attack in case of a breach. Use OIDC auth wherever possible.

Hope this helps,

profile picture
answered 10 months ago
0

with CDK it will be the same

profile picture
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions