Google Cloud Run Domain Mapping

This page shows how to write Terraform for Cloud Run Domain Mapping and write them securely.

google_cloud_run_domain_mapping (Terraform)

The Domain Mapping in Cloud Run can be configured in Terraform with the resource name google_cloud_run_domain_mapping. The following sections describe 2 examples of how to use the resource and its parameters.

Example Usage from GitHub
resource "google_cloud_run_domain_mapping" "web-ui-domain" {
  location = var.gcpRegion
  name     = var.serviceDomainWeb

  metadata {
    namespace = var.gcpProjectId
resource "google_cloud_run_domain_mapping" "graphql_api_service" {
    location = var.region
    name     = var.domain

    metadata {
        namespace = var.project_id


  • id optionalcomputed - string
  • location required - string
    • The location of the cloud run instance. eg us-central1

  • name required - string
    • Name should be a verified domain

  • project optionalcomputed - string
  • status requiredcomputed - list / object
    • The current status of the DomainMapping.

Explanation in Terraform Registry

Resource to hold the state and status of a user's domain mapping. To get more information about DomainMapping, see:

Frequently asked questions

What is Google Cloud Run Domain Mapping?

Google Cloud Run Domain Mapping is a resource for Cloud Run of Google Cloud Platform. Settings can be wrote in Terraform.

Where can I find the example code for the Google Cloud Run Domain Mapping?

For Terraform, the vinnie357/nim and chemistry/ source code examples are useful. See the Terraform Example section for further details.


Scan your IaC problem in 3 minutes for free

You can keep your IaC security for free. No credit card required.