How to configure CodePipeline to plan and deploy with Terraform

0

I'm fairly new to the AWS CodeStar services. I'd like to use CodeBuild/CodePipeline to do the following:

Run Terraform in plan mode Ask me for confirmation to deploy Run Terraform deploy

The pipeline should be triggered from a commit to an associated code repo. I notice that the build spec is specified on the build project, not on the pipeline. Does this mean I need two build projects in order to run Terraform in plan mode vs deploy mode? Or can I do this via one buildspec, or using direct modifications to the pipeline?

Any pointers, or references to tutorials appreciated.

gefragt vor 8 Monaten334 Aufrufe
1 Antwort
0

As a best practice, you need one buildspec for terraform plan and another buildspec for terraform apply. Between those steps you can add manual approval step.

Here is the repo with examples: https://github.com/aws-samples/aws-codepipeline-terraform-cicd-samples

profile picture
beantwortet vor 8 Monaten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen