com.pulumi.gcp.networkconnectivity.kotlin.InternalRangeArgs.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.networkconnectivity.kotlin
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.networkconnectivity.InternalRangeArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Int
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName
/**
* The internal range resource for IPAM operations within a VPC network. Used to represent a private address range along with behavioral characterstics of that range (its usage and peering behavior). Networking resources can link to this range if they are created as belonging to it.
* To get more information about InternalRange, see:
* * [API documentation](https://cloud.google.com/network-connectivity/docs/reference/networkconnectivity/rest/v1/projects.locations.internalRanges)
* * How-to Guides
* * [Use internal ranges](https://cloud.google.com/vpc/docs/create-use-internal-ranges)
* ## Example Usage
* ### Network Connectivity Internal Ranges Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const defaultNetwork = new gcp.compute.Network("default", {
* name: "internal-ranges",
* autoCreateSubnetworks: false,
* });
* const _default = new gcp.networkconnectivity.InternalRange("default", {
* name: "basic",
* description: "Test internal range",
* network: defaultNetwork.selfLink,
* usage: "FOR_VPC",
* peering: "FOR_SELF",
* ipCidrRange: "10.0.0.0/24",
* labels: {
* "label-a": "b",
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* default_network = gcp.compute.Network("default",
* name="internal-ranges",
* auto_create_subnetworks=False)
* default = gcp.networkconnectivity.InternalRange("default",
* name="basic",
* description="Test internal range",
* network=default_network.self_link,
* usage="FOR_VPC",
* peering="FOR_SELF",
* ip_cidr_range="10.0.0.0/24",
* labels={
* "label-a": "b",
* })
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var defaultNetwork = new Gcp.Compute.Network("default", new()
* {
* Name = "internal-ranges",
* AutoCreateSubnetworks = false,
* });
* var @default = new Gcp.NetworkConnectivity.InternalRange("default", new()
* {
* Name = "basic",
* Description = "Test internal range",
* Network = defaultNetwork.SelfLink,
* Usage = "FOR_VPC",
* Peering = "FOR_SELF",
* IpCidrRange = "10.0.0.0/24",
* Labels =
* {
* { "label-a", "b" },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/networkconnectivity"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* defaultNetwork, err := compute.NewNetwork(ctx, "default", &compute.NetworkArgs{
* Name: pulumi.String("internal-ranges"),
* AutoCreateSubnetworks: pulumi.Bool(false),
* })
* if err != nil {
* return err
* }
* _, err = networkconnectivity.NewInternalRange(ctx, "default", &networkconnectivity.InternalRangeArgs{
* Name: pulumi.String("basic"),
* Description: pulumi.String("Test internal range"),
* Network: defaultNetwork.SelfLink,
* Usage: pulumi.String("FOR_VPC"),
* Peering: pulumi.String("FOR_SELF"),
* IpCidrRange: pulumi.String("10.0.0.0/24"),
* Labels: pulumi.StringMap{
* "label-a": pulumi.String("b"),
* },
* })
* 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.networkconnectivity.InternalRange;
* import com.pulumi.gcp.networkconnectivity.InternalRangeArgs;
* 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 defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()
* .name("internal-ranges")
* .autoCreateSubnetworks(false)
* .build());
* var default_ = new InternalRange("default", InternalRangeArgs.builder()
* .name("basic")
* .description("Test internal range")
* .network(defaultNetwork.selfLink())
* .usage("FOR_VPC")
* .peering("FOR_SELF")
* .ipCidrRange("10.0.0.0/24")
* .labels(Map.of("label-a", "b"))
* .build());
* }
* }
* ```
* ```yaml
* resources:
* default:
* type: gcp:networkconnectivity:InternalRange
* properties:
* name: basic
* description: Test internal range
* network: ${defaultNetwork.selfLink}
* usage: FOR_VPC
* peering: FOR_SELF
* ipCidrRange: 10.0.0.0/24
* labels:
* label-a: b
* defaultNetwork:
* type: gcp:compute:Network
* name: default
* properties:
* name: internal-ranges
* autoCreateSubnetworks: false
* ```
*
* ### Network Connectivity Internal Ranges Automatic Reservation
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const defaultNetwork = new gcp.compute.Network("default", {
* name: "internal-ranges",
* autoCreateSubnetworks: false,
* });
* const _default = new gcp.networkconnectivity.InternalRange("default", {
* name: "automatic-reservation",
* network: defaultNetwork.id,
* usage: "FOR_VPC",
* peering: "FOR_SELF",
* prefixLength: 24,
* targetCidrRanges: ["192.16.0.0/16"],
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* default_network = gcp.compute.Network("default",
* name="internal-ranges",
* auto_create_subnetworks=False)
* default = gcp.networkconnectivity.InternalRange("default",
* name="automatic-reservation",
* network=default_network.id,
* usage="FOR_VPC",
* peering="FOR_SELF",
* prefix_length=24,
* target_cidr_ranges=["192.16.0.0/16"])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var defaultNetwork = new Gcp.Compute.Network("default", new()
* {
* Name = "internal-ranges",
* AutoCreateSubnetworks = false,
* });
* var @default = new Gcp.NetworkConnectivity.InternalRange("default", new()
* {
* Name = "automatic-reservation",
* Network = defaultNetwork.Id,
* Usage = "FOR_VPC",
* Peering = "FOR_SELF",
* PrefixLength = 24,
* TargetCidrRanges = new[]
* {
* "192.16.0.0/16",
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/networkconnectivity"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* defaultNetwork, err := compute.NewNetwork(ctx, "default", &compute.NetworkArgs{
* Name: pulumi.String("internal-ranges"),
* AutoCreateSubnetworks: pulumi.Bool(false),
* })
* if err != nil {
* return err
* }
* _, err = networkconnectivity.NewInternalRange(ctx, "default", &networkconnectivity.InternalRangeArgs{
* Name: pulumi.String("automatic-reservation"),
* Network: defaultNetwork.ID(),
* Usage: pulumi.String("FOR_VPC"),
* Peering: pulumi.String("FOR_SELF"),
* PrefixLength: pulumi.Int(24),
* TargetCidrRanges: pulumi.StringArray{
* pulumi.String("192.16.0.0/16"),
* },
* })
* 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.networkconnectivity.InternalRange;
* import com.pulumi.gcp.networkconnectivity.InternalRangeArgs;
* 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 defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()
* .name("internal-ranges")
* .autoCreateSubnetworks(false)
* .build());
* var default_ = new InternalRange("default", InternalRangeArgs.builder()
* .name("automatic-reservation")
* .network(defaultNetwork.id())
* .usage("FOR_VPC")
* .peering("FOR_SELF")
* .prefixLength(24)
* .targetCidrRanges("192.16.0.0/16")
* .build());
* }
* }
* ```
* ```yaml
* resources:
* default:
* type: gcp:networkconnectivity:InternalRange
* properties:
* name: automatic-reservation
* network: ${defaultNetwork.id}
* usage: FOR_VPC
* peering: FOR_SELF
* prefixLength: 24
* targetCidrRanges:
* - 192.16.0.0/16
* defaultNetwork:
* type: gcp:compute:Network
* name: default
* properties:
* name: internal-ranges
* autoCreateSubnetworks: false
* ```
*
* ### Network Connectivity Internal Ranges External Ranges
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const defaultNetwork = new gcp.compute.Network("default", {
* name: "internal-ranges",
* autoCreateSubnetworks: false,
* });
* const _default = new gcp.networkconnectivity.InternalRange("default", {
* name: "external-ranges",
* network: defaultNetwork.id,
* usage: "EXTERNAL_TO_VPC",
* peering: "FOR_SELF",
* ipCidrRange: "172.16.0.0/24",
* labels: {
* "external-reserved-range": "on-premises",
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* default_network = gcp.compute.Network("default",
* name="internal-ranges",
* auto_create_subnetworks=False)
* default = gcp.networkconnectivity.InternalRange("default",
* name="external-ranges",
* network=default_network.id,
* usage="EXTERNAL_TO_VPC",
* peering="FOR_SELF",
* ip_cidr_range="172.16.0.0/24",
* labels={
* "external-reserved-range": "on-premises",
* })
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var defaultNetwork = new Gcp.Compute.Network("default", new()
* {
* Name = "internal-ranges",
* AutoCreateSubnetworks = false,
* });
* var @default = new Gcp.NetworkConnectivity.InternalRange("default", new()
* {
* Name = "external-ranges",
* Network = defaultNetwork.Id,
* Usage = "EXTERNAL_TO_VPC",
* Peering = "FOR_SELF",
* IpCidrRange = "172.16.0.0/24",
* Labels =
* {
* { "external-reserved-range", "on-premises" },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/networkconnectivity"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* defaultNetwork, err := compute.NewNetwork(ctx, "default", &compute.NetworkArgs{
* Name: pulumi.String("internal-ranges"),
* AutoCreateSubnetworks: pulumi.Bool(false),
* })
* if err != nil {
* return err
* }
* _, err = networkconnectivity.NewInternalRange(ctx, "default", &networkconnectivity.InternalRangeArgs{
* Name: pulumi.String("external-ranges"),
* Network: defaultNetwork.ID(),
* Usage: pulumi.String("EXTERNAL_TO_VPC"),
* Peering: pulumi.String("FOR_SELF"),
* IpCidrRange: pulumi.String("172.16.0.0/24"),
* Labels: pulumi.StringMap{
* "external-reserved-range": pulumi.String("on-premises"),
* },
* })
* 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.networkconnectivity.InternalRange;
* import com.pulumi.gcp.networkconnectivity.InternalRangeArgs;
* 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 defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()
* .name("internal-ranges")
* .autoCreateSubnetworks(false)
* .build());
* var default_ = new InternalRange("default", InternalRangeArgs.builder()
* .name("external-ranges")
* .network(defaultNetwork.id())
* .usage("EXTERNAL_TO_VPC")
* .peering("FOR_SELF")
* .ipCidrRange("172.16.0.0/24")
* .labels(Map.of("external-reserved-range", "on-premises"))
* .build());
* }
* }
* ```
* ```yaml
* resources:
* default:
* type: gcp:networkconnectivity:InternalRange
* properties:
* name: external-ranges
* network: ${defaultNetwork.id}
* usage: EXTERNAL_TO_VPC
* peering: FOR_SELF
* ipCidrRange: 172.16.0.0/24
* labels:
* external-reserved-range: on-premises
* defaultNetwork:
* type: gcp:compute:Network
* name: default
* properties:
* name: internal-ranges
* autoCreateSubnetworks: false
* ```
*
* ### Network Connectivity Internal Ranges Reserve With Overlap
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const defaultNetwork = new gcp.compute.Network("default", {
* name: "internal-ranges",
* autoCreateSubnetworks: false,
* });
* const _default = new gcp.networkconnectivity.InternalRange("default", {
* name: "overlap-range",
* description: "Test internal range",
* network: defaultNetwork.id,
* usage: "FOR_VPC",
* peering: "FOR_SELF",
* ipCidrRange: "10.0.0.0/30",
* overlaps: ["OVERLAP_EXISTING_SUBNET_RANGE"],
* });
* const defaultSubnetwork = new gcp.compute.Subnetwork("default", {
* name: "overlapping-subnet",
* ipCidrRange: "10.0.0.0/24",
* region: "us-central1",
* network: defaultNetwork.id,
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* default_network = gcp.compute.Network("default",
* name="internal-ranges",
* auto_create_subnetworks=False)
* default = gcp.networkconnectivity.InternalRange("default",
* name="overlap-range",
* description="Test internal range",
* network=default_network.id,
* usage="FOR_VPC",
* peering="FOR_SELF",
* ip_cidr_range="10.0.0.0/30",
* overlaps=["OVERLAP_EXISTING_SUBNET_RANGE"])
* default_subnetwork = gcp.compute.Subnetwork("default",
* name="overlapping-subnet",
* ip_cidr_range="10.0.0.0/24",
* region="us-central1",
* network=default_network.id)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var defaultNetwork = new Gcp.Compute.Network("default", new()
* {
* Name = "internal-ranges",
* AutoCreateSubnetworks = false,
* });
* var @default = new Gcp.NetworkConnectivity.InternalRange("default", new()
* {
* Name = "overlap-range",
* Description = "Test internal range",
* Network = defaultNetwork.Id,
* Usage = "FOR_VPC",
* Peering = "FOR_SELF",
* IpCidrRange = "10.0.0.0/30",
* Overlaps = new[]
* {
* "OVERLAP_EXISTING_SUBNET_RANGE",
* },
* });
* var defaultSubnetwork = new Gcp.Compute.Subnetwork("default", new()
* {
* Name = "overlapping-subnet",
* IpCidrRange = "10.0.0.0/24",
* Region = "us-central1",
* Network = defaultNetwork.Id,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/networkconnectivity"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* defaultNetwork, err := compute.NewNetwork(ctx, "default", &compute.NetworkArgs{
* Name: pulumi.String("internal-ranges"),
* AutoCreateSubnetworks: pulumi.Bool(false),
* })
* if err != nil {
* return err
* }
* _, err = networkconnectivity.NewInternalRange(ctx, "default", &networkconnectivity.InternalRangeArgs{
* Name: pulumi.String("overlap-range"),
* Description: pulumi.String("Test internal range"),
* Network: defaultNetwork.ID(),
* Usage: pulumi.String("FOR_VPC"),
* Peering: pulumi.String("FOR_SELF"),
* IpCidrRange: pulumi.String("10.0.0.0/30"),
* Overlaps: pulumi.StringArray{
* pulumi.String("OVERLAP_EXISTING_SUBNET_RANGE"),
* },
* })
* if err != nil {
* return err
* }
* _, err = compute.NewSubnetwork(ctx, "default", &compute.SubnetworkArgs{
* Name: pulumi.String("overlapping-subnet"),
* IpCidrRange: pulumi.String("10.0.0.0/24"),
* Region: pulumi.String("us-central1"),
* Network: defaultNetwork.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.networkconnectivity.InternalRange;
* import com.pulumi.gcp.networkconnectivity.InternalRangeArgs;
* import com.pulumi.gcp.compute.Subnetwork;
* import com.pulumi.gcp.compute.SubnetworkArgs;
* 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 defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()
* .name("internal-ranges")
* .autoCreateSubnetworks(false)
* .build());
* var default_ = new InternalRange("default", InternalRangeArgs.builder()
* .name("overlap-range")
* .description("Test internal range")
* .network(defaultNetwork.id())
* .usage("FOR_VPC")
* .peering("FOR_SELF")
* .ipCidrRange("10.0.0.0/30")
* .overlaps("OVERLAP_EXISTING_SUBNET_RANGE")
* .build());
* var defaultSubnetwork = new Subnetwork("defaultSubnetwork", SubnetworkArgs.builder()
* .name("overlapping-subnet")
* .ipCidrRange("10.0.0.0/24")
* .region("us-central1")
* .network(defaultNetwork.id())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* default:
* type: gcp:networkconnectivity:InternalRange
* properties:
* name: overlap-range
* description: Test internal range
* network: ${defaultNetwork.id}
* usage: FOR_VPC
* peering: FOR_SELF
* ipCidrRange: 10.0.0.0/30
* overlaps:
* - OVERLAP_EXISTING_SUBNET_RANGE
* defaultNetwork:
* type: gcp:compute:Network
* name: default
* properties:
* name: internal-ranges
* autoCreateSubnetworks: false
* defaultSubnetwork:
* type: gcp:compute:Subnetwork
* name: default
* properties:
* name: overlapping-subnet
* ipCidrRange: 10.0.0.0/24
* region: us-central1
* network: ${defaultNetwork.id}
* ```
*
* ## Import
* InternalRange can be imported using any of these accepted formats:
* * `projects/{{project}}/locations/global/internalRanges/{{name}}`
* * `{{project}}/{{name}}`
* * `{{name}}`
* When using the `pulumi import` command, InternalRange can be imported using one of the formats above. For example:
* ```sh
* $ pulumi import gcp:networkconnectivity/internalRange:InternalRange default projects/{{project}}/locations/global/internalRanges/{{name}}
* ```
* ```sh
* $ pulumi import gcp:networkconnectivity/internalRange:InternalRange default {{project}}/{{name}}
* ```
* ```sh
* $ pulumi import gcp:networkconnectivity/internalRange:InternalRange default {{name}}
* ```
* @property description An optional description of this resource.
* @property ipCidrRange The IP range that this internal range defines.
* @property labels User-defined labels.
* **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
* Please refer to the field `effective_labels` for all of the labels present on the resource.
* @property name The name of the policy based route.
* @property network Fully-qualified URL of the network that this route applies to, for example: projects/my-project/global/networks/my-network.
* @property overlaps Optional. Types of resources that are allowed to overlap with the current internal range.
* Each value may be one of: `OVERLAP_ROUTE_RANGE`, `OVERLAP_EXISTING_SUBNET_RANGE`.
* @property peering The type of peering set for this internal range.
* Possible values are: `FOR_SELF`, `FOR_PEER`, `NOT_SHARED`.
* - - -
* @property prefixLength An alternate to ipCidrRange. Can be set when trying to create a reservation that automatically finds a free range of the given size.
* If both ipCidrRange and prefixLength are set, there is an error if the range sizes do not match. Can also be used during updates to change the range size.
* @property project The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
* @property targetCidrRanges Optional. Can be set to narrow down or pick a different address space while searching for a free range.
* If not set, defaults to the "10.0.0.0/8" address space. This can be used to search in other rfc-1918 address spaces like "172.16.0.0/12" and "192.168.0.0/16" or non-rfc-1918 address spaces used in the VPC.
* @property usage The type of usage set for this InternalRange.
* Possible values are: `FOR_VPC`, `EXTERNAL_TO_VPC`.
*/
public data class InternalRangeArgs(
public val description: Output? = null,
public val ipCidrRange: Output? = null,
public val labels: Output
© 2015 - 2025 Weber Informatics LLC | Privacy Policy