#gcp (2023-02)
Google Cloud Platform
2023-02-27
2023-02-28
![DaniC (he/him) avatar](https://secure.gravatar.com/avatar/40632d3e633431836692bbb081f94a61.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0002-72.png)
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](https://avatars.slack-edge.com/2018-06-13/382332470551_54ed1a5d986e2068fd9c_72.jpg)
![Andriy Knysh (Cloud Posse) avatar](https://avatars.slack-edge.com/2018-06-13/382332470551_54ed1a5d986e2068fd9c_72.jpg)
the context variables namespace
, environment
, tenant
, stage
- you can use all of them or just those that you need
![Andriy Knysh (Cloud Posse) avatar](https://avatars.slack-edge.com/2018-06-13/382332470551_54ed1a5d986e2068fd9c_72.jpg)
namespace
is your Org
![Andriy Knysh (Cloud Posse) avatar](https://avatars.slack-edge.com/2018-06-13/382332470551_54ed1a5d986e2068fd9c_72.jpg)
environment
is a region
![Andriy Knysh (Cloud Posse) avatar](https://avatars.slack-edge.com/2018-06-13/382332470551_54ed1a5d986e2068fd9c_72.jpg)
tenant
is a subdivision in your Org (OU in AWS)
![Andriy Knysh (Cloud Posse) avatar](https://avatars.slack-edge.com/2018-06-13/382332470551_54ed1a5d986e2068fd9c_72.jpg)
stage
is the account
![DaniC (he/him) avatar](https://secure.gravatar.com/avatar/40632d3e633431836692bbb081f94a61.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0002-72.png)
thx a bunch @Andriy Knysh (Cloud Posse)
![DaniC (he/him) avatar](https://secure.gravatar.com/avatar/40632d3e633431836692bbb081f94a61.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0002-72.png)
(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](https://avatars.slack-edge.com/2018-06-13/382332470551_54ed1a5d986e2068fd9c_72.jpg)
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](https://avatars.slack-edge.com/2018-06-13/382332470551_54ed1a5d986e2068fd9c_72.jpg)
same thing could be used for GCP
![Andriy Knysh (Cloud Posse) avatar](https://avatars.slack-edge.com/2018-06-13/382332470551_54ed1a5d986e2068fd9c_72.jpg)
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](https://secure.gravatar.com/avatar/40632d3e633431836692bbb081f94a61.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0002-72.png)
indeed. The whole reason i want to use it is to support multiple deployments within same GCP project like:
• ephemeral/ sandbox envs
• uat
• etc