A container for services
. Namespaces allow administrators to group services
together and define permissions for a collection of services.
To get more information about Namespace, see:
resource "google_service_directory_namespace" "example" {
provider = google-beta
namespace_id = "example-namespace"
location = "us-central1"
labels = {
key = "value"
foo = "bar"
}
}
The following arguments are supported:
location
-
(Required)
The location for the Namespace.
A full list of valid locations can be found by running
gcloud beta service-directory locations list
.
namespace_id
-
(Required)
The Resource ID must be 1-63 characters long, including digits,
lowercase letters or the hyphen character.
labels
-
(Optional)
Resource labels associated with this Namespace. No more than 64 user
labels can be associated with a given resource. Label keys and values can
be no longer than 63 characters.
Note: This field is non-authoritative, and will only manage the labels present in your configuration.
Please refer to the field effective_labels
for all of the labels present on the resource.
project
- (Optional) The ID of the project in which the resource belongs.
If it is not provided, the provider project is used.
In addition to the arguments listed above, the following computed attributes are exported:
id
- an identifier for the resource with format {{name}}
name
-
The resource name for the namespace
in the format projects/*/locations/*/namespaces/*
.
terraform_labels
-
The combination of labels configured directly on the resource
and default labels configured on the provider.
effective_labels
-
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Terraform, other clients and services.
This resource provides the following Timeouts configuration options:
create
- Default is 20 minutes.update
- Default is 20 minutes.delete
- Default is 20 minutes.Namespace can be imported using any of these accepted formats:
projects/{{project}}/locations/{{location}}/namespaces/{{namespace_id}}
{{project}}/{{location}}/{{namespace_id}}
{{location}}/{{namespace_id}}
In Terraform v1.5.0 and later, use an import
block to import Namespace using one of the formats above. For example:
import {
id = "projects/{{project}}/locations/{{location}}/namespaces/{{namespace_id}}"
to = google_service_directory_namespace.default
}
When using the terraform import
command, Namespace can be imported using one of the formats above. For example:
$ terraform import google_service_directory_namespace.default projects/{{project}}/locations/{{location}}/namespaces/{{namespace_id}}
$ terraform import google_service_directory_namespace.default {{project}}/{{location}}/{{namespace_id}}
$ terraform import google_service_directory_namespace.default {{location}}/{{namespace_id}}