@volcengine/pulumi
Version:
A Pulumi package for creating and managing volcengine cloud resources.
425 lines (424 loc) • 16.2 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
/**
* Provides a resource to manage alb listener
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as volcengine from "@pulumi/volcengine";
* import * as volcengine from "@volcengine/pulumi";
*
* const fooZones = volcengine.ecs.getZones({});
* const fooVpc = new volcengine.vpc.Vpc("fooVpc", {
* vpcName: "acc-test-vpc",
* cidrBlock: "172.16.0.0/16",
* });
* const fooSubnet = new volcengine.vpc.Subnet("fooSubnet", {
* subnetName: "acc-test-subnet",
* cidrBlock: "172.16.0.0/24",
* zoneId: fooZones.then(fooZones => fooZones.zones?.[0]?.id),
* vpcId: fooVpc.id,
* });
* const fooAlb = new volcengine.alb.Alb("fooAlb", {
* addressIpVersion: "IPv4",
* type: "private",
* loadBalancerName: "acc-test-alb-private",
* description: "acc-test",
* subnetIds: [fooSubnet.id],
* projectName: "default",
* deleteProtection: "off",
* tags: [{
* key: "k1",
* value: "v1",
* }],
* });
* const fooServerGroup = new volcengine.alb.ServerGroup("fooServerGroup", {
* vpcId: fooVpc.id,
* serverGroupName: "acc-test-server-group",
* description: "acc-test",
* serverGroupType: "instance",
* scheduler: "wlc",
* projectName: "default",
* healthCheck: {
* enabled: "on",
* interval: 3,
* timeout: 3,
* method: "GET",
* },
* stickySessionConfig: {
* stickySessionEnabled: "on",
* stickySessionType: "insert",
* cookieTimeout: 1100,
* },
* });
* const fooCertificate = new volcengine.alb.Certificate("fooCertificate", {
* description: "tf-test",
* publicKey: "public key",
* privateKey: "private key",
* });
* const fooListener = new volcengine.alb.Listener("fooListener", {
* loadBalancerId: fooAlb.id,
* listenerName: "acc-test-listener",
* protocol: "HTTPS",
* port: 6666,
* enabled: "off",
* certificateSource: "alb",
* certificateId: fooCertificate.id,
* serverGroupId: fooServerGroup.id,
* description: "acc test listener",
* accessLogRecordCustomizedHeadersEnabled: "off",
* caCertificateSource: "alb",
* caCertificateId: "cert-xoekc6lpu9s054ov5eo*****",
* domainExtensions: [{
* domain: "example.com",
* certificateSource: "alb",
* certificateId: "cert-1pf4a8k8tokcg845wf******",
* }],
* tags: [{
* key: "key1",
* value: "value2",
* }],
* });
* ```
*
* ## Import
*
* AlbListener can be imported using the id, e.g.
*
* ```sh
* $ pulumi import volcengine:alb/listener:Listener default lsn-273yv0mhs5xj47fap8sehiiso
* ```
*/
export declare class Listener extends pulumi.CustomResource {
/**
* Get an existing Listener 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?: ListenerState, opts?: pulumi.CustomResourceOptions): Listener;
/**
* Returns true if the given object is an instance of Listener. 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 Listener;
/**
* Whether to enable custom headers in access logs. Default is `off`.
*/
readonly accessLogRecordCustomizedHeadersEnabled: pulumi.Output<string | undefined>;
/**
* The id list of the Acl. When the AclStatus parameter is configured as on, AclType and AclIds.N are required.
*/
readonly aclIds: pulumi.Output<string[] | undefined>;
/**
* The enable status of Acl. Optional choice contains `on`, `off`. Default is `off`.
*/
readonly aclStatus: pulumi.Output<string | undefined>;
/**
* The type of the Acl. Optional choice contains `white`, `black`. When the AclStatus parameter is configured as on, AclType and AclIds.N are required.
*/
readonly aclType: pulumi.Output<string>;
/**
* The CA certificate id associated with the listener. When the value of caCertificateSource is alb, the caCertificateId parameter must be specified.
*/
readonly caCertificateId: pulumi.Output<string | undefined>;
/**
* The source of the CA certificate associated with the listener. This parameter is only valid for HTTPS listeners and is used for two-way authentication. Valid values: `alb`, `pcaRoot`, `pcaSub`.
*/
readonly caCertificateSource: pulumi.Output<string | undefined>;
/**
* The certificate id associated with the listener. Source is `certCenter`.
*/
readonly certCenterCertificateId: pulumi.Output<string | undefined>;
/**
* The certificate id associated with the listener. Source is `alb`.
*/
readonly certificateId: pulumi.Output<string | undefined>;
/**
* The source of the certificate. Valid values: `alb`, `certCenter`. Default is `alb`.
*/
readonly certificateSource: pulumi.Output<string | undefined>;
/**
* Personalized configuration ID, with a value of " " when not bound.
*/
readonly customizedCfgId: pulumi.Output<string | undefined>;
/**
* The description of the Listener.
*/
readonly description: pulumi.Output<string | undefined>;
/**
* The domain extensions of the Listener. Only HTTPS listener is effective.
*/
readonly domainExtensions: pulumi.Output<outputs.alb.ListenerDomainExtension[] | undefined>;
/**
* The HTTP2 feature switch,valid value is on or off. Default is `off`.
*/
readonly enableHttp2: pulumi.Output<string | undefined>;
/**
* The QUIC feature switch,valid value is on or off. Default is `off`.
*/
readonly enableQuic: pulumi.Output<string | undefined>;
/**
* The enable status of the Listener. Optional choice contains `on`, `off`. Default is `on`.
*/
readonly enabled: pulumi.Output<string | undefined>;
/**
* The ID of the Listener.
*/
readonly listenerId: pulumi.Output<string>;
/**
* The name of the Listener.
*/
readonly listenerName: pulumi.Output<string>;
/**
* The Id of the load balancer.
*/
readonly loadBalancerId: pulumi.Output<string>;
/**
* The CA certificate id associated with the listener. When the value of caCertificateSource is pca_leaf, pcaLeafCertificateId parameter must be specified.
*/
readonly pcaLeafCertificateId: pulumi.Output<string | undefined>;
/**
* The CA certificate id associated with the listener. When the value of caCertificateSource is pca_root, pcaRootCaCertificateId parameter must be specified.
*/
readonly pcaRootCaCertificateId: pulumi.Output<string | undefined>;
/**
* The CA certificate id associated with the listener. When the value of caCertificateSource is pca_sub, pcaSubCaCertificateId parameter must be specified.
*/
readonly pcaSubCaCertificateId: pulumi.Output<string | undefined>;
/**
* The port receiving request of the Listener, the value range in 1~65535.
*/
readonly port: pulumi.Output<number>;
/**
* The protocol of the Listener. Optional choice contains `HTTP`, `HTTPS`.
*/
readonly protocol: pulumi.Output<string>;
/**
* The server group id associated with the listener.
*/
readonly serverGroupId: pulumi.Output<string>;
/**
* Tags.
*/
readonly tags: pulumi.Output<outputs.alb.ListenerTag[] | undefined>;
/**
* Create a Listener 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: ListenerArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering Listener resources.
*/
export interface ListenerState {
/**
* Whether to enable custom headers in access logs. Default is `off`.
*/
accessLogRecordCustomizedHeadersEnabled?: pulumi.Input<string>;
/**
* The id list of the Acl. When the AclStatus parameter is configured as on, AclType and AclIds.N are required.
*/
aclIds?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The enable status of Acl. Optional choice contains `on`, `off`. Default is `off`.
*/
aclStatus?: pulumi.Input<string>;
/**
* The type of the Acl. Optional choice contains `white`, `black`. When the AclStatus parameter is configured as on, AclType and AclIds.N are required.
*/
aclType?: pulumi.Input<string>;
/**
* The CA certificate id associated with the listener. When the value of caCertificateSource is alb, the caCertificateId parameter must be specified.
*/
caCertificateId?: pulumi.Input<string>;
/**
* The source of the CA certificate associated with the listener. This parameter is only valid for HTTPS listeners and is used for two-way authentication. Valid values: `alb`, `pcaRoot`, `pcaSub`.
*/
caCertificateSource?: pulumi.Input<string>;
/**
* The certificate id associated with the listener. Source is `certCenter`.
*/
certCenterCertificateId?: pulumi.Input<string>;
/**
* The certificate id associated with the listener. Source is `alb`.
*/
certificateId?: pulumi.Input<string>;
/**
* The source of the certificate. Valid values: `alb`, `certCenter`. Default is `alb`.
*/
certificateSource?: pulumi.Input<string>;
/**
* Personalized configuration ID, with a value of " " when not bound.
*/
customizedCfgId?: pulumi.Input<string>;
/**
* The description of the Listener.
*/
description?: pulumi.Input<string>;
/**
* The domain extensions of the Listener. Only HTTPS listener is effective.
*/
domainExtensions?: pulumi.Input<pulumi.Input<inputs.alb.ListenerDomainExtension>[]>;
/**
* The HTTP2 feature switch,valid value is on or off. Default is `off`.
*/
enableHttp2?: pulumi.Input<string>;
/**
* The QUIC feature switch,valid value is on or off. Default is `off`.
*/
enableQuic?: pulumi.Input<string>;
/**
* The enable status of the Listener. Optional choice contains `on`, `off`. Default is `on`.
*/
enabled?: pulumi.Input<string>;
/**
* The ID of the Listener.
*/
listenerId?: pulumi.Input<string>;
/**
* The name of the Listener.
*/
listenerName?: pulumi.Input<string>;
/**
* The Id of the load balancer.
*/
loadBalancerId?: pulumi.Input<string>;
/**
* The CA certificate id associated with the listener. When the value of caCertificateSource is pca_leaf, pcaLeafCertificateId parameter must be specified.
*/
pcaLeafCertificateId?: pulumi.Input<string>;
/**
* The CA certificate id associated with the listener. When the value of caCertificateSource is pca_root, pcaRootCaCertificateId parameter must be specified.
*/
pcaRootCaCertificateId?: pulumi.Input<string>;
/**
* The CA certificate id associated with the listener. When the value of caCertificateSource is pca_sub, pcaSubCaCertificateId parameter must be specified.
*/
pcaSubCaCertificateId?: pulumi.Input<string>;
/**
* The port receiving request of the Listener, the value range in 1~65535.
*/
port?: pulumi.Input<number>;
/**
* The protocol of the Listener. Optional choice contains `HTTP`, `HTTPS`.
*/
protocol?: pulumi.Input<string>;
/**
* The server group id associated with the listener.
*/
serverGroupId?: pulumi.Input<string>;
/**
* Tags.
*/
tags?: pulumi.Input<pulumi.Input<inputs.alb.ListenerTag>[]>;
}
/**
* The set of arguments for constructing a Listener resource.
*/
export interface ListenerArgs {
/**
* Whether to enable custom headers in access logs. Default is `off`.
*/
accessLogRecordCustomizedHeadersEnabled?: pulumi.Input<string>;
/**
* The id list of the Acl. When the AclStatus parameter is configured as on, AclType and AclIds.N are required.
*/
aclIds?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The enable status of Acl. Optional choice contains `on`, `off`. Default is `off`.
*/
aclStatus?: pulumi.Input<string>;
/**
* The type of the Acl. Optional choice contains `white`, `black`. When the AclStatus parameter is configured as on, AclType and AclIds.N are required.
*/
aclType?: pulumi.Input<string>;
/**
* The CA certificate id associated with the listener. When the value of caCertificateSource is alb, the caCertificateId parameter must be specified.
*/
caCertificateId?: pulumi.Input<string>;
/**
* The source of the CA certificate associated with the listener. This parameter is only valid for HTTPS listeners and is used for two-way authentication. Valid values: `alb`, `pcaRoot`, `pcaSub`.
*/
caCertificateSource?: pulumi.Input<string>;
/**
* The certificate id associated with the listener. Source is `certCenter`.
*/
certCenterCertificateId?: pulumi.Input<string>;
/**
* The certificate id associated with the listener. Source is `alb`.
*/
certificateId?: pulumi.Input<string>;
/**
* The source of the certificate. Valid values: `alb`, `certCenter`. Default is `alb`.
*/
certificateSource?: pulumi.Input<string>;
/**
* Personalized configuration ID, with a value of " " when not bound.
*/
customizedCfgId?: pulumi.Input<string>;
/**
* The description of the Listener.
*/
description?: pulumi.Input<string>;
/**
* The domain extensions of the Listener. Only HTTPS listener is effective.
*/
domainExtensions?: pulumi.Input<pulumi.Input<inputs.alb.ListenerDomainExtension>[]>;
/**
* The HTTP2 feature switch,valid value is on or off. Default is `off`.
*/
enableHttp2?: pulumi.Input<string>;
/**
* The QUIC feature switch,valid value is on or off. Default is `off`.
*/
enableQuic?: pulumi.Input<string>;
/**
* The enable status of the Listener. Optional choice contains `on`, `off`. Default is `on`.
*/
enabled?: pulumi.Input<string>;
/**
* The name of the Listener.
*/
listenerName?: pulumi.Input<string>;
/**
* The Id of the load balancer.
*/
loadBalancerId: pulumi.Input<string>;
/**
* The CA certificate id associated with the listener. When the value of caCertificateSource is pca_leaf, pcaLeafCertificateId parameter must be specified.
*/
pcaLeafCertificateId?: pulumi.Input<string>;
/**
* The CA certificate id associated with the listener. When the value of caCertificateSource is pca_root, pcaRootCaCertificateId parameter must be specified.
*/
pcaRootCaCertificateId?: pulumi.Input<string>;
/**
* The CA certificate id associated with the listener. When the value of caCertificateSource is pca_sub, pcaSubCaCertificateId parameter must be specified.
*/
pcaSubCaCertificateId?: pulumi.Input<string>;
/**
* The port receiving request of the Listener, the value range in 1~65535.
*/
port: pulumi.Input<number>;
/**
* The protocol of the Listener. Optional choice contains `HTTP`, `HTTPS`.
*/
protocol: pulumi.Input<string>;
/**
* The server group id associated with the listener.
*/
serverGroupId: pulumi.Input<string>;
/**
* Tags.
*/
tags?: pulumi.Input<pulumi.Input<inputs.alb.ListenerTag>[]>;
}