UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

189 lines (188 loc) 7.02 kB
import * as pulumi from "@pulumi/pulumi"; import { input as inputs, output as outputs } from "../types"; /** * Manages a VPC custom route table resource within HuaweiCloud. * * > **NOTE:** To use a custom route table, you need to submit a service ticket to increase quota. * * ## Example Usage * ### Basic Custom Route Table * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pulumi from "@huaweicloudos/pulumi"; * * const config = new pulumi.Config(); * const vpcId = config.requireObject("vpcId"); * const vpcPeeringId = config.requireObject("vpcPeeringId"); * const demo = new huaweicloud.vpc.RouteTable("demo", { * vpcId: vpcId, * description: "a custom route table demo", * routes: [{ * destination: "172.16.0.0/16", * type: "peering", * nexthop: vpcPeeringId, * }], * }); * ``` * ### Associating Subnets with a Route Table * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as huaweicloud from "@pulumi/huaweicloud"; * import * as pulumi from "@huaweicloudos/pulumi"; * * const config = new pulumi.Config(); * const vpcId = config.requireObject("vpcId"); * const vpcPeeringId = config.requireObject("vpcPeeringId"); * const subnetIds = huaweicloud.Vpc.getSubnetIds({ * vpcId: vpcId, * }); * const demo = new huaweicloud.vpc.RouteTable("demo", { * vpcId: vpcId, * subnets: subnetIds.then(subnetIds => subnetIds.ids), * routes: [ * { * destination: "172.16.0.0/16", * type: "peering", * nexthop: vpcPeeringId, * }, * { * destination: "192.168.100.0/24", * type: "vip", * nexthop: "192.168.10.200", * }, * ], * }); * ``` * * ## Import * * vpc route tables can be imported using the `id`, e.g. bash * * ```sh * $ pulumi import huaweicloud:Vpc/routeTable:RouteTable demo e1b3208a-544b-42a7-84e6-5d70371dd982 * ``` */ export declare class RouteTable extends pulumi.CustomResource { /** * Get an existing RouteTable 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?: RouteTableState, opts?: pulumi.CustomResourceOptions): RouteTable; /** * Returns true if the given object is an instance of RouteTable. 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 RouteTable; /** * Specifies the supplementary information about the route. * The value is a string of no more than 255 characters and cannot contain angle brackets (< or >). */ readonly description: pulumi.Output<string | undefined>; /** * Specifies the route table name. The value is a string of no more than * `64` characters that can contain letters, digits, underscores (_), hyphens (-), and periods (.). */ readonly name: pulumi.Output<string>; /** * The region in which to create the vpc route table. * If omitted, the provider-level region will be used. Changing this creates a new resource. */ readonly region: pulumi.Output<string>; /** * Specifies the route object list. The route object * is documented below. */ readonly routes: pulumi.Output<outputs.Vpc.RouteTableRoute[]>; /** * Specifies an array of one or more subnets associating with the route table. */ readonly subnets: pulumi.Output<string[] | undefined>; /** * Specifies the VPC ID for which a route table is to be added. * Changing this creates a new resource. */ readonly vpcId: pulumi.Output<string>; /** * Create a RouteTable 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: RouteTableArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering RouteTable resources. */ export interface RouteTableState { /** * Specifies the supplementary information about the route. * The value is a string of no more than 255 characters and cannot contain angle brackets (< or >). */ description?: pulumi.Input<string>; /** * Specifies the route table name. The value is a string of no more than * `64` characters that can contain letters, digits, underscores (_), hyphens (-), and periods (.). */ name?: pulumi.Input<string>; /** * The region in which to create the vpc route table. * If omitted, the provider-level region will be used. Changing this creates a new resource. */ region?: pulumi.Input<string>; /** * Specifies the route object list. The route object * is documented below. */ routes?: pulumi.Input<pulumi.Input<inputs.Vpc.RouteTableRoute>[]>; /** * Specifies an array of one or more subnets associating with the route table. */ subnets?: pulumi.Input<pulumi.Input<string>[]>; /** * Specifies the VPC ID for which a route table is to be added. * Changing this creates a new resource. */ vpcId?: pulumi.Input<string>; } /** * The set of arguments for constructing a RouteTable resource. */ export interface RouteTableArgs { /** * Specifies the supplementary information about the route. * The value is a string of no more than 255 characters and cannot contain angle brackets (< or >). */ description?: pulumi.Input<string>; /** * Specifies the route table name. The value is a string of no more than * `64` characters that can contain letters, digits, underscores (_), hyphens (-), and periods (.). */ name?: pulumi.Input<string>; /** * The region in which to create the vpc route table. * If omitted, the provider-level region will be used. Changing this creates a new resource. */ region?: pulumi.Input<string>; /** * Specifies the route object list. The route object * is documented below. */ routes?: pulumi.Input<pulumi.Input<inputs.Vpc.RouteTableRoute>[]>; /** * Specifies an array of one or more subnets associating with the route table. */ subnets?: pulumi.Input<pulumi.Input<string>[]>; /** * Specifies the VPC ID for which a route table is to be added. * Changing this creates a new resource. */ vpcId: pulumi.Input<string>; }