Network Peering Args
data class NetworkPeeringArgs(val exportCustomRoutes: Output<Boolean>? = null, val exportSubnetRoutesWithPublicIp: Output<Boolean>? = null, val importCustomRoutes: Output<Boolean>? = null, val importSubnetRoutesWithPublicIp: Output<Boolean>? = null, val name: Output<String>? = null, val network: Output<String>? = null, val peerNetwork: Output<String>? = null, val stackType: Output<String>? = null) : ConvertibleToJava<NetworkPeeringArgs>
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());
}
}
Content copied to clipboard
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
Content copied to clipboard
Constructors
Link copied to clipboard
fun NetworkPeeringArgs(exportCustomRoutes: Output<Boolean>? = null, exportSubnetRoutesWithPublicIp: Output<Boolean>? = null, importCustomRoutes: Output<Boolean>? = null, importSubnetRoutesWithPublicIp: Output<Boolean>? = null, name: Output<String>? = null, network: Output<String>? = null, peerNetwork: Output<String>? = null, stackType: Output<String>? = null)