blob: acbf27d693ecbbeab2b275cc0c0fec508960019b [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: |-
Regional Private Service Connect (PSC) endpoint resource.
---
# google_network_connectivity_regional_endpoint
Regional Private Service Connect (PSC) endpoint resource.
To get more information about RegionalEndpoint, see:
* [API documentation](https://cloud.google.com/network-connectivity/docs/reference/networkconnectivity/rest/v1/projects.locations.regionalEndpoints)
* How-to Guides
* [Access regional Google APIs through endpoints](https://cloud.google.com/vpc/docs/access-regional-google-apis-endpoints)
<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_regional_endpoint_regional_access&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 Regional Endpoint Regional Access
```hcl
resource "google_compute_network" "my_network" {
name = "my-network"
auto_create_subnetworks = false
}
resource "google_compute_subnetwork" "my_subnetwork" {
name = "my-subnetwork"
ip_cidr_range = "192.168.0.0/24"
region = "us-central1"
network = google_compute_network.my_network.id
}
resource "google_network_connectivity_regional_endpoint" "default" {
name = "my-rep"
location = "us-central1"
target_google_api = "storage.us-central1.p.rep.googleapis.com"
access_type = "REGIONAL"
address = "192.168.0.5"
network = google_compute_network.my_network.id
subnetwork = google_compute_subnetwork.my_subnetwork.id
description = "My RegionalEndpoint targeting Google API storage.us-central1.p.rep.googleapis.com"
labels = {env = "default"}
}
```
<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_regional_endpoint_global_access&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 Regional Endpoint Global Access
```hcl
resource "google_compute_network" "my_network" {
name = "my-network"
auto_create_subnetworks = false
}
resource "google_compute_subnetwork" "my_subnetwork" {
name = "my-subnetwork"
ip_cidr_range = "192.168.0.0/24"
region = "us-central1"
network = google_compute_network.my_network.id
}
resource "google_network_connectivity_regional_endpoint" "default" {
name = "my-rep"
location = "us-central1"
target_google_api = "storage.us-central1.p.rep.googleapis.com"
access_type = "GLOBAL"
address = "192.168.0.4"
network = google_compute_network.my_network.id
subnetwork = google_compute_subnetwork.my_subnetwork.id
}
```
## Argument Reference
The following arguments are supported:
* `target_google_api` -
(Required)
The service endpoint this private regional endpoint connects to. Format: `{apiname}.{region}.p.rep.googleapis.com` Example: \"cloudkms.us-central1.p.rep.googleapis.com\".
* `access_type` -
(Required)
The access type of this regional endpoint. This field is reflected in the PSC Forwarding Rule configuration to enable global access.
Possible values are: `GLOBAL`, `REGIONAL`.
* `name` -
(Required)
The name of the RegionalEndpoint.
* `location` -
(Required)
The location of the RegionalEndpoint.
- - -
* `labels` -
(Optional)
User-defined 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.
* `description` -
(Optional)
A description of this resource.
* `network` -
(Optional)
The name of the VPC network for this private regional endpoint. Format: `projects/{project}/global/networks/{network}`
* `subnetwork` -
(Optional)
The name of the subnetwork from which the IP address will be allocated. Format: `projects/{project}/regions/{region}/subnetworks/{subnetwork}`
* `address` -
(Optional)
The IP Address of the Regional Endpoint. When no address is provided, an IP from the subnetwork is allocated. Use one of the following formats: * IPv4 address as in `10.0.0.1` * Address resource URI as in `projects/{project}/regions/{region}/addresses/{address_name}`
~> **Note:** This field accepts both a reference to a Compute Address resource, which is the resource name of which format is given in the description, and IP literal value. If the user chooses to input a reserved address value; they need to make sure that the reserved address is in IPv4 version, its purpose is GCE_ENDPOINT, its type is INTERNAL and its status is RESERVED. If the user chooses to input an IP literal, they need to make sure that it's a valid IPv4 address (x.x.x.x) within the subnetwork.
* `project` - (Optional) The ID of the project in which the resource belongs.
If it is not provided, the provider project is used.
## 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}}/regionalEndpoints/{{name}}`
* `create_time` -
Time when the RegionalEndpoint was created.
* `update_time` -
Time when the RegionalEndpoint was updated.
* `psc_forwarding_rule` -
The resource reference of the PSC Forwarding Rule created on behalf of the customer. Format: `//compute.googleapis.com/projects/{project}/regions/{region}/forwardingRules/{forwarding_rule_name}`
* `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
RegionalEndpoint can be imported using any of these accepted formats:
* `projects/{{project}}/locations/{{location}}/regionalEndpoints/{{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 RegionalEndpoint using one of the formats above. For example:
```tf
import {
id = "projects/{{project}}/locations/{{location}}/regionalEndpoints/{{name}}"
to = google_network_connectivity_regional_endpoint.default
}
```
When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), RegionalEndpoint can be imported using one of the formats above. For example:
```
$ terraform import google_network_connectivity_regional_endpoint.default projects/{{project}}/locations/{{location}}/regionalEndpoints/{{name}}
$ terraform import google_network_connectivity_regional_endpoint.default {{project}}/{{location}}/{{name}}
$ terraform import google_network_connectivity_regional_endpoint.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).