blob: 8b0696f9c6f39ff6234913c6626af7591ed8c6a9 [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: "DatabaseMigrationService"
description: |-
The PrivateConnection resource is used to establish private connectivity between Database Migration Service and a customer's network.
---
# google\_database\_migration\_service\_private\_connection
The PrivateConnection resource is used to establish private connectivity between Database Migration Service and a customer's network.
To get more information about PrivateConnection, see:
* [API documentation](https://cloud.google.com/database-migration/docs/reference/rest/v1/projects.locations.privateConnections)
* How-to Guides
* [Official Documentation](https://cloud.google.com/database-migration/docs/oracle-to-postgresql/create-private-connectivity-configuration)
<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_working_dir=database_migration_service_private_connection&cloudshell_image=gcr.io%2Fcloudshell-images%2Fcloudshell%3Alatest&open_in_editor=main.tf&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md" 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 - Database Migration Service Private Connection
```hcl
resource "google_database_migration_service_private_connection" "default" {
display_name = "dbms_pc"
location = "us-central1"
private_connection_id = "my-connection"
labels = {
key = "value"
}
vpc_peering_config {
vpc_name = data.google_compute_network.default.id
subnet = "10.0.0.0/29"
}
}
data "google_compute_network" "default" {
name = "my-network"
}
```
## Argument Reference
The following arguments are supported:
* `vpc_peering_config` -
(Required)
The VPC Peering configuration is used to create VPC peering
between databasemigrationservice and the consumer's VPC.
Structure is [documented below](#nested_vpc_peering_config).
* `private_connection_id` -
(Required)
The private connectivity identifier.
* `location` -
(Required)
The name of the location this private connection is located in.
<a name="nested_vpc_peering_config"></a>The `vpc_peering_config` block supports:
* `vpc_name` -
(Required)
Fully qualified name of the VPC that Database Migration Service will peer to.
Format: projects/{project}/global/{networks}/{name}
* `subnet` -
(Required)
A free subnet for peering. (CIDR of /29)
- - -
* `labels` -
(Optional)
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.
* `display_name` -
(Optional)
Display name.
* `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}}/privateConnections/{{private_connection_id}}`
* `name` -
The resource's name.
* `state` -
State of the PrivateConnection.
* `error` -
The PrivateConnection error in case of failure.
Structure is [documented below](#nested_error).
* `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_error"></a>The `error` block contains:
* `message` -
(Optional)
A message containing more information about the error that occurred.
* `details` -
(Optional)
A list of messages that carry the error details.
## Timeouts
This resource provides the following
[Timeouts](https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/retries-and-customizable-timeouts) configuration options:
- `create` - Default is 60 minutes.
- `update` - Default is 20 minutes.
- `delete` - Default is 60 minutes.
## Import
PrivateConnection can be imported using any of these accepted formats:
* `projects/{{project}}/locations/{{location}}/privateConnections/{{private_connection_id}}`
* `{{project}}/{{location}}/{{private_connection_id}}`
* `{{location}}/{{private_connection_id}}`
In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import PrivateConnection using one of the formats above. For example:
```tf
import {
id = "projects/{{project}}/locations/{{location}}/privateConnections/{{private_connection_id}}"
to = google_database_migration_service_private_connection.default
}
```
When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), PrivateConnection can be imported using one of the formats above. For example:
```
$ terraform import google_database_migration_service_private_connection.default projects/{{project}}/locations/{{location}}/privateConnections/{{private_connection_id}}
$ terraform import google_database_migration_service_private_connection.default {{project}}/{{location}}/{{private_connection_id}}
$ terraform import google_database_migration_service_private_connection.default {{location}}/{{private_connection_id}}
```
## User Project Overrides
This resource supports [User Project Overrides](https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/provider_reference#user_project_override).