1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. compute
  5. NetworkPeeringRoutesConfig
Google Cloud Classic v7.27.0 published on Thursday, Jun 13, 2024 by Pulumi

gcp.compute.NetworkPeeringRoutesConfig

Explore with Pulumi AI

gcp logo
Google Cloud Classic v7.27.0 published on Thursday, Jun 13, 2024 by Pulumi

    Manage a network peering’s route settings without managing the peering as a whole. This resource is primarily intended for use with GCP-generated peerings that shouldn’t otherwise be managed by other tools. Deleting this resource is a no-op and the peering will not be modified.

    To get more information about NetworkPeeringRoutesConfig, see:

    Example Usage

    Network Peering Routes Config Basic

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const networkPrimary = new gcp.compute.Network("network_primary", {
        name: "primary-network",
        autoCreateSubnetworks: false,
    });
    const networkSecondary = new gcp.compute.Network("network_secondary", {
        name: "secondary-network",
        autoCreateSubnetworks: false,
    });
    const peeringPrimary = new gcp.compute.NetworkPeering("peering_primary", {
        name: "primary-peering",
        network: networkPrimary.id,
        peerNetwork: networkSecondary.id,
        importCustomRoutes: true,
        exportCustomRoutes: true,
    });
    const peeringPrimaryRoutes = new gcp.compute.NetworkPeeringRoutesConfig("peering_primary_routes", {
        peering: peeringPrimary.name,
        network: networkPrimary.name,
        importCustomRoutes: true,
        exportCustomRoutes: true,
    });
    const peeringSecondary = new gcp.compute.NetworkPeering("peering_secondary", {
        name: "secondary-peering",
        network: networkSecondary.id,
        peerNetwork: networkPrimary.id,
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    network_primary = gcp.compute.Network("network_primary",
        name="primary-network",
        auto_create_subnetworks=False)
    network_secondary = gcp.compute.Network("network_secondary",
        name="secondary-network",
        auto_create_subnetworks=False)
    peering_primary = gcp.compute.NetworkPeering("peering_primary",
        name="primary-peering",
        network=network_primary.id,
        peer_network=network_secondary.id,
        import_custom_routes=True,
        export_custom_routes=True)
    peering_primary_routes = gcp.compute.NetworkPeeringRoutesConfig("peering_primary_routes",
        peering=peering_primary.name,
        network=network_primary.name,
        import_custom_routes=True,
        export_custom_routes=True)
    peering_secondary = gcp.compute.NetworkPeering("peering_secondary",
        name="secondary-peering",
        network=network_secondary.id,
        peer_network=network_primary.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		networkPrimary, err := compute.NewNetwork(ctx, "network_primary", &compute.NetworkArgs{
    			Name:                  pulumi.String("primary-network"),
    			AutoCreateSubnetworks: pulumi.Bool(false),
    		})
    		if err != nil {
    			return err
    		}
    		networkSecondary, err := compute.NewNetwork(ctx, "network_secondary", &compute.NetworkArgs{
    			Name:                  pulumi.String("secondary-network"),
    			AutoCreateSubnetworks: pulumi.Bool(false),
    		})
    		if err != nil {
    			return err
    		}
    		peeringPrimary, err := compute.NewNetworkPeering(ctx, "peering_primary", &compute.NetworkPeeringArgs{
    			Name:               pulumi.String("primary-peering"),
    			Network:            networkPrimary.ID(),
    			PeerNetwork:        networkSecondary.ID(),
    			ImportCustomRoutes: pulumi.Bool(true),
    			ExportCustomRoutes: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = compute.NewNetworkPeeringRoutesConfig(ctx, "peering_primary_routes", &compute.NetworkPeeringRoutesConfigArgs{
    			Peering:            peeringPrimary.Name,
    			Network:            networkPrimary.Name,
    			ImportCustomRoutes: pulumi.Bool(true),
    			ExportCustomRoutes: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = compute.NewNetworkPeering(ctx, "peering_secondary", &compute.NetworkPeeringArgs{
    			Name:        pulumi.String("secondary-peering"),
    			Network:     networkSecondary.ID(),
    			PeerNetwork: networkPrimary.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var networkPrimary = new Gcp.Compute.Network("network_primary", new()
        {
            Name = "primary-network",
            AutoCreateSubnetworks = false,
        });
    
        var networkSecondary = new Gcp.Compute.Network("network_secondary", new()
        {
            Name = "secondary-network",
            AutoCreateSubnetworks = false,
        });
    
        var peeringPrimary = new Gcp.Compute.NetworkPeering("peering_primary", new()
        {
            Name = "primary-peering",
            Network = networkPrimary.Id,
            PeerNetwork = networkSecondary.Id,
            ImportCustomRoutes = true,
            ExportCustomRoutes = true,
        });
    
        var peeringPrimaryRoutes = new Gcp.Compute.NetworkPeeringRoutesConfig("peering_primary_routes", new()
        {
            Peering = peeringPrimary.Name,
            Network = networkPrimary.Name,
            ImportCustomRoutes = true,
            ExportCustomRoutes = true,
        });
    
        var peeringSecondary = new Gcp.Compute.NetworkPeering("peering_secondary", new()
        {
            Name = "secondary-peering",
            Network = networkSecondary.Id,
            PeerNetwork = networkPrimary.Id,
        });
    
    });
    
    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 com.pulumi.gcp.compute.NetworkPeeringRoutesConfig;
    import com.pulumi.gcp.compute.NetworkPeeringRoutesConfigArgs;
    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 networkPrimary = new Network("networkPrimary", NetworkArgs.builder()
                .name("primary-network")
                .autoCreateSubnetworks("false")
                .build());
    
            var networkSecondary = new Network("networkSecondary", NetworkArgs.builder()
                .name("secondary-network")
                .autoCreateSubnetworks("false")
                .build());
    
            var peeringPrimary = new NetworkPeering("peeringPrimary", NetworkPeeringArgs.builder()
                .name("primary-peering")
                .network(networkPrimary.id())
                .peerNetwork(networkSecondary.id())
                .importCustomRoutes(true)
                .exportCustomRoutes(true)
                .build());
    
            var peeringPrimaryRoutes = new NetworkPeeringRoutesConfig("peeringPrimaryRoutes", NetworkPeeringRoutesConfigArgs.builder()
                .peering(peeringPrimary.name())
                .network(networkPrimary.name())
                .importCustomRoutes(true)
                .exportCustomRoutes(true)
                .build());
    
            var peeringSecondary = new NetworkPeering("peeringSecondary", NetworkPeeringArgs.builder()
                .name("secondary-peering")
                .network(networkSecondary.id())
                .peerNetwork(networkPrimary.id())
                .build());
    
        }
    }
    
    resources:
      peeringPrimaryRoutes:
        type: gcp:compute:NetworkPeeringRoutesConfig
        name: peering_primary_routes
        properties:
          peering: ${peeringPrimary.name}
          network: ${networkPrimary.name}
          importCustomRoutes: true
          exportCustomRoutes: true
      peeringPrimary:
        type: gcp:compute:NetworkPeering
        name: peering_primary
        properties:
          name: primary-peering
          network: ${networkPrimary.id}
          peerNetwork: ${networkSecondary.id}
          importCustomRoutes: true
          exportCustomRoutes: true
      peeringSecondary:
        type: gcp:compute:NetworkPeering
        name: peering_secondary
        properties:
          name: secondary-peering
          network: ${networkSecondary.id}
          peerNetwork: ${networkPrimary.id}
      networkPrimary:
        type: gcp:compute:Network
        name: network_primary
        properties:
          name: primary-network
          autoCreateSubnetworks: 'false'
      networkSecondary:
        type: gcp:compute:Network
        name: network_secondary
        properties:
          name: secondary-network
          autoCreateSubnetworks: 'false'
    

    Network Peering Routes Config Gke

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const containerNetwork = new gcp.compute.Network("container_network", {
        name: "container-network",
        autoCreateSubnetworks: false,
    });
    const containerSubnetwork = new gcp.compute.Subnetwork("container_subnetwork", {
        name: "container-subnetwork",
        region: "us-central1",
        network: containerNetwork.name,
        ipCidrRange: "10.0.36.0/24",
        privateIpGoogleAccess: true,
        secondaryIpRanges: [
            {
                rangeName: "pod",
                ipCidrRange: "10.0.0.0/19",
            },
            {
                rangeName: "svc",
                ipCidrRange: "10.0.32.0/22",
            },
        ],
    });
    const privateCluster = new gcp.container.Cluster("private_cluster", {
        name: "private-cluster",
        location: "us-central1-a",
        initialNodeCount: 1,
        network: containerNetwork.name,
        subnetwork: containerSubnetwork.name,
        privateClusterConfig: {
            enablePrivateEndpoint: true,
            enablePrivateNodes: true,
            masterIpv4CidrBlock: "10.42.0.0/28",
        },
        masterAuthorizedNetworksConfig: {},
        ipAllocationPolicy: {
            clusterSecondaryRangeName: containerSubnetwork.secondaryIpRanges.apply(secondaryIpRanges => secondaryIpRanges[0].rangeName),
            servicesSecondaryRangeName: containerSubnetwork.secondaryIpRanges.apply(secondaryIpRanges => secondaryIpRanges[1].rangeName),
        },
        deletionProtection: true,
    });
    const peeringGkeRoutes = new gcp.compute.NetworkPeeringRoutesConfig("peering_gke_routes", {
        peering: privateCluster.privateClusterConfig.apply(privateClusterConfig => privateClusterConfig.peeringName),
        network: containerNetwork.name,
        importCustomRoutes: true,
        exportCustomRoutes: true,
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    container_network = gcp.compute.Network("container_network",
        name="container-network",
        auto_create_subnetworks=False)
    container_subnetwork = gcp.compute.Subnetwork("container_subnetwork",
        name="container-subnetwork",
        region="us-central1",
        network=container_network.name,
        ip_cidr_range="10.0.36.0/24",
        private_ip_google_access=True,
        secondary_ip_ranges=[
            gcp.compute.SubnetworkSecondaryIpRangeArgs(
                range_name="pod",
                ip_cidr_range="10.0.0.0/19",
            ),
            gcp.compute.SubnetworkSecondaryIpRangeArgs(
                range_name="svc",
                ip_cidr_range="10.0.32.0/22",
            ),
        ])
    private_cluster = gcp.container.Cluster("private_cluster",
        name="private-cluster",
        location="us-central1-a",
        initial_node_count=1,
        network=container_network.name,
        subnetwork=container_subnetwork.name,
        private_cluster_config=gcp.container.ClusterPrivateClusterConfigArgs(
            enable_private_endpoint=True,
            enable_private_nodes=True,
            master_ipv4_cidr_block="10.42.0.0/28",
        ),
        master_authorized_networks_config=gcp.container.ClusterMasterAuthorizedNetworksConfigArgs(),
        ip_allocation_policy=gcp.container.ClusterIpAllocationPolicyArgs(
            cluster_secondary_range_name=container_subnetwork.secondary_ip_ranges[0].range_name,
            services_secondary_range_name=container_subnetwork.secondary_ip_ranges[1].range_name,
        ),
        deletion_protection=True)
    peering_gke_routes = gcp.compute.NetworkPeeringRoutesConfig("peering_gke_routes",
        peering=private_cluster.private_cluster_config.peering_name,
        network=container_network.name,
        import_custom_routes=True,
        export_custom_routes=True)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
    	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/container"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		containerNetwork, err := compute.NewNetwork(ctx, "container_network", &compute.NetworkArgs{
    			Name:                  pulumi.String("container-network"),
    			AutoCreateSubnetworks: pulumi.Bool(false),
    		})
    		if err != nil {
    			return err
    		}
    		containerSubnetwork, err := compute.NewSubnetwork(ctx, "container_subnetwork", &compute.SubnetworkArgs{
    			Name:                  pulumi.String("container-subnetwork"),
    			Region:                pulumi.String("us-central1"),
    			Network:               containerNetwork.Name,
    			IpCidrRange:           pulumi.String("10.0.36.0/24"),
    			PrivateIpGoogleAccess: pulumi.Bool(true),
    			SecondaryIpRanges: compute.SubnetworkSecondaryIpRangeArray{
    				&compute.SubnetworkSecondaryIpRangeArgs{
    					RangeName:   pulumi.String("pod"),
    					IpCidrRange: pulumi.String("10.0.0.0/19"),
    				},
    				&compute.SubnetworkSecondaryIpRangeArgs{
    					RangeName:   pulumi.String("svc"),
    					IpCidrRange: pulumi.String("10.0.32.0/22"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		privateCluster, err := container.NewCluster(ctx, "private_cluster", &container.ClusterArgs{
    			Name:             pulumi.String("private-cluster"),
    			Location:         pulumi.String("us-central1-a"),
    			InitialNodeCount: pulumi.Int(1),
    			Network:          containerNetwork.Name,
    			Subnetwork:       containerSubnetwork.Name,
    			PrivateClusterConfig: &container.ClusterPrivateClusterConfigArgs{
    				EnablePrivateEndpoint: pulumi.Bool(true),
    				EnablePrivateNodes:    pulumi.Bool(true),
    				MasterIpv4CidrBlock:   pulumi.String("10.42.0.0/28"),
    			},
    			MasterAuthorizedNetworksConfig: nil,
    			IpAllocationPolicy: &container.ClusterIpAllocationPolicyArgs{
    				ClusterSecondaryRangeName: containerSubnetwork.SecondaryIpRanges.ApplyT(func(secondaryIpRanges []compute.SubnetworkSecondaryIpRange) (*string, error) {
    					return &secondaryIpRanges[0].RangeName, nil
    				}).(pulumi.StringPtrOutput),
    				ServicesSecondaryRangeName: containerSubnetwork.SecondaryIpRanges.ApplyT(func(secondaryIpRanges []compute.SubnetworkSecondaryIpRange) (*string, error) {
    					return &secondaryIpRanges[1].RangeName, nil
    				}).(pulumi.StringPtrOutput),
    			},
    			DeletionProtection: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = compute.NewNetworkPeeringRoutesConfig(ctx, "peering_gke_routes", &compute.NetworkPeeringRoutesConfigArgs{
    			Peering: privateCluster.PrivateClusterConfig.ApplyT(func(privateClusterConfig container.ClusterPrivateClusterConfig) (*string, error) {
    				return &privateClusterConfig.PeeringName, nil
    			}).(pulumi.StringPtrOutput),
    			Network:            containerNetwork.Name,
    			ImportCustomRoutes: pulumi.Bool(true),
    			ExportCustomRoutes: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var containerNetwork = new Gcp.Compute.Network("container_network", new()
        {
            Name = "container-network",
            AutoCreateSubnetworks = false,
        });
    
        var containerSubnetwork = new Gcp.Compute.Subnetwork("container_subnetwork", new()
        {
            Name = "container-subnetwork",
            Region = "us-central1",
            Network = containerNetwork.Name,
            IpCidrRange = "10.0.36.0/24",
            PrivateIpGoogleAccess = true,
            SecondaryIpRanges = new[]
            {
                new Gcp.Compute.Inputs.SubnetworkSecondaryIpRangeArgs
                {
                    RangeName = "pod",
                    IpCidrRange = "10.0.0.0/19",
                },
                new Gcp.Compute.Inputs.SubnetworkSecondaryIpRangeArgs
                {
                    RangeName = "svc",
                    IpCidrRange = "10.0.32.0/22",
                },
            },
        });
    
        var privateCluster = new Gcp.Container.Cluster("private_cluster", new()
        {
            Name = "private-cluster",
            Location = "us-central1-a",
            InitialNodeCount = 1,
            Network = containerNetwork.Name,
            Subnetwork = containerSubnetwork.Name,
            PrivateClusterConfig = new Gcp.Container.Inputs.ClusterPrivateClusterConfigArgs
            {
                EnablePrivateEndpoint = true,
                EnablePrivateNodes = true,
                MasterIpv4CidrBlock = "10.42.0.0/28",
            },
            MasterAuthorizedNetworksConfig = null,
            IpAllocationPolicy = new Gcp.Container.Inputs.ClusterIpAllocationPolicyArgs
            {
                ClusterSecondaryRangeName = containerSubnetwork.SecondaryIpRanges.Apply(secondaryIpRanges => secondaryIpRanges[0].RangeName),
                ServicesSecondaryRangeName = containerSubnetwork.SecondaryIpRanges.Apply(secondaryIpRanges => secondaryIpRanges[1].RangeName),
            },
            DeletionProtection = true,
        });
    
        var peeringGkeRoutes = new Gcp.Compute.NetworkPeeringRoutesConfig("peering_gke_routes", new()
        {
            Peering = privateCluster.PrivateClusterConfig.Apply(privateClusterConfig => privateClusterConfig.PeeringName),
            Network = containerNetwork.Name,
            ImportCustomRoutes = true,
            ExportCustomRoutes = true,
        });
    
    });
    
    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.Subnetwork;
    import com.pulumi.gcp.compute.SubnetworkArgs;
    import com.pulumi.gcp.compute.inputs.SubnetworkSecondaryIpRangeArgs;
    import com.pulumi.gcp.container.Cluster;
    import com.pulumi.gcp.container.ClusterArgs;
    import com.pulumi.gcp.container.inputs.ClusterPrivateClusterConfigArgs;
    import com.pulumi.gcp.container.inputs.ClusterMasterAuthorizedNetworksConfigArgs;
    import com.pulumi.gcp.container.inputs.ClusterIpAllocationPolicyArgs;
    import com.pulumi.gcp.compute.NetworkPeeringRoutesConfig;
    import com.pulumi.gcp.compute.NetworkPeeringRoutesConfigArgs;
    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 containerNetwork = new Network("containerNetwork", NetworkArgs.builder()
                .name("container-network")
                .autoCreateSubnetworks(false)
                .build());
    
            var containerSubnetwork = new Subnetwork("containerSubnetwork", SubnetworkArgs.builder()
                .name("container-subnetwork")
                .region("us-central1")
                .network(containerNetwork.name())
                .ipCidrRange("10.0.36.0/24")
                .privateIpGoogleAccess(true)
                .secondaryIpRanges(            
                    SubnetworkSecondaryIpRangeArgs.builder()
                        .rangeName("pod")
                        .ipCidrRange("10.0.0.0/19")
                        .build(),
                    SubnetworkSecondaryIpRangeArgs.builder()
                        .rangeName("svc")
                        .ipCidrRange("10.0.32.0/22")
                        .build())
                .build());
    
            var privateCluster = new Cluster("privateCluster", ClusterArgs.builder()
                .name("private-cluster")
                .location("us-central1-a")
                .initialNodeCount(1)
                .network(containerNetwork.name())
                .subnetwork(containerSubnetwork.name())
                .privateClusterConfig(ClusterPrivateClusterConfigArgs.builder()
                    .enablePrivateEndpoint(true)
                    .enablePrivateNodes(true)
                    .masterIpv4CidrBlock("10.42.0.0/28")
                    .build())
                .masterAuthorizedNetworksConfig()
                .ipAllocationPolicy(ClusterIpAllocationPolicyArgs.builder()
                    .clusterSecondaryRangeName(containerSubnetwork.secondaryIpRanges().applyValue(secondaryIpRanges -> secondaryIpRanges[0].rangeName()))
                    .servicesSecondaryRangeName(containerSubnetwork.secondaryIpRanges().applyValue(secondaryIpRanges -> secondaryIpRanges[1].rangeName()))
                    .build())
                .deletionProtection("true")
                .build());
    
            var peeringGkeRoutes = new NetworkPeeringRoutesConfig("peeringGkeRoutes", NetworkPeeringRoutesConfigArgs.builder()
                .peering(privateCluster.privateClusterConfig().applyValue(privateClusterConfig -> privateClusterConfig.peeringName()))
                .network(containerNetwork.name())
                .importCustomRoutes(true)
                .exportCustomRoutes(true)
                .build());
    
        }
    }
    
    resources:
      peeringGkeRoutes:
        type: gcp:compute:NetworkPeeringRoutesConfig
        name: peering_gke_routes
        properties:
          peering: ${privateCluster.privateClusterConfig.peeringName}
          network: ${containerNetwork.name}
          importCustomRoutes: true
          exportCustomRoutes: true
      containerNetwork:
        type: gcp:compute:Network
        name: container_network
        properties:
          name: container-network
          autoCreateSubnetworks: false
      containerSubnetwork:
        type: gcp:compute:Subnetwork
        name: container_subnetwork
        properties:
          name: container-subnetwork
          region: us-central1
          network: ${containerNetwork.name}
          ipCidrRange: 10.0.36.0/24
          privateIpGoogleAccess: true
          secondaryIpRanges:
            - rangeName: pod
              ipCidrRange: 10.0.0.0/19
            - rangeName: svc
              ipCidrRange: 10.0.32.0/22
      privateCluster:
        type: gcp:container:Cluster
        name: private_cluster
        properties:
          name: private-cluster
          location: us-central1-a
          initialNodeCount: 1
          network: ${containerNetwork.name}
          subnetwork: ${containerSubnetwork.name}
          privateClusterConfig:
            enablePrivateEndpoint: true
            enablePrivateNodes: true
            masterIpv4CidrBlock: 10.42.0.0/28
          masterAuthorizedNetworksConfig: {}
          ipAllocationPolicy:
            clusterSecondaryRangeName: ${containerSubnetwork.secondaryIpRanges[0].rangeName}
            servicesSecondaryRangeName: ${containerSubnetwork.secondaryIpRanges[1].rangeName}
          deletionProtection: 'true'
    

    Create NetworkPeeringRoutesConfig Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new NetworkPeeringRoutesConfig(name: string, args: NetworkPeeringRoutesConfigArgs, opts?: CustomResourceOptions);
    @overload
    def NetworkPeeringRoutesConfig(resource_name: str,
                                   args: NetworkPeeringRoutesConfigArgs,
                                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def NetworkPeeringRoutesConfig(resource_name: str,
                                   opts: Optional[ResourceOptions] = None,
                                   export_custom_routes: Optional[bool] = None,
                                   import_custom_routes: Optional[bool] = None,
                                   network: Optional[str] = None,
                                   peering: Optional[str] = None,
                                   project: Optional[str] = None)
    func NewNetworkPeeringRoutesConfig(ctx *Context, name string, args NetworkPeeringRoutesConfigArgs, opts ...ResourceOption) (*NetworkPeeringRoutesConfig, error)
    public NetworkPeeringRoutesConfig(string name, NetworkPeeringRoutesConfigArgs args, CustomResourceOptions? opts = null)
    public NetworkPeeringRoutesConfig(String name, NetworkPeeringRoutesConfigArgs args)
    public NetworkPeeringRoutesConfig(String name, NetworkPeeringRoutesConfigArgs args, CustomResourceOptions options)
    
    type: gcp:compute:NetworkPeeringRoutesConfig
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args NetworkPeeringRoutesConfigArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args NetworkPeeringRoutesConfigArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args NetworkPeeringRoutesConfigArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args NetworkPeeringRoutesConfigArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args NetworkPeeringRoutesConfigArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var networkPeeringRoutesConfigResource = new Gcp.Compute.NetworkPeeringRoutesConfig("networkPeeringRoutesConfigResource", new()
    {
        ExportCustomRoutes = false,
        ImportCustomRoutes = false,
        Network = "string",
        Peering = "string",
        Project = "string",
    });
    
    example, err := compute.NewNetworkPeeringRoutesConfig(ctx, "networkPeeringRoutesConfigResource", &compute.NetworkPeeringRoutesConfigArgs{
    	ExportCustomRoutes: pulumi.Bool(false),
    	ImportCustomRoutes: pulumi.Bool(false),
    	Network:            pulumi.String("string"),
    	Peering:            pulumi.String("string"),
    	Project:            pulumi.String("string"),
    })
    
    var networkPeeringRoutesConfigResource = new NetworkPeeringRoutesConfig("networkPeeringRoutesConfigResource", NetworkPeeringRoutesConfigArgs.builder()
        .exportCustomRoutes(false)
        .importCustomRoutes(false)
        .network("string")
        .peering("string")
        .project("string")
        .build());
    
    network_peering_routes_config_resource = gcp.compute.NetworkPeeringRoutesConfig("networkPeeringRoutesConfigResource",
        export_custom_routes=False,
        import_custom_routes=False,
        network="string",
        peering="string",
        project="string")
    
    const networkPeeringRoutesConfigResource = new gcp.compute.NetworkPeeringRoutesConfig("networkPeeringRoutesConfigResource", {
        exportCustomRoutes: false,
        importCustomRoutes: false,
        network: "string",
        peering: "string",
        project: "string",
    });
    
    type: gcp:compute:NetworkPeeringRoutesConfig
    properties:
        exportCustomRoutes: false
        importCustomRoutes: false
        network: string
        peering: string
        project: string
    

    NetworkPeeringRoutesConfig Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The NetworkPeeringRoutesConfig resource accepts the following input properties:

    ExportCustomRoutes bool
    Whether to export the custom routes to the peer network.
    ImportCustomRoutes bool
    Whether to import the custom routes to the peer network.
    Network string
    The name of the primary network for the peering.


    Peering string
    Name of the peering.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    ExportCustomRoutes bool
    Whether to export the custom routes to the peer network.
    ImportCustomRoutes bool
    Whether to import the custom routes to the peer network.
    Network string
    The name of the primary network for the peering.


    Peering string
    Name of the peering.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    exportCustomRoutes Boolean
    Whether to export the custom routes to the peer network.
    importCustomRoutes Boolean
    Whether to import the custom routes to the peer network.
    network String
    The name of the primary network for the peering.


    peering String
    Name of the peering.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    exportCustomRoutes boolean
    Whether to export the custom routes to the peer network.
    importCustomRoutes boolean
    Whether to import the custom routes to the peer network.
    network string
    The name of the primary network for the peering.


    peering string
    Name of the peering.
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    export_custom_routes bool
    Whether to export the custom routes to the peer network.
    import_custom_routes bool
    Whether to import the custom routes to the peer network.
    network str
    The name of the primary network for the peering.


    peering str
    Name of the peering.
    project str
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    exportCustomRoutes Boolean
    Whether to export the custom routes to the peer network.
    importCustomRoutes Boolean
    Whether to import the custom routes to the peer network.
    network String
    The name of the primary network for the peering.


    peering String
    Name of the peering.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the NetworkPeeringRoutesConfig resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing NetworkPeeringRoutesConfig Resource

    Get an existing NetworkPeeringRoutesConfig resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: NetworkPeeringRoutesConfigState, opts?: CustomResourceOptions): NetworkPeeringRoutesConfig
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            export_custom_routes: Optional[bool] = None,
            import_custom_routes: Optional[bool] = None,
            network: Optional[str] = None,
            peering: Optional[str] = None,
            project: Optional[str] = None) -> NetworkPeeringRoutesConfig
    func GetNetworkPeeringRoutesConfig(ctx *Context, name string, id IDInput, state *NetworkPeeringRoutesConfigState, opts ...ResourceOption) (*NetworkPeeringRoutesConfig, error)
    public static NetworkPeeringRoutesConfig Get(string name, Input<string> id, NetworkPeeringRoutesConfigState? state, CustomResourceOptions? opts = null)
    public static NetworkPeeringRoutesConfig get(String name, Output<String> id, NetworkPeeringRoutesConfigState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    ExportCustomRoutes bool
    Whether to export the custom routes to the peer network.
    ImportCustomRoutes bool
    Whether to import the custom routes to the peer network.
    Network string
    The name of the primary network for the peering.


    Peering string
    Name of the peering.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    ExportCustomRoutes bool
    Whether to export the custom routes to the peer network.
    ImportCustomRoutes bool
    Whether to import the custom routes to the peer network.
    Network string
    The name of the primary network for the peering.


    Peering string
    Name of the peering.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    exportCustomRoutes Boolean
    Whether to export the custom routes to the peer network.
    importCustomRoutes Boolean
    Whether to import the custom routes to the peer network.
    network String
    The name of the primary network for the peering.


    peering String
    Name of the peering.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    exportCustomRoutes boolean
    Whether to export the custom routes to the peer network.
    importCustomRoutes boolean
    Whether to import the custom routes to the peer network.
    network string
    The name of the primary network for the peering.


    peering string
    Name of the peering.
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    export_custom_routes bool
    Whether to export the custom routes to the peer network.
    import_custom_routes bool
    Whether to import the custom routes to the peer network.
    network str
    The name of the primary network for the peering.


    peering str
    Name of the peering.
    project str
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    exportCustomRoutes Boolean
    Whether to export the custom routes to the peer network.
    importCustomRoutes Boolean
    Whether to import the custom routes to the peer network.
    network String
    The name of the primary network for the peering.


    peering String
    Name of the peering.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

    Import

    NetworkPeeringRoutesConfig can be imported using any of these accepted formats:

    • projects/{{project}}/global/networks/{{network}}/networkPeerings/{{peering}}

    • {{project}}/{{network}}/{{peering}}

    • {{network}}/{{peering}}

    When using the pulumi import command, NetworkPeeringRoutesConfig can be imported using one of the formats above. For example:

    $ pulumi import gcp:compute/networkPeeringRoutesConfig:NetworkPeeringRoutesConfig default projects/{{project}}/global/networks/{{network}}/networkPeerings/{{peering}}
    
    $ pulumi import gcp:compute/networkPeeringRoutesConfig:NetworkPeeringRoutesConfig default {{project}}/{{network}}/{{peering}}
    
    $ pulumi import gcp:compute/networkPeeringRoutesConfig:NetworkPeeringRoutesConfig default {{network}}/{{peering}}
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Google Cloud (GCP) Classic pulumi/pulumi-gcp
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the google-beta Terraform Provider.
    gcp logo
    Google Cloud Classic v7.27.0 published on Thursday, Jun 13, 2024 by Pulumi