#gcp (2023-02)

Google Cloud Platform

2023-02-27

2023-02-28

DaniC (he/him) avatar
DaniC (he/him)

Hi folks, anyone aware of a similar TF module like https://github.com/cloudposse/terraform-null-label but for GCP ?

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

it can be used with any cloud

2
Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

the context variables namespace, environment, tenant, stage - you can use all of them or just those that you need

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

namespace is your Org

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

environment is a region

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

tenant is a subdivision in your Org (OU in AWS)

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

stage is the account

DaniC (he/him) avatar
DaniC (he/him)

thx a bunch @Andriy Knysh (Cloud Posse)

DaniC (he/him) avatar
DaniC (he/him)

(was surprised to see that there are no other modules like this embedded in any of the supported google tf modules)

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

the module is used to uniquely and consistently naming cloud resources. If you use all the context vars, the resulting resource name/Id would look like {namespace}-{tenant}-{environment}-{stage}-{name}, for example for an AWS resource it could be cp-plat-ue1-prod-vpc-logs-bucket

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

same thing could be used for GCP

Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)

by using that, you can tell right away the stack that the resource belongs to by looking at the resource name/ID

DaniC (he/him) avatar
DaniC (he/him)

indeed. The whole reason i want to use it is to support multiple deployments within same GCP project like:

• ephemeral/ sandbox envs

• uat

• etc

    keyboard_arrow_up