@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
230 lines (229 loc) • 9.64 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* Manages an ELB L7 Policy resource within HuaweiCloud.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const loadbalancer1 = new huaweicloud.elb.Loadbalancer("loadbalancer1", {vipSubnetId: _var.subnet_id});
* const listener1 = new huaweicloud.elb.Listener("listener1", {
* protocol: "HTTP",
* protocolPort: 8080,
* loadbalancerId: loadbalancer1.id,
* });
* const pool1 = new huaweicloud.elb.Pool("pool1", {
* protocol: "HTTP",
* lbMethod: "ROUND_ROBIN",
* loadbalancerId: loadbalancer1.id,
* });
* const l7policy1 = new huaweicloud.elb.L7policy("l7policy1", {
* action: "REDIRECT_TO_POOL",
* description: "test l7 policy",
* position: 1,
* listenerId: listener1.id,
* redirectPoolId: pool1.id,
* });
* ```
*
* ## Import
*
* Load Balancer L7 Policy can be imported using the L7 Policy ID, e.g.bash
*
* ```sh
* $ pulumi import huaweicloud:Elb/l7policy:L7policy l7policy_1 8a7a79c2-cf17-4e65-b2ae-ddc8bfcf6c74
* ```
*/
export declare class L7policy extends pulumi.CustomResource {
/**
* Get an existing L7policy 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?: L7policyState, opts?: pulumi.CustomResourceOptions): L7policy;
/**
* Returns true if the given object is an instance of L7policy. 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 L7policy;
/**
* Specifies whether requests are forwarded to another backend server group
* or redirected to an HTTPS listener. Changing this creates a new L7 Policy. The value ranges:
* + **REDIRECT_TO_POOL**: Requests are forwarded to the backend server group specified by `redirectPoolId`.
* + **REDIRECT_TO_LISTENER**: Requests are redirected from the HTTP listener specified by `listenerId` to the
* HTTPS listener specified by `redirectListenerId`.
*/
readonly action: pulumi.Output<string>;
readonly adminStateUp: pulumi.Output<boolean | undefined>;
/**
* Human-readable description for the L7 Policy.
*/
readonly description: pulumi.Output<string | undefined>;
/**
* Specifies the ID of the listener for which the forwarding policy is added.
* Changing this creates a new L7 Policy.
*/
readonly listenerId: pulumi.Output<string>;
/**
* Human-readable name for the L7 Policy. Does not have to be unique.
*/
readonly name: pulumi.Output<string>;
/**
* The position of this policy on the listener. Positions start at 1.
* Changing this creates a new L7 Policy.
*/
readonly position: pulumi.Output<number>;
/**
* Specifies the ID of the listener to which the traffic is redirected.
* This parameter is mandatory when `action` is set to **REDIRECT_TO_LISTENER**. The listener must meet the
* following requirements:
* + Can only be an HTTPS listener.
* + Can only be a listener of the same load balancer.
*/
readonly redirectListenerId: pulumi.Output<string | undefined>;
/**
* Specifies the ID of the backend server group to which traffic is forwarded.
* This parameter is mandatory when `action` is set to **REDIRECT_TO_POOL**. The backend server group must meet the
* following requirements:
* + Cannot be the default backend server group of the listener.
* + Cannot be the backend server group used by forwarding policies of other listeners.
*/
readonly redirectPoolId: pulumi.Output<string | undefined>;
/**
* The region in which to create the L7 Policy resource. If omitted, the
* provider-level region will be used. Changing this creates a new L7 Policy.
*/
readonly region: pulumi.Output<string>;
/**
* @deprecated tenant_id is deprecated
*/
readonly tenantId: pulumi.Output<string>;
/**
* Create a L7policy 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: L7policyArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering L7policy resources.
*/
export interface L7policyState {
/**
* Specifies whether requests are forwarded to another backend server group
* or redirected to an HTTPS listener. Changing this creates a new L7 Policy. The value ranges:
* + **REDIRECT_TO_POOL**: Requests are forwarded to the backend server group specified by `redirectPoolId`.
* + **REDIRECT_TO_LISTENER**: Requests are redirected from the HTTP listener specified by `listenerId` to the
* HTTPS listener specified by `redirectListenerId`.
*/
action?: pulumi.Input<string>;
adminStateUp?: pulumi.Input<boolean>;
/**
* Human-readable description for the L7 Policy.
*/
description?: pulumi.Input<string>;
/**
* Specifies the ID of the listener for which the forwarding policy is added.
* Changing this creates a new L7 Policy.
*/
listenerId?: pulumi.Input<string>;
/**
* Human-readable name for the L7 Policy. Does not have to be unique.
*/
name?: pulumi.Input<string>;
/**
* The position of this policy on the listener. Positions start at 1.
* Changing this creates a new L7 Policy.
*/
position?: pulumi.Input<number>;
/**
* Specifies the ID of the listener to which the traffic is redirected.
* This parameter is mandatory when `action` is set to **REDIRECT_TO_LISTENER**. The listener must meet the
* following requirements:
* + Can only be an HTTPS listener.
* + Can only be a listener of the same load balancer.
*/
redirectListenerId?: pulumi.Input<string>;
/**
* Specifies the ID of the backend server group to which traffic is forwarded.
* This parameter is mandatory when `action` is set to **REDIRECT_TO_POOL**. The backend server group must meet the
* following requirements:
* + Cannot be the default backend server group of the listener.
* + Cannot be the backend server group used by forwarding policies of other listeners.
*/
redirectPoolId?: pulumi.Input<string>;
/**
* The region in which to create the L7 Policy resource. If omitted, the
* provider-level region will be used. Changing this creates a new L7 Policy.
*/
region?: pulumi.Input<string>;
/**
* @deprecated tenant_id is deprecated
*/
tenantId?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a L7policy resource.
*/
export interface L7policyArgs {
/**
* Specifies whether requests are forwarded to another backend server group
* or redirected to an HTTPS listener. Changing this creates a new L7 Policy. The value ranges:
* + **REDIRECT_TO_POOL**: Requests are forwarded to the backend server group specified by `redirectPoolId`.
* + **REDIRECT_TO_LISTENER**: Requests are redirected from the HTTP listener specified by `listenerId` to the
* HTTPS listener specified by `redirectListenerId`.
*/
action: pulumi.Input<string>;
adminStateUp?: pulumi.Input<boolean>;
/**
* Human-readable description for the L7 Policy.
*/
description?: pulumi.Input<string>;
/**
* Specifies the ID of the listener for which the forwarding policy is added.
* Changing this creates a new L7 Policy.
*/
listenerId: pulumi.Input<string>;
/**
* Human-readable name for the L7 Policy. Does not have to be unique.
*/
name?: pulumi.Input<string>;
/**
* The position of this policy on the listener. Positions start at 1.
* Changing this creates a new L7 Policy.
*/
position?: pulumi.Input<number>;
/**
* Specifies the ID of the listener to which the traffic is redirected.
* This parameter is mandatory when `action` is set to **REDIRECT_TO_LISTENER**. The listener must meet the
* following requirements:
* + Can only be an HTTPS listener.
* + Can only be a listener of the same load balancer.
*/
redirectListenerId?: pulumi.Input<string>;
/**
* Specifies the ID of the backend server group to which traffic is forwarded.
* This parameter is mandatory when `action` is set to **REDIRECT_TO_POOL**. The backend server group must meet the
* following requirements:
* + Cannot be the default backend server group of the listener.
* + Cannot be the backend server group used by forwarding policies of other listeners.
*/
redirectPoolId?: pulumi.Input<string>;
/**
* The region in which to create the L7 Policy resource. If omitted, the
* provider-level region will be used. Changing this creates a new L7 Policy.
*/
region?: pulumi.Input<string>;
/**
* @deprecated tenant_id is deprecated
*/
tenantId?: pulumi.Input<string>;
}