NetworkPeering

class NetworkPeering : KotlinCustomResource

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

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.Network;
import com.pulumi.gcp.compute.NetworkArgs;
import com.pulumi.gcp.compute.NetworkPeering;
import com.pulumi.gcp.compute.NetworkPeeringArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var default_ = new Network("default", NetworkArgs.builder()
.autoCreateSubnetworks("false")
.build());
var other = new Network("other", NetworkArgs.builder()
.autoCreateSubnetworks("false")
.build());
var peering1 = new NetworkPeering("peering1", NetworkPeeringArgs.builder()
.network(default_.selfLink())
.peerNetwork(other.selfLink())
.build());
var peering2 = new NetworkPeering("peering2", NetworkPeeringArgs.builder()
.network(other.selfLink())
.peerNetwork(default_.selfLink())
.build());
}
}

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

$ pulumi import gcp:compute/networkPeering:NetworkPeering peering_network project-name/network-name/peering-name

Properties

Link copied to clipboard

Whether to export the custom routes to the peer network. Defaults to false.

Link copied to clipboard

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.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard

Whether to import the custom routes from the peer network. Defaults to false.

Link copied to clipboard

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.

Link copied to clipboard
val name: Output<String>

Name of the peering.

Link copied to clipboard
val network: Output<String>

The primary network of the peering.

Link copied to clipboard
val peerNetwork: Output<String>

The peer network in the peering. The peer network may belong to a different project.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val stackType: Output<String>?

Which IP version(s) of traffic and routes are allowed to be imported or exported between peer networks. The default value is IPV4_ONLY. Possible values: "IPV4_ONLY", "IPV4_IPV6".

Link copied to clipboard
val state: Output<String>

State for the peering, either ACTIVE or INACTIVE. The peering is ACTIVE when there's a matching configuration in the peer network.

Link copied to clipboard
val stateDetails: Output<String>

Details about the current state of the peering.

Link copied to clipboard
val urn: Output<String>