Repository to store terraform code used while studying for the ANS-C01 exam. I am using Adrian Cantrill's AWS Certified Advanced Networking - Specialty course to study for the exam. The course does provide CloudFormation stacks for a number of the demos, but I thought it would be fun challenging to recreate all some of the CloudFormation stacks with terraform code.
- ✅ VPC Deep Dive 🚀
- ✅ CloudTrail 🚀
- ✅ CloudFront - but see open issue
- ✅ VPC Peering 🚀
We use trunk.io's code quality function for formatting and linting. Trunk git hooks run pre-commit and pre-push.
#### Find TF files
The first job of the tofu-ci workflow is to look for tf and tfvars files that have changed in the dev folder. The output from this job is used to define the matrix strategy for remaining jobs. A matrix strategy is used in case tf files have changed in different directories. Each job will run in a separate directory for init
, plan
and apply
.
Trunk linting also runs in CI. Trunk's GitHub Integration is not used because a composite action is required to customise the setup and perform tasks like downloading plugins for TFLint and initialising the working directory. Composite actions do not support secrets or token permissions. Both are required in the pipeline for TFLint AWS deep checking. Instead, trunk's GitHub Action has been used as the last step of this job after the initialisation of tofu and TFLint, and downloading the TFLint AWS plugin.
This job only runs on pull requests prior to running a plan.