googleComputeNetworkPeering
Manages a network peering within GCE. For more information see the official documentation and API.
-> Both networks must create a peering with each other for the peering to be functional.
\~> Subnets IP ranges across peered VPC networks cannot overlap.
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 googleComputeNetworkDefault = new google.computeNetwork.ComputeNetwork(
this,
"default",
{
auto_create_subnetworks: "false",
name: "foobar",
}
);
const googleComputeNetworkOther = new google.computeNetwork.ComputeNetwork(
this,
"other",
{
auto_create_subnetworks: "false",
name: "other",
}
);
new google.computeNetworkPeering.ComputeNetworkPeering(this, "peering1", {
name: "peering1",
network: googleComputeNetworkDefault.selfLink,
peer_network: googleComputeNetworkOther.selfLink,
});
new google.computeNetworkPeering.ComputeNetworkPeering(this, "peering2", {
name: "peering2",
network: googleComputeNetworkOther.selfLink,
peer_network: googleComputeNetworkDefault.selfLink,
});
Argument Reference
The following arguments are supported:
-
name
- (Required) Name of the peering. -
network
- (Required) The primary network of the peering. -
peerNetwork
- (Required) The peer network in the peering. The peer network may belong to a different project. -
exportCustomRoutes
- (Optional) Whether to export the custom routes to the peer network. Defaults tofalse
. -
importCustomRoutes
- (Optional) Whether to import the custom routes from the peer network. Defaults tofalse
. -
exportSubnetRoutesWithPublicIp
- (Optional) Whether subnet routes with public IP range are exported. The default value is true, all subnet routes are exported. The IPv4 special-use ranges (https://en.wikipedia.org/wiki/IPv4#Special_addresses) are always exported to peers and are not controlled by this field. -
importSubnetRoutesWithPublicIp
- (Optional) Whether subnet routes with public IP range are imported. The default value is false. The IPv4 special-use ranges (https://en.wikipedia.org/wiki/IPv4#Special_addresses) are always imported from peers and are not controlled by this field.
Attributes Reference
In addition to the arguments listed above, the following computed attributes are exported:
-
id
- an identifier for the resource with format{{network}}/{{name}}
-
state
- State for the peering, eitheractive
orinactive
. The peering isactive
when there's a matching configuration in the peer network. -
stateDetails
- Details about the current state of the peering.
Timeouts
This resource provides the following Timeouts configuration options: configuration options:
create
- Default is 4 minutes.delete
- Default is 4 minutes.
Import
VPC network peerings can be imported using the name and project of the primary network the peering exists in and the name of the network peering