Skip to content

antonionuma/aws-codepipeline-terraform-cicd-pipeline-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

How to use CodePipeline CICD pipeline to test Terraform modules

This is a demo Terraform repository to set up AWS CodePipeline to test Terraform projects using tflint, Checkov, OPA, Terrascan, and Terratest.

Thanks to @andreivmaksimov for the idea! Additional information can be found in the How to use CodePipeline CICD pipeline to test Terraform article.

Take note of some Changes:

  • All configs is set to AWS region "us-east-1"
  • The repo used as a source code is Github, connected with codepipeline via "CodeStarSourceConnection" (here you have to change pending status to avalaible on console)

CICD pipeline architecture

0 - Set up Terraform remote state infrastructure

This step is required to set up an infrastructure to store Terraform remote state files

cd 0_remote_state
terraform init
terraform plan
terraform apply -auto-approve

1- Set up AWS CodePipeline

This step is required to set up an AWS CodePipeline to test Terraform projects using tflint, Checkov, OPA, Terrascan, and Terratest.

cd 1_pipeline
terraform init
terraform plan
terraform apply -auto-approve

Every code commit will trigger the pipeline and made all checks before deploy. You can make some changes in the terraform code to check the behavior in every steps Enjoy! Happy learning

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages