Skip to content

📄 A template for google cloud platform (gcp) terraform provider, so others can generate a new repositories with the same directory structure and files.

Notifications You must be signed in to change notification settings

kwame-mintah/terraform-gcp-template

Repository files navigation

Terraform Google Cloud Platform (GCP) Template

The main purpose of this repository is to create a template for Terraform. This project will focus on the GCP provider.

Development

Dependencies

Prerequisites

  1. Have a Google Cloud account account and associated credentials.

Usage

  1. Navigate to the environment you would like to deploy,

  2. Initialize the configuration with:

    terragrunt init
  3. Plan your changes with:

    terragrunt plan
  4. If you're happy with the changes

    terragrunt apply

Note

Please note that terragrunt will create a bucket for storing the remote state. Ensure the account deploying the resources has the appropriate permissions to create or connect to these resources.

Pre-Commit hooks

Git hook scripts are very helpful for identifying simple issues before pushing any changes. Hooks will run on every commit automatically pointing out issues in the code e.g. trailing whitespace.

To help with the maintenance of these hooks, pre-commit is used, along with pre-commit-hooks.

Please following these instructions to install pre-commit locally and ensure that you have run pre-commit install to install the hooks for this project.

Additionally, once installed, the hooks can be updated to the latest available version with pre-commit autoupdate.

Documentation Generation

Code formatting and documentation for variables and outputs is generated using pre-commit-terraform hooks that in turn uses terraform-docs that will insert/update documentation. The following markers have been added to the README.md:

<!-- {BEGINNING|END} OF PRE-COMMIT-TERRAFORM DOCS HOOK --->

Requirements

Name Version
terraform >= 1.5.7, <= 1.9.0
google ~> 6.6.0

Providers

Name Version
google 6.6.0

Modules

No modules.

Resources

Name Type
google_project.project data source

Inputs

Name Description Type Default Required
gcp_default_labels The default region to manage resources in. map(string) {} no
gcp_project The default project to manage resources in. string n/a yes
gcp_region The default region to manage resources in. string n/a yes
gcp_zone The default zone to manage resources in. Generally,
this zone should be within the default region you specified.
string n/a yes

Outputs

Name Description
gcp_project_number The numeric identifier of the project.

About

📄 A template for google cloud platform (gcp) terraform provider, so others can generate a new repositories with the same directory structure and files.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages