UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

571 lines (570 loc) 23.1 kB
import * as pulumi from "@pulumi/pulumi"; import { input as inputs, output as outputs } from "../types"; /** * Manages a dedicated mode domain resource within HuaweiCloud. * * > **NOTE:** All WAF resources depend on WAF instances, and the WAF instances need to be purchased before they can be * used. The dedicated mode domain name resource can be used in Dedicated Mode. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pulumi from "@huaweicloudos/pulumi"; * * const config = new pulumi.Config(); * const certificatedId = config.requireObject("certificatedId"); * const vpcId = config.requireObject("vpcId"); * const enterpriseProjectId = config.requireObject("enterpriseProjectId"); * const test = new huaweicloud.waf.DedicatedDomain("test", { * domain: "www.example.com", * certificateId: certificatedId, * enterpriseProjectId: enterpriseProjectId, * protectStatus: 1, * websiteName: "websiteName", * description: "test description", * servers: [{ * clientProtocol: "HTTPS", * serverProtocol: "HTTP", * address: "192.168.1.100", * port: 8080, * type: "ipv4", * vpcId: vpcId, * }], * customPage: { * httpReturnCode: "404", * blockPageType: "application/json", * pageContent: `{ * "event_id": "${waf_event_id}", * "error_msg": "error message" * } * `, * }, * forwardHeaderMap: { * key1: `$time_local`, * key2: `$tenant_id`, * }, * connectionProtection: { * errorThreshold: 1000, * errorPercentage: 90, * initialDowntime: 200, * multiplierForConsecutiveBreakdowns: 5, * pendingUrlRequestThreshold: 7000, * duration: 10000, * status: true, * }, * timeoutSettings: { * connectionTimeout: 100, * readTimeout: 1000, * writeTimeout: 1000, * }, * trafficMark: { * ipTags: ["ip_tag"], * sessionTag: "session_tag", * userTag: "user_tag", * }, * }); * ``` * * ## Import * * There are two ways to import WAF dedicated domain state. * Using the `id`, e.g. bash * * ```sh * $ pulumi import huaweicloud:Waf/dedicatedDomain:DedicatedDomain test <id> * ``` * * * Using `id` and `enterprise_project_id`, separated by a slash, e.g. bash * * ```sh * $ pulumi import huaweicloud:Waf/dedicatedDomain:DedicatedDomain test <id>/<enterprise_project_id> * ``` */ export declare class DedicatedDomain extends pulumi.CustomResource { /** * Get an existing DedicatedDomain 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?: DedicatedDomainState, opts?: pulumi.CustomResourceOptions): DedicatedDomain; /** * Returns true if the given object is an instance of DedicatedDomain. 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 DedicatedDomain; /** * Whether a domain name is connected to WAF. Valid values are: */ readonly accessStatus: pulumi.Output<number>; /** * The alarm page of domain. Valid values are: */ readonly alarmPage: pulumi.Output<{ [key: string]: string; }>; /** * Specifies the certificate ID. This parameter is mandatory when `clientProtocol` * is set to **HTTPS**. */ readonly certificateId: pulumi.Output<string | undefined>; /** * The name of the certificate used by the domain name. */ readonly certificateName: pulumi.Output<string>; /** * Specifies the cipher suite of domain. The valid values are: **cipher_1**, **cipher_2**, * **cipher_3**, **cipher_4**, **cipher_5**, **cipher_6**, and **cipher_default**. */ readonly cipher: pulumi.Output<string>; /** * The compliance certifications of the domain, values are: */ readonly complianceCertification: pulumi.Output<{ [key: string]: boolean; }>; /** * Specifies the connection protection configuration to let WAF protect your * origin servers from being crashed when WAF detects a large number of `502`/`504` error codes or pending requests. * Only supports one protection configuration. * The connectionProtection structure is documented below. */ readonly connectionProtection: pulumi.Output<outputs.Waf.DedicatedDomainConnectionProtection>; /** * Specifies the custom page. Only supports one custom alarm page. * The customPage structure is documented below. */ readonly customPage: pulumi.Output<outputs.Waf.DedicatedDomainCustomPage | undefined>; /** * Specifies the description of the WAF dedicated domain. */ readonly description: pulumi.Output<string>; /** * Specifies the protected domain name or IP address (port allowed). For example, * `www.example.com` or `*.example.com` or `www.example.com:89`. Changing this creates a new domain. */ readonly domain: pulumi.Output<string>; /** * Specifies the enterprise project ID of WAF dedicated domain. * For enterprise users, if omitted, default enterprise project will be used. * Changing this parameter will create a new resource. */ readonly enterpriseProjectId: pulumi.Output<string | undefined>; /** * Specifies the field forwarding configuration. WAF inserts the added fields into * the header and forwards the header to the origin server. The key cannot be the same as the native Nginx field. * The options of value are as follows: * + **$time_local** * + **$request_id** * + **$connection_requests** * + **$tenant_id** * + **$project_id** * + **$remote_addr** * + **$remote_port** * + **$scheme** * + **$request_method** * + **$http_host** * + **$origin_uri** * + **$request_length** * + **$ssl_server_name** * + **$ssl_protocol** * + **$ssl_curves** * + **$ssl_session_reused** */ readonly forwardHeaderMap: pulumi.Output<{ [key: string]: string; }>; /** * Specifies whether to retain the policy when deleting a domain name. * Defaults to **true**. */ readonly keepPolicy: pulumi.Output<boolean | undefined>; /** * Specifies the status of the PCI 3DS compliance certification check. The options * include **true** and **false**. This parameter must be used together with `tls` and `cipher`. */ readonly pci3ds: pulumi.Output<boolean>; /** * Specifies the status of the PCI DSS compliance certification check. The options * include **true** and **false**. This parameter must be used together with `tls` and `cipher`. */ readonly pciDss: pulumi.Output<boolean>; /** * Specifies the policy ID associated with the domain. If not specified, a new policy * will be created automatically. */ readonly policyId: pulumi.Output<string>; /** * Specifies the protection status of domain, `0`: suspended, `1`: enabled. * Defaults to `0`. */ readonly protectStatus: pulumi.Output<number>; /** * The protocol type of the client. The options are `HTTP` and `HTTPS`. */ readonly protocol: pulumi.Output<string>; /** * Specifies whether a proxy is configured. Defaults to **false**. */ readonly proxy: pulumi.Output<boolean | undefined>; /** * Specifies the URL of the redirected page. The root domain name of the redirection * address must be the name of the currently protected domain (including a wildcard domain name). * The available **${http_host}** can be used to indicate the currently protected domain name and port. * For example: **${http_host}/error.html**. */ readonly redirectUrl: pulumi.Output<string | undefined>; /** * Specifies the region in which to create the dedicated mode domain resource. * If omitted, the provider-level region will be used. Changing this setting will push a new domain. */ readonly region: pulumi.Output<string>; /** * Specifies the server configuration list of the domain. * A maximum of `80` can be configured. The server structure is documented below. */ readonly servers: pulumi.Output<outputs.Waf.DedicatedDomainServer[]>; /** * Specifies the timeout setting. Only supports one timeout setting. * The timeoutSettings structure is documented below. */ readonly timeoutSettings: pulumi.Output<outputs.Waf.DedicatedDomainTimeoutSettings>; /** * Specifies the minimum required TLS version. The valid values are: **TLS v1.0**, * **TLS v1.1** and **TLS v1.2**. */ readonly tls: pulumi.Output<string>; /** * The traffic identifier of domain. Valid values are: */ readonly trafficIdentifier: pulumi.Output<{ [key: string]: string; }>; /** * Specifies the traffic identifier. WAF uses the configurations to identify the * malicious client IP address (proxy mode) in the header, session in the cookie, and user attribute in the parameter, * and then triggers the corresponding known attack source rules to block attack sources. * Only supports one traffic identifier. * The trafficMark structure is documented below. */ readonly trafficMark: pulumi.Output<outputs.Waf.DedicatedDomainTrafficMark>; /** * Specifies the website name. This website name must start with a letter and only * letters, digits, underscores (_), hyphens (-), colons (:) and periods (.) are allowed. The value contains `1` to `128` * characters. The website name must be unique within this account. */ readonly websiteName: pulumi.Output<string>; /** * Create a DedicatedDomain 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: DedicatedDomainArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering DedicatedDomain resources. */ export interface DedicatedDomainState { /** * Whether a domain name is connected to WAF. Valid values are: */ accessStatus?: pulumi.Input<number>; /** * The alarm page of domain. Valid values are: */ alarmPage?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * Specifies the certificate ID. This parameter is mandatory when `clientProtocol` * is set to **HTTPS**. */ certificateId?: pulumi.Input<string>; /** * The name of the certificate used by the domain name. */ certificateName?: pulumi.Input<string>; /** * Specifies the cipher suite of domain. The valid values are: **cipher_1**, **cipher_2**, * **cipher_3**, **cipher_4**, **cipher_5**, **cipher_6**, and **cipher_default**. */ cipher?: pulumi.Input<string>; /** * The compliance certifications of the domain, values are: */ complianceCertification?: pulumi.Input<{ [key: string]: pulumi.Input<boolean>; }>; /** * Specifies the connection protection configuration to let WAF protect your * origin servers from being crashed when WAF detects a large number of `502`/`504` error codes or pending requests. * Only supports one protection configuration. * The connectionProtection structure is documented below. */ connectionProtection?: pulumi.Input<inputs.Waf.DedicatedDomainConnectionProtection>; /** * Specifies the custom page. Only supports one custom alarm page. * The customPage structure is documented below. */ customPage?: pulumi.Input<inputs.Waf.DedicatedDomainCustomPage>; /** * Specifies the description of the WAF dedicated domain. */ description?: pulumi.Input<string>; /** * Specifies the protected domain name or IP address (port allowed). For example, * `www.example.com` or `*.example.com` or `www.example.com:89`. Changing this creates a new domain. */ domain?: pulumi.Input<string>; /** * Specifies the enterprise project ID of WAF dedicated domain. * For enterprise users, if omitted, default enterprise project will be used. * Changing this parameter will create a new resource. */ enterpriseProjectId?: pulumi.Input<string>; /** * Specifies the field forwarding configuration. WAF inserts the added fields into * the header and forwards the header to the origin server. The key cannot be the same as the native Nginx field. * The options of value are as follows: * + **$time_local** * + **$request_id** * + **$connection_requests** * + **$tenant_id** * + **$project_id** * + **$remote_addr** * + **$remote_port** * + **$scheme** * + **$request_method** * + **$http_host** * + **$origin_uri** * + **$request_length** * + **$ssl_server_name** * + **$ssl_protocol** * + **$ssl_curves** * + **$ssl_session_reused** */ forwardHeaderMap?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * Specifies whether to retain the policy when deleting a domain name. * Defaults to **true**. */ keepPolicy?: pulumi.Input<boolean>; /** * Specifies the status of the PCI 3DS compliance certification check. The options * include **true** and **false**. This parameter must be used together with `tls` and `cipher`. */ pci3ds?: pulumi.Input<boolean>; /** * Specifies the status of the PCI DSS compliance certification check. The options * include **true** and **false**. This parameter must be used together with `tls` and `cipher`. */ pciDss?: pulumi.Input<boolean>; /** * Specifies the policy ID associated with the domain. If not specified, a new policy * will be created automatically. */ policyId?: pulumi.Input<string>; /** * Specifies the protection status of domain, `0`: suspended, `1`: enabled. * Defaults to `0`. */ protectStatus?: pulumi.Input<number>; /** * The protocol type of the client. The options are `HTTP` and `HTTPS`. */ protocol?: pulumi.Input<string>; /** * Specifies whether a proxy is configured. Defaults to **false**. */ proxy?: pulumi.Input<boolean>; /** * Specifies the URL of the redirected page. The root domain name of the redirection * address must be the name of the currently protected domain (including a wildcard domain name). * The available **${http_host}** can be used to indicate the currently protected domain name and port. * For example: **${http_host}/error.html**. */ redirectUrl?: pulumi.Input<string>; /** * Specifies the region in which to create the dedicated mode domain resource. * If omitted, the provider-level region will be used. Changing this setting will push a new domain. */ region?: pulumi.Input<string>; /** * Specifies the server configuration list of the domain. * A maximum of `80` can be configured. The server structure is documented below. */ servers?: pulumi.Input<pulumi.Input<inputs.Waf.DedicatedDomainServer>[]>; /** * Specifies the timeout setting. Only supports one timeout setting. * The timeoutSettings structure is documented below. */ timeoutSettings?: pulumi.Input<inputs.Waf.DedicatedDomainTimeoutSettings>; /** * Specifies the minimum required TLS version. The valid values are: **TLS v1.0**, * **TLS v1.1** and **TLS v1.2**. */ tls?: pulumi.Input<string>; /** * The traffic identifier of domain. Valid values are: */ trafficIdentifier?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * Specifies the traffic identifier. WAF uses the configurations to identify the * malicious client IP address (proxy mode) in the header, session in the cookie, and user attribute in the parameter, * and then triggers the corresponding known attack source rules to block attack sources. * Only supports one traffic identifier. * The trafficMark structure is documented below. */ trafficMark?: pulumi.Input<inputs.Waf.DedicatedDomainTrafficMark>; /** * Specifies the website name. This website name must start with a letter and only * letters, digits, underscores (_), hyphens (-), colons (:) and periods (.) are allowed. The value contains `1` to `128` * characters. The website name must be unique within this account. */ websiteName?: pulumi.Input<string>; } /** * The set of arguments for constructing a DedicatedDomain resource. */ export interface DedicatedDomainArgs { /** * Specifies the certificate ID. This parameter is mandatory when `clientProtocol` * is set to **HTTPS**. */ certificateId?: pulumi.Input<string>; /** * Specifies the cipher suite of domain. The valid values are: **cipher_1**, **cipher_2**, * **cipher_3**, **cipher_4**, **cipher_5**, **cipher_6**, and **cipher_default**. */ cipher?: pulumi.Input<string>; /** * Specifies the connection protection configuration to let WAF protect your * origin servers from being crashed when WAF detects a large number of `502`/`504` error codes or pending requests. * Only supports one protection configuration. * The connectionProtection structure is documented below. */ connectionProtection?: pulumi.Input<inputs.Waf.DedicatedDomainConnectionProtection>; /** * Specifies the custom page. Only supports one custom alarm page. * The customPage structure is documented below. */ customPage?: pulumi.Input<inputs.Waf.DedicatedDomainCustomPage>; /** * Specifies the description of the WAF dedicated domain. */ description?: pulumi.Input<string>; /** * Specifies the protected domain name or IP address (port allowed). For example, * `www.example.com` or `*.example.com` or `www.example.com:89`. Changing this creates a new domain. */ domain: pulumi.Input<string>; /** * Specifies the enterprise project ID of WAF dedicated domain. * For enterprise users, if omitted, default enterprise project will be used. * Changing this parameter will create a new resource. */ enterpriseProjectId?: pulumi.Input<string>; /** * Specifies the field forwarding configuration. WAF inserts the added fields into * the header and forwards the header to the origin server. The key cannot be the same as the native Nginx field. * The options of value are as follows: * + **$time_local** * + **$request_id** * + **$connection_requests** * + **$tenant_id** * + **$project_id** * + **$remote_addr** * + **$remote_port** * + **$scheme** * + **$request_method** * + **$http_host** * + **$origin_uri** * + **$request_length** * + **$ssl_server_name** * + **$ssl_protocol** * + **$ssl_curves** * + **$ssl_session_reused** */ forwardHeaderMap?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * Specifies whether to retain the policy when deleting a domain name. * Defaults to **true**. */ keepPolicy?: pulumi.Input<boolean>; /** * Specifies the status of the PCI 3DS compliance certification check. The options * include **true** and **false**. This parameter must be used together with `tls` and `cipher`. */ pci3ds?: pulumi.Input<boolean>; /** * Specifies the status of the PCI DSS compliance certification check. The options * include **true** and **false**. This parameter must be used together with `tls` and `cipher`. */ pciDss?: pulumi.Input<boolean>; /** * Specifies the policy ID associated with the domain. If not specified, a new policy * will be created automatically. */ policyId?: pulumi.Input<string>; /** * Specifies the protection status of domain, `0`: suspended, `1`: enabled. * Defaults to `0`. */ protectStatus?: pulumi.Input<number>; /** * Specifies whether a proxy is configured. Defaults to **false**. */ proxy?: pulumi.Input<boolean>; /** * Specifies the URL of the redirected page. The root domain name of the redirection * address must be the name of the currently protected domain (including a wildcard domain name). * The available **${http_host}** can be used to indicate the currently protected domain name and port. * For example: **${http_host}/error.html**. */ redirectUrl?: pulumi.Input<string>; /** * Specifies the region in which to create the dedicated mode domain resource. * If omitted, the provider-level region will be used. Changing this setting will push a new domain. */ region?: pulumi.Input<string>; /** * Specifies the server configuration list of the domain. * A maximum of `80` can be configured. The server structure is documented below. */ servers: pulumi.Input<pulumi.Input<inputs.Waf.DedicatedDomainServer>[]>; /** * Specifies the timeout setting. Only supports one timeout setting. * The timeoutSettings structure is documented below. */ timeoutSettings?: pulumi.Input<inputs.Waf.DedicatedDomainTimeoutSettings>; /** * Specifies the minimum required TLS version. The valid values are: **TLS v1.0**, * **TLS v1.1** and **TLS v1.2**. */ tls?: pulumi.Input<string>; /** * Specifies the traffic identifier. WAF uses the configurations to identify the * malicious client IP address (proxy mode) in the header, session in the cookie, and user attribute in the parameter, * and then triggers the corresponding known attack source rules to block attack sources. * Only supports one traffic identifier. * The trafficMark structure is documented below. */ trafficMark?: pulumi.Input<inputs.Waf.DedicatedDomainTrafficMark>; /** * Specifies the website name. This website name must start with a letter and only * letters, digits, underscores (_), hyphens (-), colons (:) and periods (.) are allowed. The value contains `1` to `128` * characters. The website name must be unique within this account. */ websiteName?: pulumi.Input<string>; }