blob: 45bdceca8ad9a98cc1a11b9f2670a19358b8e41f [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: "Google Distributed Cloud Edge"
description: |-
A VPN connection
---
# google\_edgecontainer\_vpn\_connection
A VPN connection
To get more information about VpnConnection, see:
* [API documentation](https://cloud.google.com/distributed-cloud/edge/latest/docs/reference/container/rest/v1/projects.locations.vpnConnections)
* How-to Guides
* [Google Distributed Cloud Edge](https://cloud.google.com/distributed-cloud/edge/latest/docs)
## Example Usage - Edgecontainer Vpn Connection
```hcl
resource "google_edgecontainer_cluster" "cluster" {
name = "default"
location = "us-central1"
authorization {
admin_users {
username = "admin@hashicorptest.com"
}
}
networking {
cluster_ipv4_cidr_blocks = ["10.0.0.0/16"]
services_ipv4_cidr_blocks = ["10.1.0.0/16"]
}
fleet {
project = "projects/${data.google_project.project.number}"
}
}
resource "google_edgecontainer_node_pool" "node_pool" {
name = "nodepool-1"
cluster = google_edgecontainer_cluster.cluster.name
location = "us-central1"
node_location = "us-central1-edge-example-edgesite"
node_count = 3
}
resource "google_edgecontainer_vpn_connection" "default" {
depends_on = [google_edgecontainer_node_pool.node_pool]
name = "vpn-connection-1"
location = "us-central1"
cluster = "projects/${data.google_project.project.number}/locations/us-east1/clusters/${google_edgecontainer_cluster.cluster.name}"
vpc = google_compute_network.vpc.name
enable_high_availability = true
labels = {
my_key = "my_val"
other_key = "other_val"
}
}
resource "google_compute_network" "vpc" {
name = "example-vpc"
}
data "google_project" "project" {}
```
## Argument Reference
The following arguments are supported:
* `cluster` -
(Required)
The canonical Cluster name to connect to. It is in the form of projects/{project}/locations/{location}/clusters/{cluster}.
* `name` -
(Required)
The resource name of VPN connection
* `location` -
(Required)
Google Cloud Platform location.
- - -
* `labels` -
(Optional)
Labels associated with this resource.
**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.
* `nat_gateway_ip` -
(Optional)
NAT gateway IP, or WAN IP address. If a customer has multiple NAT IPs, the customer needs to configure NAT such that only one external IP maps to the GMEC Anthos cluster.
This is empty if NAT is not used.
* `vpc` -
(Optional)
The network ID of VPC to connect to.
* `vpc_project` -
(Optional)
Project detail of the VPC network. Required if VPC is in a different project than the cluster project.
Structure is [documented below](#nested_vpc_project).
* `enable_high_availability` -
(Optional)
Whether this VPN connection has HA enabled on cluster side. If enabled, when creating VPN connection we will attempt to use 2 ANG floating IPs.
* `router` -
(Optional)
The VPN connection Cloud Router name.
* `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_vpc_project"></a>The `vpc_project` block supports:
* `project_id` -
(Optional)
The project of the VPC to connect to. If not specified, it is the same as the cluster project.
## 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}}/vpnConnections/{{name}}`
* `create_time` -
The time when the VPN connection was created.
* `update_time` -
The time when the VPN connection was last updated.
* `details` -
A nested object resource
Structure is [documented below](#nested_details).
* `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.
<a name="nested_details"></a>The `details` block contains:
* `state` -
(Output)
The current connection state.
* `error` -
(Output)
The error message. This is only populated when state=ERROR.
* `cloud_router` -
(Output)
The Cloud Router info.
Structure is [documented below](#nested_cloud_router).
* `cloud_vpns` -
(Output)
Each connection has multiple Cloud VPN gateways.
Structure is [documented below](#nested_cloud_vpns).
<a name="nested_cloud_router"></a>The `cloud_router` block contains:
* `name` -
(Output)
The associated Cloud Router name.
<a name="nested_cloud_vpns"></a>The `cloud_vpns` block contains:
* `gateway` -
(Output)
The created Cloud VPN gateway name.
## Timeouts
This resource provides the following
[Timeouts](https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/retries-and-customizable-timeouts) configuration options:
- `create` - Default is 30 minutes.
- `update` - Default is 30 minutes.
- `delete` - Default is 30 minutes.
## Import
VpnConnection can be imported using any of these accepted formats:
* `projects/{{project}}/locations/{{location}}/vpnConnections/{{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 VpnConnection using one of the formats above. For example:
```tf
import {
id = "projects/{{project}}/locations/{{location}}/vpnConnections/{{name}}"
to = google_edgecontainer_vpn_connection.default
}
```
When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), VpnConnection can be imported using one of the formats above. For example:
```
$ terraform import google_edgecontainer_vpn_connection.default projects/{{project}}/locations/{{location}}/vpnConnections/{{name}}
$ terraform import google_edgecontainer_vpn_connection.default {{project}}/{{location}}/{{name}}
$ terraform import google_edgecontainer_vpn_connection.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).