@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
316 lines (315 loc) • 12.4 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
/**
* Represents a PublicDelegatedPrefix for use with bring your own IP addresses (BYOIP).
*
* To get more information about PublicDelegatedPrefix, see:
*
* * [API documentation](https://cloud.google.com/compute/docs/reference/rest/v1/publicDelegatedPrefixes)
* * How-to Guides
* * [Using bring your own IP](https://cloud.google.com/vpc/docs/using-bring-your-own-ip)
*
* ## Example Usage
*
* ### Public Delegated Prefixes Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const advertised = new gcp.compute.PublicAdvertisedPrefix("advertised", {
* name: "my-prefix",
* description: "description",
* dnsVerificationIp: "127.127.0.0",
* ipCidrRange: "127.127.0.0/16",
* });
* const prefixes = new gcp.compute.PublicDelegatedPrefix("prefixes", {
* name: "my-prefix",
* region: "us-central1",
* description: "my description",
* ipCidrRange: "127.127.0.0/24",
* parentPrefix: advertised.id,
* });
* ```
* ### Public Delegated Prefixes Ipv6
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const advertised = new gcp.compute.PublicAdvertisedPrefix("advertised", {
* name: "ipv6-pap",
* description: "description",
* dnsVerificationIp: "2001:db8::",
* ipCidrRange: "2001:db8::/32",
* pdpScope: "REGIONAL",
* });
* const prefix = new gcp.compute.PublicDelegatedPrefix("prefix", {
* name: "ipv6-root-pdp",
* description: "test-delegation-mode-pdp",
* region: "us-west1",
* ipCidrRange: "2001:db8::/40",
* parentPrefix: advertised.id,
* mode: "DELEGATION",
* });
* const subprefix = new gcp.compute.PublicDelegatedPrefix("subprefix", {
* name: "ipv6-sub-pdp",
* description: "test-forwarding-rule-mode-pdp",
* region: "us-west1",
* ipCidrRange: "2001:db8::/48",
* parentPrefix: prefix.id,
* allocatablePrefixLength: 64,
* mode: "EXTERNAL_IPV6_FORWARDING_RULE_CREATION",
* });
* ```
* ### Public Delegated Prefix Ipv6 Subnet Mode
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const advertised = new gcp.compute.PublicAdvertisedPrefix("advertised", {
* name: "ipv6-pap",
* description: "description",
* dnsVerificationIp: "2001:db8::",
* ipCidrRange: "2001:db8::/32",
* pdpScope: "REGIONAL",
* });
* const prefix = new gcp.compute.PublicDelegatedPrefix("prefix", {
* name: "ipv6-root-pdp",
* description: "test-delegation-mode-pdp",
* region: "us-east1",
* ipCidrRange: "2001:db8::/40",
* parentPrefix: advertised.id,
* mode: "DELEGATION",
* });
* const subprefix = new gcp.compute.PublicDelegatedPrefix("subprefix", {
* name: "ipv6-sub-pdp",
* description: "test-subnet-mode-pdp",
* region: "us-east1",
* ipCidrRange: "2001:db8::/48",
* parentPrefix: prefix.id,
* mode: "EXTERNAL_IPV6_SUBNETWORK_CREATION",
* });
* ```
*
* ## Import
*
* PublicDelegatedPrefix can be imported using any of these accepted formats:
*
* * `projects/{{project}}/regions/{{region}}/publicDelegatedPrefixes/{{name}}`
*
* * `{{project}}/{{region}}/{{name}}`
*
* * `{{region}}/{{name}}`
*
* * `{{name}}`
*
* When using the `pulumi import` command, PublicDelegatedPrefix can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:compute/publicDelegatedPrefix:PublicDelegatedPrefix default projects/{{project}}/regions/{{region}}/publicDelegatedPrefixes/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:compute/publicDelegatedPrefix:PublicDelegatedPrefix default {{project}}/{{region}}/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:compute/publicDelegatedPrefix:PublicDelegatedPrefix default {{region}}/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:compute/publicDelegatedPrefix:PublicDelegatedPrefix default {{name}}
* ```
*/
export declare class PublicDelegatedPrefix extends pulumi.CustomResource {
/**
* Get an existing PublicDelegatedPrefix resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name: string, id: pulumi.Input<pulumi.ID>, state?: PublicDelegatedPrefixState, opts?: pulumi.CustomResourceOptions): PublicDelegatedPrefix;
/**
* Returns true if the given object is an instance of PublicDelegatedPrefix. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is PublicDelegatedPrefix;
/**
* The allocatable prefix length supported by this public delegated prefix. This field is optional and cannot be set for prefixes in DELEGATION mode. It cannot be set for IPv4 prefixes either, and it always defaults to 32.
*/
readonly allocatablePrefixLength: pulumi.Output<number>;
/**
* An optional description of this resource.
*/
readonly description: pulumi.Output<string | undefined>;
/**
* The IP address range, in CIDR format, represented by this public delegated prefix.
*/
readonly ipCidrRange: pulumi.Output<string>;
/**
* If true, the prefix will be live migrated.
*/
readonly isLiveMigration: pulumi.Output<boolean | undefined>;
/**
* Specifies the mode of this IPv6 PDP. MODE must be one of: DELEGATION,
* EXTERNAL_IPV6_FORWARDING_RULE_CREATION and EXTERNAL_IPV6_SUBNETWORK_CREATION.
* Possible values are: `DELEGATION`, `EXTERNAL_IPV6_FORWARDING_RULE_CREATION`, `EXTERNAL_IPV6_SUBNETWORK_CREATION`.
*/
readonly mode: pulumi.Output<string | undefined>;
/**
* Name of the resource. The name must be 1-63 characters long, and
* comply with RFC1035. Specifically, the name must be 1-63 characters
* long and match the regular expression `a-z?`
* which means the first character must be a lowercase letter, and all
* following characters must be a dash, lowercase letter, or digit,
* except the last character, which cannot be a dash.
*/
readonly name: pulumi.Output<string>;
/**
* The URL of parent prefix. Either PublicAdvertisedPrefix or PublicDelegatedPrefix.
*/
readonly parentPrefix: pulumi.Output<string>;
/**
* The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
readonly project: pulumi.Output<string>;
/**
* List of sub public delegated fixes for BYO IP functionality.
* Each item in this array represents a sub prefix that can be
* used to create addresses or further allocations.
* Structure is documented below.
*/
readonly publicDelegatedSubPrefixs: pulumi.Output<outputs.compute.PublicDelegatedPrefixPublicDelegatedSubPrefix[]>;
/**
* A region where the prefix will reside.
*/
readonly region: pulumi.Output<string>;
/**
* The URI of the created resource.
*/
readonly selfLink: pulumi.Output<string>;
/**
* Create a PublicDelegatedPrefix resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: PublicDelegatedPrefixArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering PublicDelegatedPrefix resources.
*/
export interface PublicDelegatedPrefixState {
/**
* The allocatable prefix length supported by this public delegated prefix. This field is optional and cannot be set for prefixes in DELEGATION mode. It cannot be set for IPv4 prefixes either, and it always defaults to 32.
*/
allocatablePrefixLength?: pulumi.Input<number>;
/**
* An optional description of this resource.
*/
description?: pulumi.Input<string>;
/**
* The IP address range, in CIDR format, represented by this public delegated prefix.
*/
ipCidrRange?: pulumi.Input<string>;
/**
* If true, the prefix will be live migrated.
*/
isLiveMigration?: pulumi.Input<boolean>;
/**
* Specifies the mode of this IPv6 PDP. MODE must be one of: DELEGATION,
* EXTERNAL_IPV6_FORWARDING_RULE_CREATION and EXTERNAL_IPV6_SUBNETWORK_CREATION.
* Possible values are: `DELEGATION`, `EXTERNAL_IPV6_FORWARDING_RULE_CREATION`, `EXTERNAL_IPV6_SUBNETWORK_CREATION`.
*/
mode?: pulumi.Input<string>;
/**
* Name of the resource. The name must be 1-63 characters long, and
* comply with RFC1035. Specifically, the name must be 1-63 characters
* long and match the regular expression `a-z?`
* which means the first character must be a lowercase letter, and all
* following characters must be a dash, lowercase letter, or digit,
* except the last character, which cannot be a dash.
*/
name?: pulumi.Input<string>;
/**
* The URL of parent prefix. Either PublicAdvertisedPrefix or PublicDelegatedPrefix.
*/
parentPrefix?: pulumi.Input<string>;
/**
* The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
project?: pulumi.Input<string>;
/**
* List of sub public delegated fixes for BYO IP functionality.
* Each item in this array represents a sub prefix that can be
* used to create addresses or further allocations.
* Structure is documented below.
*/
publicDelegatedSubPrefixs?: pulumi.Input<pulumi.Input<inputs.compute.PublicDelegatedPrefixPublicDelegatedSubPrefix>[]>;
/**
* A region where the prefix will reside.
*/
region?: pulumi.Input<string>;
/**
* The URI of the created resource.
*/
selfLink?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a PublicDelegatedPrefix resource.
*/
export interface PublicDelegatedPrefixArgs {
/**
* The allocatable prefix length supported by this public delegated prefix. This field is optional and cannot be set for prefixes in DELEGATION mode. It cannot be set for IPv4 prefixes either, and it always defaults to 32.
*/
allocatablePrefixLength?: pulumi.Input<number>;
/**
* An optional description of this resource.
*/
description?: pulumi.Input<string>;
/**
* The IP address range, in CIDR format, represented by this public delegated prefix.
*/
ipCidrRange: pulumi.Input<string>;
/**
* If true, the prefix will be live migrated.
*/
isLiveMigration?: pulumi.Input<boolean>;
/**
* Specifies the mode of this IPv6 PDP. MODE must be one of: DELEGATION,
* EXTERNAL_IPV6_FORWARDING_RULE_CREATION and EXTERNAL_IPV6_SUBNETWORK_CREATION.
* Possible values are: `DELEGATION`, `EXTERNAL_IPV6_FORWARDING_RULE_CREATION`, `EXTERNAL_IPV6_SUBNETWORK_CREATION`.
*/
mode?: pulumi.Input<string>;
/**
* Name of the resource. The name must be 1-63 characters long, and
* comply with RFC1035. Specifically, the name must be 1-63 characters
* long and match the regular expression `a-z?`
* which means the first character must be a lowercase letter, and all
* following characters must be a dash, lowercase letter, or digit,
* except the last character, which cannot be a dash.
*/
name?: pulumi.Input<string>;
/**
* The URL of parent prefix. Either PublicAdvertisedPrefix or PublicDelegatedPrefix.
*/
parentPrefix: pulumi.Input<string>;
/**
* The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
project?: pulumi.Input<string>;
/**
* A region where the prefix will reside.
*/
region: pulumi.Input<string>;
}