com.pulumi.gcp.compute.kotlin.NetworkPeeringRoutesConfigArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-gcp-kotlin Show documentation
Show all versions of pulumi-gcp-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.gcp.compute.kotlin
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.compute.NetworkPeeringRoutesConfigArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName
/**
* 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:
* * [API documentation](https://cloud.google.com/compute/docs/reference/rest/v1/networks/updatePeering)
* * How-to Guides
* * [Official Documentation](https://cloud.google.com/vpc/docs/vpc-peering)
* ## Example Usage
* ### Network Peering Routes Config Basic
*
* ```typescript
* 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,
* });
* ```
* ```python
* 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)
* ```
* ```csharp
* 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,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v8/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
* })
* }
* ```
* ```java
* 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());
* }
* }
* ```
* ```yaml
* 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
*
* ```typescript
* 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,
* });
* ```
* ```python
* 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=[
* {
* "range_name": "pod",
* "ip_cidr_range": "10.0.0.0/19",
* },
* {
* "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={
* "enable_private_endpoint": True,
* "enable_private_nodes": True,
* "master_ipv4_cidr_block": "10.42.0.0/28",
* },
* master_authorized_networks_config={},
* ip_allocation_policy={
* "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)
* ```
* ```csharp
* 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,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
* "github.com/pulumi/pulumi-gcp/sdk/v8/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: &container.ClusterMasterAuthorizedNetworksConfigArgs{},
* 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: pulumi.String(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
* })
* }
* ```
* ```java
* 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());
* }
* }
* ```
* ```yaml
* 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
* ```
*
* ## 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:
* ```sh
* $ pulumi import gcp:compute/networkPeeringRoutesConfig:NetworkPeeringRoutesConfig default projects/{{project}}/global/networks/{{network}}/networkPeerings/{{peering}}
* ```
* ```sh
* $ pulumi import gcp:compute/networkPeeringRoutesConfig:NetworkPeeringRoutesConfig default {{project}}/{{network}}/{{peering}}
* ```
* ```sh
* $ pulumi import gcp:compute/networkPeeringRoutesConfig:NetworkPeeringRoutesConfig default {{network}}/{{peering}}
* ```
* @property exportCustomRoutes Whether to export the custom routes to the peer network.
* @property importCustomRoutes Whether to import the custom routes to the peer network.
* @property network The name of the primary network for the peering.
* - - -
* @property peering Name of the peering.
* @property project The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
public data class NetworkPeeringRoutesConfigArgs(
public val exportCustomRoutes: Output? = null,
public val importCustomRoutes: Output? = null,
public val network: Output? = null,
public val peering: Output? = null,
public val project: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.gcp.compute.NetworkPeeringRoutesConfigArgs =
com.pulumi.gcp.compute.NetworkPeeringRoutesConfigArgs.builder()
.exportCustomRoutes(exportCustomRoutes?.applyValue({ args0 -> args0 }))
.importCustomRoutes(importCustomRoutes?.applyValue({ args0 -> args0 }))
.network(network?.applyValue({ args0 -> args0 }))
.peering(peering?.applyValue({ args0 -> args0 }))
.project(project?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [NetworkPeeringRoutesConfigArgs].
*/
@PulumiTagMarker
public class NetworkPeeringRoutesConfigArgsBuilder internal constructor() {
private var exportCustomRoutes: Output? = null
private var importCustomRoutes: Output? = null
private var network: Output? = null
private var peering: Output? = null
private var project: Output? = null
/**
* @param value Whether to export the custom routes to the peer network.
*/
@JvmName("xsihuppfxhmmutti")
public suspend fun exportCustomRoutes(`value`: Output) {
this.exportCustomRoutes = value
}
/**
* @param value Whether to import the custom routes to the peer network.
*/
@JvmName("dwvonvxfjrkyalek")
public suspend fun importCustomRoutes(`value`: Output) {
this.importCustomRoutes = value
}
/**
* @param value The name of the primary network for the peering.
* - - -
*/
@JvmName("indirxkulkwotnqy")
public suspend fun network(`value`: Output) {
this.network = value
}
/**
* @param value Name of the peering.
*/
@JvmName("rjmxbgeuellnwnnu")
public suspend fun peering(`value`: Output) {
this.peering = value
}
/**
* @param value The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
@JvmName("xfvlxpptxheirait")
public suspend fun project(`value`: Output) {
this.project = value
}
/**
* @param value Whether to export the custom routes to the peer network.
*/
@JvmName("bnxnpyeocgebdoxi")
public suspend fun exportCustomRoutes(`value`: Boolean?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.exportCustomRoutes = mapped
}
/**
* @param value Whether to import the custom routes to the peer network.
*/
@JvmName("hewgbmunkiwvnpfn")
public suspend fun importCustomRoutes(`value`: Boolean?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.importCustomRoutes = mapped
}
/**
* @param value The name of the primary network for the peering.
* - - -
*/
@JvmName("rmnqryxwutatuekb")
public suspend fun network(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.network = mapped
}
/**
* @param value Name of the peering.
*/
@JvmName("cckxletvjdakslhq")
public suspend fun peering(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.peering = mapped
}
/**
* @param value The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
@JvmName("gunswctetoerlfac")
public suspend fun project(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.project = mapped
}
internal fun build(): NetworkPeeringRoutesConfigArgs = NetworkPeeringRoutesConfigArgs(
exportCustomRoutes = exportCustomRoutes,
importCustomRoutes = importCustomRoutes,
network = network,
peering = peering,
project = project,
)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy