brandonjbjelland / terraform-google-utils

This module provides a way to get the shortnames for a given GCP region.

Home Page:https://registry.terraform.io/modules/terraform-google-modules/utils/google

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

terraform-google-utils

This module provides a way to get the shortnames for a given GCP region. For example, "us-central1" becomes "usc1". This module also always outputs a map for every region, which allows you to do multiple at once.

This module does not communicate with GCP in any way.

Usage

Basic usage of this module is as follows:

module "utils" {
  source  = "terraform-google-modules/utils/google"
  version = "~> 0.1"
  region  = "us-central1"
}

locals {
  "us-central1" = module.utils.region_short_name
  "asia-east1"  = module.utils.region_short_name_map["asia-east1"]
}

The above results in locals with computed values of:

locals {
  "us-central1" = "usc1"
  "asia-east1"  = "aze1"
}

Functional examples are included in the examples directory.

Inputs

Name Description Type Default Required
region The GCP region to retrieve a short name for (ex. `us-central1). string "null" no

Outputs

Name Description
region_short_name The 4 or 5 character shortname of the region specified in var.region.
region_short_name_map The 4 or 5 character shortname of any given region.

Requirements

These sections describe requirements for using this module.

Software

The following dependencies must be available:

Service Account

A service account is not needed for to use this module.

APIs

Projects/APIs are not required to use this module.

Contributing

Refer to the contribution guidelines for information on contributing to this module.

About

This module provides a way to get the shortnames for a given GCP region.

https://registry.terraform.io/modules/terraform-google-modules/utils/google

License:Apache License 2.0


Languages

Language:HCL 46.0%Language:Makefile 28.9%Language:Ruby 25.1%