The NetworkConnectivity Hub resource
A basic test of a networkconnectivity hub
resource "google_network_connectivity_hub" "primary" {
name = "hub"
description = "A sample hub"
project = "my-project-name"
labels = {
label-one = "value-one"
}
}
The following arguments are supported:
name
-
(Required)
Immutable. The name of the hub. Hub names must be unique. They use the following form: projects/{project_number}/locations/global/hubs/{hub_id}
description
-
(Optional)
An optional description of the hub.
labels
-
(Optional)
Optional labels in key:value format. For more information about labels, see Requirements for labels.
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 project for the resourceIn addition to the arguments listed above, the following computed attributes are exported:
id
- an identifier for the resource with format projects/{{project}}/locations/global/hubs/{{name}}
create_time
-
Output only. The time the hub was created.
effective_labels
-
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Terraform, other clients and services.
routing_vpcs
-
The VPC network associated with this hub's spokes. All of the VPN tunnels, VLAN attachments, and router appliance instances referenced by this hub's spokes must belong to this VPC network. This field is read-only. Network Connectivity Center automatically populates it based on the set of spokes attached to the hub.
state
-
Output only. The current lifecycle state of this hub. Possible values: STATE_UNSPECIFIED, CREATING, ACTIVE, DELETING
terraform_labels
-
The combination of labels configured directly on the resource and default labels configured on the provider.
unique_id
-
Output only. The Google-generated UUID for the hub. This value is unique across all hub resources. If a hub is deleted and another with the same name is created, the new hub is assigned a different unique_id.
update_time
-
Output only. The time the hub was last updated.
This resource provides the following Timeouts configuration options:
create
- Default is 20 minutes.update
- Default is 20 minutes.delete
- Default is 20 minutes.Hub can be imported using any of these accepted formats:
projects/{{project}}/locations/global/hubs/{{name}}
{{project}}/{{name}}
{{name}}
In Terraform v1.5.0 and later, use an import
block to import Hub using one of the formats above. For example:
import {
id = "projects/{{project}}/locations/global/hubs/{{name}}"
to = google_network_connectivity_hub.default
}
When using the terraform import
command, Hub can be imported using one of the formats above. For example:
$ terraform import google_network_connectivity_hub.default projects/{{project}}/locations/global/hubs/{{name}}
$ terraform import google_network_connectivity_hub.default {{project}}/{{name}}
$ terraform import google_network_connectivity_hub.default {{name}}