Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in AWS by (19.1k points)

Is there a way to export existing CodePipeline/CodeBuild projects to Cloudformation?

I'm in the process of converting our existing CI/CD infrastructure into code so it would be easy to replicate them on other AWS regions.

Currently, we've done all our CodePipeline/CodeBuild projects through the AWS console in the browser and obviously, this is tedious and error-prone.

1 Answer

0 votes
by (44.4k points)

If you have some codepipeline already created use the cli to extract them as cloudformation.

The command is roughly this

aws codepipeline get-pipeline --name

It will get you back a codepipeline resource for cloudformation. You will be able to see where you need to enter in other resources like codebuild projects and s3 buckets or codecommit repos.

Be aware though that you will need to work through the template to ensure it will be taken as valid by cloudformation. The lines of the resource from the cli need to start with capital letters so it can be tedious to change that.

Another thing to know is a pipeline needed I think two roles which you can have in your template also and it's own bucket. All of these things can be put in a single template making reproducible pipelines possible.

Related questions

Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...