Terraform Drift for AWS CodeBuild
$10-30 USD
Pagado a la entrega
I have n AWS codebuild project that deploys Terraform modules into the AWS account. I want to implement terraform drift to run on schedule and let the user know if something has changed outside the pipeline. Here is the [login to view URL]
```
version: 0.2
environment_variables:
plaintext:
TF_MODULE: aws-terraform/my_account_deployment
phases:
build:
commands:
- pwd
- terraform --version
- |-
if [ "$(git rev-parse --abbrev-ref HEAD)" != "master" ]; then
echo "Non-master branch, Terraform will only execute plan"
cd $TF_MODULE
terraform init -no-color
terraform plan -no-color
echo "Plan complete"
fi
- |-
if [ "$(git rev-parse --abbrev-ref HEAD)" = "master" ]; then
echo "Master branch, terraform will APPLY changes"
cd $TF_MODULE
terraform init -no-color
terraform apply -no-color -auto-approve
echo "Apply complete"
fi
post_build:
commands:
- echo " it is done"
````
Nº del proyecto: #25829771