Skip to content

Terraform Modules and Providers

Terraform modules and providers is a great example of shared code that will not only benefit Crayon as a company, not only clients of Crayon, but also other people who utilize Terraform. The repositories will be open to the public, and the modules and providers will be published to registry.terraform.io.

For this reason, it's important that these repositories follow good patterns to enable fast and secure development. To make it easier for people, we have created a template repository for modules. This can be found at crayon/template-terraform-modules. See the template features section for a full understanding of what this involves.

GitHub Actions

Format and Testing

  • Linting: It is common to use TFLint. This is a great tool for checking that your code adhere to the defined standard. It has integration for GitHub, and can be seen in the workflow examples that we provide.
  • Security scanning: More info to come.

Deploying to registry

Template features

Feature Description
Auto format If edited in VS Code, terraform fmt will be run every time you save. This comes from the file .vscode/settings.json.
Terraform defaults Based on best practices described in the Terraform docs.
.tflint This is the config file for TFLint. Added with examples and references
Example workflows We will be adding several examples for how to do testing, and publishing