@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
396 lines (395 loc) • 13.5 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* Manages an ELB loadbalancer resource within HuaweiCloud.
*
* ## Example Usage
* ### Basic Loadbalancer
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const ipv4SubnetId = config.requireObject("ipv4SubnetId");
* const lb1 = new huaweicloud.elb.Loadbalancer("lb1", {
* vipSubnetId: ipv4SubnetId,
* tags: {
* key: "value",
* },
* });
* ```
* ### Loadbalancer With EIP
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const ipv4SubnetId = config.requireObject("ipv4SubnetId");
* const lb1 = new huaweicloud.elb.Loadbalancer("lb1", {vipSubnetId: ipv4SubnetId});
* const eip1 = new huaweicloud.vpc.EipAssociate("eip1", {
* publicIp: "1.2.3.4",
* portId: lb1.vipPortId,
* });
* ```
*
* ## Import
*
* Load balancers can be imported using the `id`, e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:Elb/loadbalancer:Loadbalancer test 3e3632db-36c6-4b28-a92e-e72e6562daa6
* ```
*
* 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`period_unit`, `period`, `auto_renew`. It is generally recommended running `terraform plan` after importing a loadbalancer. You can then decide if changes should be applied to the loadbalancer, or the resource definition should be updated to align with the loadbalancer. Also you can ignore changes as below. hcl resource "huaweicloud_lb_loadbalancer" "test" {
*
* ...
*
* lifecycle {
*
* ignore_changes = [
*
* period_unit, period, auto_renew,
*
* ]
*
* } }
*/
export declare class Loadbalancer extends pulumi.CustomResource {
/**
* Get an existing Loadbalancer 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?: LoadbalancerState, opts?: pulumi.CustomResourceOptions): Loadbalancer;
/**
* Returns true if the given object is an instance of Loadbalancer. 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 Loadbalancer;
/**
* schema: Deprecated
*/
readonly adminStateUp: pulumi.Output<boolean | undefined>;
/**
* Specifies whether auto renew is enabled.
* Valid values are **true** and **false**. Defaults to **false**.
*/
readonly autoRenew: pulumi.Output<string | undefined>;
/**
* Indicates how the load balancer will be billed.
*/
readonly chargeMode: pulumi.Output<string>;
/**
* Specifies the charging mode of the loadbalancer.
* The valid values are **prePaid** and **postPaid**, defaults to **postPaid**.
*/
readonly chargingMode: pulumi.Output<string>;
/**
* The create time of the load balancer.
*/
readonly createdAt: pulumi.Output<string>;
/**
* Human-readable description for the loadbalancer.
*/
readonly description: pulumi.Output<string | undefined>;
/**
* The enterprise project id of the loadbalancer.
*/
readonly enterpriseProjectId: pulumi.Output<string>;
/**
* schema: Deprecated
*/
readonly flavor: pulumi.Output<string | undefined>;
/**
* Indicates the scenario where the load balancer is frozen.
*/
readonly frozenScene: pulumi.Output<string>;
/**
* schema: Deprecated
*/
readonly loadbalancerProvider: pulumi.Output<string>;
/**
* Human-readable name for the loadbalancer. Does not have to be unique.
*/
readonly name: pulumi.Output<string>;
/**
* Specifies the charging period of the loadbalancer.
* + 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`.
*/
readonly period: pulumi.Output<number | undefined>;
/**
* Specifies the charging period unit of the loadbalancer.
* Valid values are **month** and **year**. This parameter is mandatory if `chargingMode` is set to **prePaid**.
*/
readonly periodUnit: pulumi.Output<string | undefined>;
/**
* Specifies the reason to enable modification protection. Only valid when
* `protectionStatus` is **consoleProtection**.
*/
readonly protectionReason: pulumi.Output<string | undefined>;
/**
* Specifies whether modification protection is enabled. Value options:
* + **nonProtection**: No protection.
* + **consoleProtection**: Console modification protection.
*/
readonly protectionStatus: pulumi.Output<string>;
/**
* The EIP address that is associated to the Load Balancer instance.
*/
readonly publicIp: pulumi.Output<string>;
/**
* The region in which to create the loadbalancer resource. If omitted, the
* provider-level region will be used. Changing this creates a new loadbalancer.
*/
readonly region: pulumi.Output<string>;
/**
* schema: Deprecated
*/
readonly securityGroupIds: pulumi.Output<string[]>;
/**
* The key/value pairs to associate with the loadbalancer.
*/
readonly tags: pulumi.Output<{
[key: string]: string;
} | undefined>;
/**
* @deprecated tenant_id is deprecated
*/
readonly tenantId: pulumi.Output<string>;
/**
* The update time of the load balancer.
*/
readonly updatedAt: pulumi.Output<string>;
/**
* The ip address of the load balancer. Changing this creates a new
* loadbalancer.
*/
readonly vipAddress: pulumi.Output<string>;
/**
* The Port ID of the Load Balancer IP.
*/
readonly vipPortId: pulumi.Output<string>;
/**
* The **IPv4 subnet ID** of the subnet where the load balancer works.
* Changing this creates a new loadbalancer.
*/
readonly vipSubnetId: pulumi.Output<string>;
/**
* Create a Loadbalancer 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: LoadbalancerArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering Loadbalancer resources.
*/
export interface LoadbalancerState {
/**
* schema: Deprecated
*/
adminStateUp?: pulumi.Input<boolean>;
/**
* Specifies whether auto renew is enabled.
* Valid values are **true** and **false**. Defaults to **false**.
*/
autoRenew?: pulumi.Input<string>;
/**
* Indicates how the load balancer will be billed.
*/
chargeMode?: pulumi.Input<string>;
/**
* Specifies the charging mode of the loadbalancer.
* The valid values are **prePaid** and **postPaid**, defaults to **postPaid**.
*/
chargingMode?: pulumi.Input<string>;
/**
* The create time of the load balancer.
*/
createdAt?: pulumi.Input<string>;
/**
* Human-readable description for the loadbalancer.
*/
description?: pulumi.Input<string>;
/**
* The enterprise project id of the loadbalancer.
*/
enterpriseProjectId?: pulumi.Input<string>;
/**
* schema: Deprecated
*/
flavor?: pulumi.Input<string>;
/**
* Indicates the scenario where the load balancer is frozen.
*/
frozenScene?: pulumi.Input<string>;
/**
* schema: Deprecated
*/
loadbalancerProvider?: pulumi.Input<string>;
/**
* Human-readable name for the loadbalancer. Does not have to be unique.
*/
name?: pulumi.Input<string>;
/**
* Specifies the charging period of the loadbalancer.
* + 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`.
*/
period?: pulumi.Input<number>;
/**
* Specifies the charging period unit of the loadbalancer.
* Valid values are **month** and **year**. This parameter is mandatory if `chargingMode` is set to **prePaid**.
*/
periodUnit?: pulumi.Input<string>;
/**
* Specifies the reason to enable modification protection. Only valid when
* `protectionStatus` is **consoleProtection**.
*/
protectionReason?: pulumi.Input<string>;
/**
* Specifies whether modification protection is enabled. Value options:
* + **nonProtection**: No protection.
* + **consoleProtection**: Console modification protection.
*/
protectionStatus?: pulumi.Input<string>;
/**
* The EIP address that is associated to the Load Balancer instance.
*/
publicIp?: pulumi.Input<string>;
/**
* The region in which to create the loadbalancer resource. If omitted, the
* provider-level region will be used. Changing this creates a new loadbalancer.
*/
region?: pulumi.Input<string>;
/**
* schema: Deprecated
*/
securityGroupIds?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The key/value pairs to associate with the loadbalancer.
*/
tags?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* @deprecated tenant_id is deprecated
*/
tenantId?: pulumi.Input<string>;
/**
* The update time of the load balancer.
*/
updatedAt?: pulumi.Input<string>;
/**
* The ip address of the load balancer. Changing this creates a new
* loadbalancer.
*/
vipAddress?: pulumi.Input<string>;
/**
* The Port ID of the Load Balancer IP.
*/
vipPortId?: pulumi.Input<string>;
/**
* The **IPv4 subnet ID** of the subnet where the load balancer works.
* Changing this creates a new loadbalancer.
*/
vipSubnetId?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a Loadbalancer resource.
*/
export interface LoadbalancerArgs {
/**
* schema: Deprecated
*/
adminStateUp?: pulumi.Input<boolean>;
/**
* Specifies whether auto renew is enabled.
* Valid values are **true** and **false**. Defaults to **false**.
*/
autoRenew?: pulumi.Input<string>;
/**
* Specifies the charging mode of the loadbalancer.
* The valid values are **prePaid** and **postPaid**, defaults to **postPaid**.
*/
chargingMode?: pulumi.Input<string>;
/**
* Human-readable description for the loadbalancer.
*/
description?: pulumi.Input<string>;
/**
* The enterprise project id of the loadbalancer.
*/
enterpriseProjectId?: pulumi.Input<string>;
/**
* schema: Deprecated
*/
flavor?: pulumi.Input<string>;
/**
* schema: Deprecated
*/
loadbalancerProvider?: pulumi.Input<string>;
/**
* Human-readable name for the loadbalancer. Does not have to be unique.
*/
name?: pulumi.Input<string>;
/**
* Specifies the charging period of the loadbalancer.
* + 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`.
*/
period?: pulumi.Input<number>;
/**
* Specifies the charging period unit of the loadbalancer.
* Valid values are **month** and **year**. This parameter is mandatory if `chargingMode` is set to **prePaid**.
*/
periodUnit?: pulumi.Input<string>;
/**
* Specifies the reason to enable modification protection. Only valid when
* `protectionStatus` is **consoleProtection**.
*/
protectionReason?: pulumi.Input<string>;
/**
* Specifies whether modification protection is enabled. Value options:
* + **nonProtection**: No protection.
* + **consoleProtection**: Console modification protection.
*/
protectionStatus?: pulumi.Input<string>;
/**
* The region in which to create the loadbalancer resource. If omitted, the
* provider-level region will be used. Changing this creates a new loadbalancer.
*/
region?: pulumi.Input<string>;
/**
* schema: Deprecated
*/
securityGroupIds?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The key/value pairs to associate with the loadbalancer.
*/
tags?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* @deprecated tenant_id is deprecated
*/
tenantId?: pulumi.Input<string>;
/**
* The ip address of the load balancer. Changing this creates a new
* loadbalancer.
*/
vipAddress?: pulumi.Input<string>;
/**
* The **IPv4 subnet ID** of the subnet where the load balancer works.
* Changing this creates a new loadbalancer.
*/
vipSubnetId: pulumi.Input<string>;
}