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:
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"
}
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.
private_connection_id
-
(Required)
The private connectivity identifier.
location
-
(Required)
The name of the location this private connection is located in.
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.
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.
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.
message
-
(Optional)
A message containing more information about the error that occurred.
details
-
(Optional)
A list of messages that carry the error details.
This resource provides the following Timeouts configuration options:
create
- Default is 60 minutes.update
- Default is 20 minutes.delete
- Default is 60 minutes.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 to import PrivateConnection using one of the formats above. For example:
import {
id = "projects/{{project}}/locations/{{location}}/privateConnections/{{private_connection_id}}"
to = google_database_migration_service_private_connection.default
}
When using the terraform import
command, 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}}
This resource supports User Project Overrides.