terraform-google-modules / terraform-docs-samples

Terraform samples intended for inclusion in cloud.google.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

meaningful resource names for cloud_run_service_interservice sample

rogerthatdev opened this issue · comments

TL;DR

The cloud run services in terraform-docs-samples/cloud_run_service_interservice/main.tf sample should be changed to have meaningful resource names.

Terraform Resources

google_cloud_run_service

Detailed design

`google_cloud_run_service.default` should be renamed to something like `public_service` and `google_cloud_run_service.default_private`should be renamed to something like `private_service`

Additional information

Per Google Cloud published best practices.

I think this was fixed in https://github.com/GoogleCloudPlatform/magic-modules/pull/6385/files.

I think that fixes the name for the Cloud Run services. This issue is for the Terraform resource names, currently default and default_public.

Published best practice guide:

To simplify references to a resource that is the only one of its type (for example, a single load balancer for an entire module), name the resource main.

and

To differentiate resources of the same type from each other (for example, primary and secondary), provide meaningful resource names.