google_cloud_run_domain_mapping

Resource to hold the state and status of a user's domain mapping.

To get more information about DomainMapping, see:

Example Usage - Cloud Run Domain Mapping Basic

resource "google_cloud_run_service" "default" {
  name     = "cloudrun-srv"
  location = "us-central1"

  metadata {
    namespace = "my-project-name"
  }

  template {
    spec {
      containers {
        image = "us-docker.pkg.dev/cloudrun/container/hello"
      }
    }
  }
}

resource "google_cloud_run_domain_mapping" "default" {
  location = "us-central1"
  name     = "verified-domain.com"

  metadata {
    namespace = "my-project-name"
  }

  spec {
    route_name = google_cloud_run_service.default.name
  }
}

Argument Reference

The following arguments are supported:

The spec block supports:


The metadata block supports:

Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

The status block contains:

The conditions block contains:

The resource_records block supports:

Timeouts

This resource provides the following Timeouts configuration options:

Import

DomainMapping can be imported using any of these accepted formats:

In Terraform v1.5.0 and later, use an import block to import DomainMapping using one of the formats above. For example:

import {
  id = "locations/{{location}}/namespaces/{{project}}/domainmappings/{{name}}"
  to = google_cloud_run_domain_mapping.default
}

When using the terraform import command, DomainMapping can be imported using one of the formats above. For example:

$ terraform import google_cloud_run_domain_mapping.default locations/{{location}}/namespaces/{{project}}/domainmappings/{{name}}
$ terraform import google_cloud_run_domain_mapping.default {{location}}/{{project}}/{{name}}
$ terraform import google_cloud_run_domain_mapping.default {{location}}/{{name}}

User Project Overrides

This resource supports User Project Overrides.