@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
412 lines (411 loc) • 16.6 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import { input as inputs, output as outputs } from "../types";
/**
* Manages a gateway resource of the **public** NAT within HuaweiCloud.
*
* ## Example Usage
* ### Creating a postpaid NAT gateway
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const gatewayName = config.requireObject("gatewayName");
* const vpcId = config.requireObject("vpcId");
* const networkId = config.requireObject("networkId");
* const gatewaySpecification = config.requireObject("gatewaySpecification");
* const test = new huaweicloud.nat.Gateway("test", {
* description: "test for terraform",
* spec: gatewaySpecification,
* vpcId: vpcId,
* subnetId: networkId,
* });
* ```
* ### Creating a prepaid NAT gateway
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const gatewayName = config.requireObject("gatewayName");
* const vpcId = config.requireObject("vpcId");
* const networkId = config.requireObject("networkId");
* const gatewaySpecification = config.requireObject("gatewaySpecification");
* const test = new huaweicloud.nat.Gateway("test", {
* description: "test for terraform",
* spec: gatewaySpecification,
* vpcId: vpcId,
* subnetId: networkId,
* chargingMode: "prePaid",
* periodUnit: "month",
* period: 1,
* autoRenew: "true",
* });
* ```
*
* ## Import
*
* NAT gateways can be imported using their `id`, e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:Nat/gateway:Gateway test <id>
* ```
*
* Note that the imported state may not be identical to your resource definition, due to some attributes missing from the API response, security or some other reason. The missing attributes include`charging_mode`, `period_unit`, `period` and `auto_renew`. It is generally recommended running `terraform plan` after importing a resource. You can then decide if changes should be applied to the resource, or the resource definition should be updated to align with the resource. Also, you can ignore changes as below. hcl resource "huaweicloud_nat_gateway" "test" {
*
* ...
*
* lifecycle {
*
* ignore_changes = [
*
* charging_mode, period_unit, period, auto_renew,
*
* ]
*
* } }
*/
export declare class Gateway extends pulumi.CustomResource {
/**
* Get an existing Gateway 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?: GatewayState, opts?: pulumi.CustomResourceOptions): Gateway;
/**
* Returns true if the given object is an instance of Gateway. 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 Gateway;
/**
* Specifies whether auto-renew is enabled. This parameter is only valid when
* `chargingMode` is set to **prePaid**. Valid values are **true** and **false**. Defaults to **false**.
*/
readonly autoRenew: pulumi.Output<string | undefined>;
/**
* The order information of the NAT gateway.
* When the `chargingMode` is set to **prePaid**, this parameter is available.
*/
readonly billingInfo: pulumi.Output<string>;
/**
* The bandwidth that the NAT gateway can receive or send per second, unit is MB.
*/
readonly bpsMax: pulumi.Output<number>;
/**
* Specifies the charging mode of the NAT gateway.
* The valid values are as follows:
* + **prePaid**: the yearly/monthly billing mode.
* + **postPaid**: the pay-per-use billing mode.
*/
readonly chargingMode: pulumi.Output<string>;
/**
* The creation time of the NAT gateway.
*/
readonly createdAt: pulumi.Output<string>;
/**
* Specifies the description of the NAT gateway, which contain maximum of `512`
* characters, and angle brackets (<) and (>) are not allowed.
*/
readonly description: pulumi.Output<string | undefined>;
/**
* The maximum number of DNAT rules on the NAT gateway. Defaults to `200`.
*/
readonly dnatRulesLimit: pulumi.Output<number>;
/**
* Specifies the enterprise project ID of the NAT gateway.
* Changing this will create a new resource.
*/
readonly enterpriseProjectId: pulumi.Output<string>;
/**
* Specifies the NAT gateway name.
* The valid length is limited from `1` to `64`, only letters, digits, hyphens (-) and underscores (_) are allowed.
*/
readonly name: pulumi.Output<string>;
/**
* Specifies the IP address used for the NG port of the NAT gateway.
* The IP address must be one of the IP addresses of the VPC subnet associated with the NAT gateway.
* If not spacified, it will be automatically allocated.
* Changing this will creates a new resource.
*/
readonly ngportIpAddress: pulumi.Output<string>;
/**
* Specifies the charging period of the NAT gateway.
* If `periodUnit` is set to **month**, the value ranges from `1` to `9`.
* If `periodUnit` is set to **year**, the value ranges from `1` to `3`.
* This parameter is mandatory if `chargingMode` is set to **prePaid**.
* Changing this will create a new resource.
*/
readonly period: pulumi.Output<number | undefined>;
/**
* Specifies the charging period unit of the NAT gateway.
* Valid values are **month** and **year**. This parameter is mandatory if `chargingMode` is set to **prePaid**.
* Changing this will create a new resource.
*/
readonly periodUnit: pulumi.Output<string | undefined>;
/**
* The number of packets that the NAT gateway can receive or send per second.
*/
readonly ppsMax: pulumi.Output<number>;
/**
* Specifies the region where the NAT gateway is located.
* If omitted, the provider-level region will be used. Changing this will create a new resource.
*/
readonly region: pulumi.Output<string>;
/**
* Specifies the session configuration of the NAT gateway.
* The sessionConf structure is documented below.
*/
readonly sessionConf: pulumi.Output<outputs.Nat.GatewaySessionConf>;
/**
* The maximum number of SNAT rules on the NAT gateway. Defaults to `20`.
*/
readonly snatRulePublicIpLimit: pulumi.Output<number>;
/**
* Specifies the specification of the NAT gateway. The valid values are as follows:
* + **1**: Small type, which supports up to `10,000` SNAT connections.
* + **2**: Medium type, which supports up to `50,000` SNAT connections.
* + **3**: Large type, which supports up to `200,000` SNAT connections.
* + **4**: Extra-large type, which supports up to `1,000,000` SNAT connections.
*/
readonly spec: pulumi.Output<string>;
/**
* The current status of the NAT gateway.
*/
readonly status: pulumi.Output<string>;
/**
* Specifies the subnet ID of the downstream interface (the next hop of the
* DVR) of the NAT gateway.
* Changing this will create a new resource.
*/
readonly subnetId: pulumi.Output<string>;
/**
* Specifies the key/value pairs to associate with the NAT gateway.
*/
readonly tags: pulumi.Output<{
[key: string]: string;
} | undefined>;
/**
* Specifies the ID of the VPC to which the NAT gateway belongs.
* Changing this will create a new resource.
*/
readonly vpcId: pulumi.Output<string>;
/**
* Create a Gateway 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: GatewayArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering Gateway resources.
*/
export interface GatewayState {
/**
* Specifies whether auto-renew is enabled. This parameter is only valid when
* `chargingMode` is set to **prePaid**. Valid values are **true** and **false**. Defaults to **false**.
*/
autoRenew?: pulumi.Input<string>;
/**
* The order information of the NAT gateway.
* When the `chargingMode` is set to **prePaid**, this parameter is available.
*/
billingInfo?: pulumi.Input<string>;
/**
* The bandwidth that the NAT gateway can receive or send per second, unit is MB.
*/
bpsMax?: pulumi.Input<number>;
/**
* Specifies the charging mode of the NAT gateway.
* The valid values are as follows:
* + **prePaid**: the yearly/monthly billing mode.
* + **postPaid**: the pay-per-use billing mode.
*/
chargingMode?: pulumi.Input<string>;
/**
* The creation time of the NAT gateway.
*/
createdAt?: pulumi.Input<string>;
/**
* Specifies the description of the NAT gateway, which contain maximum of `512`
* characters, and angle brackets (<) and (>) are not allowed.
*/
description?: pulumi.Input<string>;
/**
* The maximum number of DNAT rules on the NAT gateway. Defaults to `200`.
*/
dnatRulesLimit?: pulumi.Input<number>;
/**
* Specifies the enterprise project ID of the NAT gateway.
* Changing this will create a new resource.
*/
enterpriseProjectId?: pulumi.Input<string>;
/**
* Specifies the NAT gateway name.
* The valid length is limited from `1` to `64`, only letters, digits, hyphens (-) and underscores (_) are allowed.
*/
name?: pulumi.Input<string>;
/**
* Specifies the IP address used for the NG port of the NAT gateway.
* The IP address must be one of the IP addresses of the VPC subnet associated with the NAT gateway.
* If not spacified, it will be automatically allocated.
* Changing this will creates a new resource.
*/
ngportIpAddress?: pulumi.Input<string>;
/**
* Specifies the charging period of the NAT gateway.
* If `periodUnit` is set to **month**, the value ranges from `1` to `9`.
* If `periodUnit` is set to **year**, the value ranges from `1` to `3`.
* This parameter is mandatory if `chargingMode` is set to **prePaid**.
* Changing this will create a new resource.
*/
period?: pulumi.Input<number>;
/**
* Specifies the charging period unit of the NAT gateway.
* Valid values are **month** and **year**. This parameter is mandatory if `chargingMode` is set to **prePaid**.
* Changing this will create a new resource.
*/
periodUnit?: pulumi.Input<string>;
/**
* The number of packets that the NAT gateway can receive or send per second.
*/
ppsMax?: pulumi.Input<number>;
/**
* Specifies the region where the NAT gateway is located.
* If omitted, the provider-level region will be used. Changing this will create a new resource.
*/
region?: pulumi.Input<string>;
/**
* Specifies the session configuration of the NAT gateway.
* The sessionConf structure is documented below.
*/
sessionConf?: pulumi.Input<inputs.Nat.GatewaySessionConf>;
/**
* The maximum number of SNAT rules on the NAT gateway. Defaults to `20`.
*/
snatRulePublicIpLimit?: pulumi.Input<number>;
/**
* Specifies the specification of the NAT gateway. The valid values are as follows:
* + **1**: Small type, which supports up to `10,000` SNAT connections.
* + **2**: Medium type, which supports up to `50,000` SNAT connections.
* + **3**: Large type, which supports up to `200,000` SNAT connections.
* + **4**: Extra-large type, which supports up to `1,000,000` SNAT connections.
*/
spec?: pulumi.Input<string>;
/**
* The current status of the NAT gateway.
*/
status?: pulumi.Input<string>;
/**
* Specifies the subnet ID of the downstream interface (the next hop of the
* DVR) of the NAT gateway.
* Changing this will create a new resource.
*/
subnetId?: pulumi.Input<string>;
/**
* Specifies the key/value pairs to associate with the NAT gateway.
*/
tags?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* Specifies the ID of the VPC to which the NAT gateway belongs.
* Changing this will create a new resource.
*/
vpcId?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a Gateway resource.
*/
export interface GatewayArgs {
/**
* Specifies whether auto-renew is enabled. This parameter is only valid when
* `chargingMode` is set to **prePaid**. Valid values are **true** and **false**. Defaults to **false**.
*/
autoRenew?: pulumi.Input<string>;
/**
* Specifies the charging mode of the NAT gateway.
* The valid values are as follows:
* + **prePaid**: the yearly/monthly billing mode.
* + **postPaid**: the pay-per-use billing mode.
*/
chargingMode?: pulumi.Input<string>;
/**
* Specifies the description of the NAT gateway, which contain maximum of `512`
* characters, and angle brackets (<) and (>) are not allowed.
*/
description?: pulumi.Input<string>;
/**
* Specifies the enterprise project ID of the NAT gateway.
* Changing this will create a new resource.
*/
enterpriseProjectId?: pulumi.Input<string>;
/**
* Specifies the NAT gateway name.
* The valid length is limited from `1` to `64`, only letters, digits, hyphens (-) and underscores (_) are allowed.
*/
name?: pulumi.Input<string>;
/**
* Specifies the IP address used for the NG port of the NAT gateway.
* The IP address must be one of the IP addresses of the VPC subnet associated with the NAT gateway.
* If not spacified, it will be automatically allocated.
* Changing this will creates a new resource.
*/
ngportIpAddress?: pulumi.Input<string>;
/**
* Specifies the charging period of the NAT gateway.
* If `periodUnit` is set to **month**, the value ranges from `1` to `9`.
* If `periodUnit` is set to **year**, the value ranges from `1` to `3`.
* This parameter is mandatory if `chargingMode` is set to **prePaid**.
* Changing this will create a new resource.
*/
period?: pulumi.Input<number>;
/**
* Specifies the charging period unit of the NAT gateway.
* Valid values are **month** and **year**. This parameter is mandatory if `chargingMode` is set to **prePaid**.
* Changing this will create a new resource.
*/
periodUnit?: pulumi.Input<string>;
/**
* Specifies the region where the NAT gateway is located.
* If omitted, the provider-level region will be used. Changing this will create a new resource.
*/
region?: pulumi.Input<string>;
/**
* Specifies the session configuration of the NAT gateway.
* The sessionConf structure is documented below.
*/
sessionConf?: pulumi.Input<inputs.Nat.GatewaySessionConf>;
/**
* Specifies the specification of the NAT gateway. The valid values are as follows:
* + **1**: Small type, which supports up to `10,000` SNAT connections.
* + **2**: Medium type, which supports up to `50,000` SNAT connections.
* + **3**: Large type, which supports up to `200,000` SNAT connections.
* + **4**: Extra-large type, which supports up to `1,000,000` SNAT connections.
*/
spec: pulumi.Input<string>;
/**
* Specifies the subnet ID of the downstream interface (the next hop of the
* DVR) of the NAT gateway.
* Changing this will create a new resource.
*/
subnetId: pulumi.Input<string>;
/**
* Specifies the key/value pairs to associate with the NAT gateway.
*/
tags?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* Specifies the ID of the VPC to which the NAT gateway belongs.
* Changing this will create a new resource.
*/
vpcId: pulumi.Input<string>;
}