blob: 7b866742ede75428defaccf88c69e9855ecfa7a6 [file] [log] [blame]
---
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** Type: MMv1 ***
#
# ----------------------------------------------------------------------------
#
# This file is automatically generated by Magic Modules and manual
# changes will be clobbered when the file is regenerated.
#
# Please read more about how to change this file in
# .github/CONTRIBUTING.md.
#
# ----------------------------------------------------------------------------
subcategory: "Network Connectivity"
description: |-
The NetworkConnectivity Spoke resource
---
# google_network_connectivity_spoke
The NetworkConnectivity Spoke resource
To get more information about Spoke, see:
* [API documentation](https://cloud.google.com/network-connectivity/docs/reference/networkconnectivity/rest/v1beta/projects.locations.spokes)
* How-to Guides
* [Official Documentation](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/overview)
<div class = "oics-button" style="float: right; margin: 0 0 -15px">
<a href="https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Fterraform-google-modules%2Fdocs-examples.git&cloudshell_image=gcr.io%2Fcloudshell-images%2Fcloudshell%3Alatest&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md&cloudshell_working_dir=network_connectivity_spoke_linked_vpc_network_basic&open_in_editor=main.tf" target="_blank">
<img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;">
</a>
</div>
## Example Usage - Network Connectivity Spoke Linked Vpc Network Basic
```hcl
resource "google_compute_network" "network" {
name = "net"
auto_create_subnetworks = false
}
resource "google_network_connectivity_hub" "basic_hub" {
name = "hub1"
description = "A sample hub"
labels = {
label-two = "value-one"
}
}
resource "google_network_connectivity_spoke" "primary" {
name = "spoke1"
location = "global"
description = "A sample spoke with a linked router appliance instance"
labels = {
label-one = "value-one"
}
hub = google_network_connectivity_hub.basic_hub.id
linked_vpc_network {
exclude_export_ranges = [
"198.51.100.0/24",
"10.10.0.0/16"
]
include_export_ranges = [
"198.51.100.0/23",
"10.0.0.0/8"
]
uri = google_compute_network.network.self_link
}
}
```
<div class = "oics-button" style="float: right; margin: 0 0 -15px">
<a href="https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Fterraform-google-modules%2Fdocs-examples.git&cloudshell_image=gcr.io%2Fcloudshell-images%2Fcloudshell%3Alatest&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md&cloudshell_working_dir=network_connectivity_spoke_router_appliance_basic&open_in_editor=main.tf" target="_blank">
<img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;">
</a>
</div>
## Example Usage - Network Connectivity Spoke Router Appliance Basic
```hcl
resource "google_compute_network" "network" {
name = "tf-test-network%{random_suffix}"
auto_create_subnetworks = false
}
resource "google_compute_subnetwork" "subnetwork" {
name = "tf-test-subnet%{random_suffix}"
ip_cidr_range = "10.0.0.0/28"
region = "us-central1"
network = google_compute_network.network.self_link
}
resource "google_compute_instance" "instance" {
name = "tf-test-instance%{random_suffix}"
machine_type = "e2-medium"
can_ip_forward = true
zone = "us-central1-a"
boot_disk {
initialize_params {
image = "projects/debian-cloud/global/images/debian-10-buster-v20210817"
}
}
network_interface {
subnetwork = google_compute_subnetwork.subnetwork.name
network_ip = "10.0.0.2"
access_config {
network_tier = "PREMIUM"
}
}
}
resource "google_network_connectivity_hub" "basic_hub" {
name = "tf-test-hub%{random_suffix}"
description = "A sample hub"
labels = {
label-two = "value-one"
}
}
resource "google_network_connectivity_spoke" "primary" {
name = "tf-test-name%{random_suffix}"
location = "us-central1"
description = "A sample spoke with a linked routher appliance instance"
labels = {
label-one = "value-one"
}
hub = google_network_connectivity_hub.basic_hub.id
linked_router_appliance_instances {
instances {
virtual_machine = google_compute_instance.instance.self_link
ip_address = "10.0.0.2"
}
site_to_site_data_transfer = true
}
}
```
## Argument Reference
The following arguments are supported:
* `name` -
(Required)
Immutable. The name of the spoke. Spoke names must be unique.
* `hub` -
(Required)
Immutable. The URI of the hub that this spoke is attached to.
* `location` -
(Required)
The location for the resource
- - -
* `labels` -
(Optional)
Optional labels in key:value format. For more information about labels, see [Requirements for labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
**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.
* `description` -
(Optional)
An optional description of the spoke.
* `linked_vpn_tunnels` -
(Optional)
The URIs of linked VPN tunnel resources
Structure is [documented below](#nested_linked_vpn_tunnels).
* `linked_interconnect_attachments` -
(Optional)
A collection of VLAN attachment resources. These resources should be redundant attachments that all advertise the same prefixes to Google Cloud. Alternatively, in active/passive configurations, all attachments should be capable of advertising the same prefixes.
Structure is [documented below](#nested_linked_interconnect_attachments).
* `linked_router_appliance_instances` -
(Optional)
The URIs of linked Router appliance resources
Structure is [documented below](#nested_linked_router_appliance_instances).
* `linked_vpc_network` -
(Optional)
VPC network that is associated with the spoke.
Structure is [documented below](#nested_linked_vpc_network).
* `project` - (Optional) The ID of the project in which the resource belongs.
If it is not provided, the provider project is used.
<a name="nested_linked_vpn_tunnels"></a>The `linked_vpn_tunnels` block supports:
* `uris` -
(Required)
The URIs of linked VPN tunnel resources.
* `site_to_site_data_transfer` -
(Required)
A value that controls whether site-to-site data transfer is enabled for these resources. Note that data transfer is available only in supported locations.
<a name="nested_linked_interconnect_attachments"></a>The `linked_interconnect_attachments` block supports:
* `uris` -
(Required)
The URIs of linked interconnect attachment resources
* `site_to_site_data_transfer` -
(Required)
A value that controls whether site-to-site data transfer is enabled for these resources. Note that data transfer is available only in supported locations.
<a name="nested_linked_router_appliance_instances"></a>The `linked_router_appliance_instances` block supports:
* `instances` -
(Required)
The list of router appliance instances
Structure is [documented below](#nested_instances).
* `site_to_site_data_transfer` -
(Required)
A value that controls whether site-to-site data transfer is enabled for these resources. Note that data transfer is available only in supported locations.
<a name="nested_instances"></a>The `instances` block supports:
* `virtual_machine` -
(Optional)
The URI of the virtual machine resource
* `ip_address` -
(Optional)
The IP address on the VM to use for peering.
<a name="nested_linked_vpc_network"></a>The `linked_vpc_network` block supports:
* `uri` -
(Required)
The URI of the VPC network resource.
* `exclude_export_ranges` -
(Optional)
IP ranges encompassing the subnets to be excluded from peering.
* `include_export_ranges` -
(Optional)
IP ranges allowed to be included from peering.
## Attributes Reference
In addition to the arguments listed above, the following computed attributes are exported:
* `id` - an identifier for the resource with format `projects/{{project}}/locations/{{location}}/spokes/{{name}}`
* `create_time` -
Output only. The time the spoke was created.
* `update_time` -
Output only. The time the spoke was last updated.
* `unique_id` -
Output only. The Google-generated UUID for the spoke. This value is unique across all spoke resources. If a spoke is deleted and another with the same name is created, the new spoke is assigned a different unique_id.
* `state` -
Output only. The current lifecycle state of this spoke.
* `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.
## Timeouts
This resource provides the following
[Timeouts](https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/retries-and-customizable-timeouts) configuration options:
- `create` - Default is 20 minutes.
- `update` - Default is 20 minutes.
- `delete` - Default is 20 minutes.
## Import
Spoke can be imported using any of these accepted formats:
* `projects/{{project}}/locations/{{location}}/spokes/{{name}}`
* `{{project}}/{{location}}/{{name}}`
* `{{location}}/{{name}}`
In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Spoke using one of the formats above. For example:
```tf
import {
id = "projects/{{project}}/locations/{{location}}/spokes/{{name}}"
to = google_network_connectivity_spoke.default
}
```
When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), Spoke can be imported using one of the formats above. For example:
```
$ terraform import google_network_connectivity_spoke.default projects/{{project}}/locations/{{location}}/spokes/{{name}}
$ terraform import google_network_connectivity_spoke.default {{project}}/{{location}}/{{name}}
$ terraform import google_network_connectivity_spoke.default {{location}}/{{name}}
```
## User Project Overrides
This resource supports [User Project Overrides](https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/provider_reference#user_project_override).