googleServiceNetworkingConnection
Manages a private VPC connection with a GCP service provider. For more information see the official documentation and API.
Example usage
/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
const googleComputeNetworkPeeringNetwork =
new google.computeNetwork.ComputeNetwork(this, "peering_network", {
name: "peering-network",
});
const googleComputeGlobalAddressPrivateIpAlloc =
new google.computeGlobalAddress.ComputeGlobalAddress(
this,
"private_ip_alloc",
{
address_type: "INTERNAL",
name: "private-ip-alloc",
network: googleComputeNetworkPeeringNetwork.id,
prefix_length: 16,
purpose: "VPC_PEERING",
}
);
const googleServiceNetworkingConnectionDefault =
new google.serviceNetworkingConnection.ServiceNetworkingConnection(
this,
"default",
{
network: googleComputeNetworkPeeringNetwork.id,
reserved_peering_ranges: [googleComputeGlobalAddressPrivateIpAlloc.name],
service: "servicenetworking.googleapis.com",
}
);
new google.computeNetworkPeeringRoutesConfig.ComputeNetworkPeeringRoutesConfig(
this,
"peering_routes",
{
export_custom_routes: true,
import_custom_routes: true,
network: googleComputeNetworkPeeringNetwork.name,
peering: googleServiceNetworkingConnectionDefault.peering,
}
);
Argument Reference
The following arguments are supported:
-
network
- (Required) Name of VPC network connected with service producers using VPC peering. -
service
- (Required) Provider peering service that is managing peering connectivity for a service provider organization. For Google services that support this functionality it is 'servicenetworking.googleapis.com'. -
reservedPeeringRanges
- (Required) Named IP address range(s) of PEERING type reserved for this service provider. Note that invoking this method with a different range when connection is already established will not reallocate already provisioned service producer subnetworks.
Attributes Reference
In addition to the arguments listed above, the following computed attributes are exported:
peering
- (Computed) The name of the VPC Network Peering connection that was created by the service producer.
Import
ServiceNetworkingConnection can be imported using any of these accepted formats
$ terraform import google_service_networking_connection.peering_connection {{peering-network}}:{{service}}
$ terraform import google_service_networking_connection.peering_connection /projects/{{project}}/global/networks/{{peering-network}}:{{service}}
User Project Overrides
This resource supports User Project Overrides.