RootPrivileges / terragrunt-aws-modules

MIT License
0 stars 0 forks source link

Add better testing to module code #2

Open RootPrivileges opened 4 years ago

RootPrivileges commented 4 years ago

Currently, testing is conducted manually and across all modules using the account-init.sh script in https://github.com/RootPrivileges/terragrunt-aws . This is brittle and slow, taking a long time to run and failing in weird ways.

Adding robust testing, as Yevgeniy Brikman describes in https://www.infoq.com/presentations/automated-testing-terraform-docker-packer/, will make it easier to detect errors without needing to run the whole script. Additionally, this can be integrated with Gitlab Actions to run the tests manually on commits.

While implementing testing, also add other static analysis as referred to in the video (i.e. terraform validate, tflint, conftest) into the CI/CD pipeline as best practise.

RootPrivileges commented 4 years ago

https://www.terraform.io/docs/commands/fmt.html