A template for starting a Cloud Foundation Toolkit Terraform module.
The template must be rendered using Cookiecutter.
Generate a new module by running the following command:
cookiecutter https://github.com/terraform-google-modules/terraform-google-module-template.git
A newly generated module includes logic to create a Google Cloud Storage bucket, a functional example module, and Kitchen-Terraform integration tests. All of this content should be modified to suit the purpose of the new module.
Changes to this template must be tested to ensure that generated modules remain functional.
Refer to the README and CONTRIBUTING documents of the template to understand the requirements for testing the generated module.
The key for the service account described in the README must be located
at ./credentials.test.json
.
Generate a module and execute its tests by running the following command:
PROJECT_ID="<ID of test project>" \
SERVICE_ACCOUNT_JSON="$(cat ./credentials.test.json)" \
make test
The module will be generated at
./staging/terraform-google-module-test
. If the tests pass, the module
will be removed; otherwise, it will be left in place for inspection.