UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

226 lines (225 loc) 8.5 kB
import * as pulumi from "@pulumi/pulumi"; import { input as inputs, output as outputs } from "../types"; /** * Manages a VPC resource within HuaweiCloud. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pulumi from "@huaweicloudos/pulumi"; * * const config = new pulumi.Config(); * const vpcName = config.get("vpcName") || "huaweicloud_vpc"; * const vpcCidr = config.get("vpcCidr") || "192.168.0.0/16"; * const vpc = new huaweicloud.vpc.Vpc("vpc", {cidr: vpcCidr}); * const vpcWithTags = new huaweicloud.vpc.Vpc("vpcWithTags", { * cidr: vpcCidr, * tags: { * foo: "bar", * key: "value", * }, * }); * ``` * * ## Import * * VPCs can be imported using the `id`, e.g. bash * * ```sh * $ pulumi import huaweicloud:Vpc/vpc:Vpc vpc_v1 7117d38e-4c8f-4624-a505-bd96b97d024c * ``` * * Note that the imported state may not be identical to your resource definition when `secondary_cidr` was set. You can ignore changes as below. hcl resource "huaweicloud_vpc" "vpc_v1" { * * ... * * lifecycle { * * ignore_changes = [ secondary_cidr ] * * } } */ export declare class Vpc extends pulumi.CustomResource { /** * Get an existing Vpc 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?: VpcState, opts?: pulumi.CustomResourceOptions): Vpc; /** * Returns true if the given object is an instance of Vpc. 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 Vpc; /** * Specifies the range of available subnets in the VPC. The value ranges from 10.0.0.0/8 to * 10.255.255.0/24, 172.16.0.0/12 to 172.31.255.0/24, or 192.168.0.0/16 to 192.168.255.0/24. */ readonly cidr: pulumi.Output<string>; /** * Specifies supplementary information about the VPC. The value is a string of * no more than 255 characters and cannot contain angle brackets (< or >). */ readonly description: pulumi.Output<string | undefined>; /** * Specifies whether to enable local route enhancement function. It can not be * closed if it has been open. Value options: **true** or **false**. Defaults to **true**. */ readonly enhancedLocalRoute: pulumi.Output<string>; /** * Specifies the enterprise project ID of the VPC. */ readonly enterpriseProjectId: pulumi.Output<string>; /** * Specifies the name of the VPC. The name must be unique for a tenant. The value is a string * of no more than 64 characters and can contain digits, letters, underscores (_), and hyphens (-). */ readonly name: pulumi.Output<string>; /** * Specifies the region in which to create the VPC. If omitted, the * provider-level region will be used. Changing this creates a new VPC resource. */ readonly region: pulumi.Output<string>; /** * @deprecated use huaweicloud_vpc_route_table data source to get all routes */ readonly routes: pulumi.Output<outputs.Vpc.VpcRoute[]>; /** * schema: Deprecated; use secondary_cidrs instead */ readonly secondaryCidr: pulumi.Output<string | undefined>; /** * Specifies the secondary CIDR blocks of the VPC. * Each VPC can have 5 secondary CIDR blocks. */ readonly secondaryCidrs: pulumi.Output<string[]>; /** * The current status of the VPC. Possible values are as follows: CREATING, OK or ERROR. */ readonly status: pulumi.Output<string>; /** * Specifies the key/value pairs to associate with the VPC. */ readonly tags: pulumi.Output<{ [key: string]: string; } | undefined>; /** * Create a Vpc 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: VpcArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Vpc resources. */ export interface VpcState { /** * Specifies the range of available subnets in the VPC. The value ranges from 10.0.0.0/8 to * 10.255.255.0/24, 172.16.0.0/12 to 172.31.255.0/24, or 192.168.0.0/16 to 192.168.255.0/24. */ cidr?: pulumi.Input<string>; /** * Specifies supplementary information about the VPC. The value is a string of * no more than 255 characters and cannot contain angle brackets (< or >). */ description?: pulumi.Input<string>; /** * Specifies whether to enable local route enhancement function. It can not be * closed if it has been open. Value options: **true** or **false**. Defaults to **true**. */ enhancedLocalRoute?: pulumi.Input<string>; /** * Specifies the enterprise project ID of the VPC. */ enterpriseProjectId?: pulumi.Input<string>; /** * Specifies the name of the VPC. The name must be unique for a tenant. The value is a string * of no more than 64 characters and can contain digits, letters, underscores (_), and hyphens (-). */ name?: pulumi.Input<string>; /** * Specifies the region in which to create the VPC. If omitted, the * provider-level region will be used. Changing this creates a new VPC resource. */ region?: pulumi.Input<string>; /** * @deprecated use huaweicloud_vpc_route_table data source to get all routes */ routes?: pulumi.Input<pulumi.Input<inputs.Vpc.VpcRoute>[]>; /** * schema: Deprecated; use secondary_cidrs instead */ secondaryCidr?: pulumi.Input<string>; /** * Specifies the secondary CIDR blocks of the VPC. * Each VPC can have 5 secondary CIDR blocks. */ secondaryCidrs?: pulumi.Input<pulumi.Input<string>[]>; /** * The current status of the VPC. Possible values are as follows: CREATING, OK or ERROR. */ status?: pulumi.Input<string>; /** * Specifies the key/value pairs to associate with the VPC. */ tags?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; } /** * The set of arguments for constructing a Vpc resource. */ export interface VpcArgs { /** * Specifies the range of available subnets in the VPC. The value ranges from 10.0.0.0/8 to * 10.255.255.0/24, 172.16.0.0/12 to 172.31.255.0/24, or 192.168.0.0/16 to 192.168.255.0/24. */ cidr: pulumi.Input<string>; /** * Specifies supplementary information about the VPC. The value is a string of * no more than 255 characters and cannot contain angle brackets (< or >). */ description?: pulumi.Input<string>; /** * Specifies whether to enable local route enhancement function. It can not be * closed if it has been open. Value options: **true** or **false**. Defaults to **true**. */ enhancedLocalRoute?: pulumi.Input<string>; /** * Specifies the enterprise project ID of the VPC. */ enterpriseProjectId?: pulumi.Input<string>; /** * Specifies the name of the VPC. The name must be unique for a tenant. The value is a string * of no more than 64 characters and can contain digits, letters, underscores (_), and hyphens (-). */ name?: pulumi.Input<string>; /** * Specifies the region in which to create the VPC. If omitted, the * provider-level region will be used. Changing this creates a new VPC resource. */ region?: pulumi.Input<string>; /** * schema: Deprecated; use secondary_cidrs instead */ secondaryCidr?: pulumi.Input<string>; /** * Specifies the secondary CIDR blocks of the VPC. * Each VPC can have 5 secondary CIDR blocks. */ secondaryCidrs?: pulumi.Input<pulumi.Input<string>[]>; /** * Specifies the key/value pairs to associate with the VPC. */ tags?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; }