UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

187 lines 9.04 kB
"use strict"; // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.DedicatedDomain = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * 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> * ``` */ 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, id, state, opts) { return new DedicatedDomain(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * 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) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === DedicatedDomain.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["accessStatus"] = state ? state.accessStatus : undefined; resourceInputs["alarmPage"] = state ? state.alarmPage : undefined; resourceInputs["certificateId"] = state ? state.certificateId : undefined; resourceInputs["certificateName"] = state ? state.certificateName : undefined; resourceInputs["cipher"] = state ? state.cipher : undefined; resourceInputs["complianceCertification"] = state ? state.complianceCertification : undefined; resourceInputs["connectionProtection"] = state ? state.connectionProtection : undefined; resourceInputs["customPage"] = state ? state.customPage : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["domain"] = state ? state.domain : undefined; resourceInputs["enterpriseProjectId"] = state ? state.enterpriseProjectId : undefined; resourceInputs["forwardHeaderMap"] = state ? state.forwardHeaderMap : undefined; resourceInputs["keepPolicy"] = state ? state.keepPolicy : undefined; resourceInputs["pci3ds"] = state ? state.pci3ds : undefined; resourceInputs["pciDss"] = state ? state.pciDss : undefined; resourceInputs["policyId"] = state ? state.policyId : undefined; resourceInputs["protectStatus"] = state ? state.protectStatus : undefined; resourceInputs["protocol"] = state ? state.protocol : undefined; resourceInputs["proxy"] = state ? state.proxy : undefined; resourceInputs["redirectUrl"] = state ? state.redirectUrl : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["servers"] = state ? state.servers : undefined; resourceInputs["timeoutSettings"] = state ? state.timeoutSettings : undefined; resourceInputs["tls"] = state ? state.tls : undefined; resourceInputs["trafficIdentifier"] = state ? state.trafficIdentifier : undefined; resourceInputs["trafficMark"] = state ? state.trafficMark : undefined; resourceInputs["websiteName"] = state ? state.websiteName : undefined; } else { const args = argsOrState; if ((!args || args.domain === undefined) && !opts.urn) { throw new Error("Missing required property 'domain'"); } if ((!args || args.servers === undefined) && !opts.urn) { throw new Error("Missing required property 'servers'"); } resourceInputs["certificateId"] = args ? args.certificateId : undefined; resourceInputs["cipher"] = args ? args.cipher : undefined; resourceInputs["connectionProtection"] = args ? args.connectionProtection : undefined; resourceInputs["customPage"] = args ? args.customPage : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["domain"] = args ? args.domain : undefined; resourceInputs["enterpriseProjectId"] = args ? args.enterpriseProjectId : undefined; resourceInputs["forwardHeaderMap"] = args ? args.forwardHeaderMap : undefined; resourceInputs["keepPolicy"] = args ? args.keepPolicy : undefined; resourceInputs["pci3ds"] = args ? args.pci3ds : undefined; resourceInputs["pciDss"] = args ? args.pciDss : undefined; resourceInputs["policyId"] = args ? args.policyId : undefined; resourceInputs["protectStatus"] = args ? args.protectStatus : undefined; resourceInputs["proxy"] = args ? args.proxy : undefined; resourceInputs["redirectUrl"] = args ? args.redirectUrl : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["servers"] = args ? args.servers : undefined; resourceInputs["timeoutSettings"] = args ? args.timeoutSettings : undefined; resourceInputs["tls"] = args ? args.tls : undefined; resourceInputs["trafficMark"] = args ? args.trafficMark : undefined; resourceInputs["websiteName"] = args ? args.websiteName : undefined; resourceInputs["accessStatus"] = undefined /*out*/; resourceInputs["alarmPage"] = undefined /*out*/; resourceInputs["certificateName"] = undefined /*out*/; resourceInputs["complianceCertification"] = undefined /*out*/; resourceInputs["protocol"] = undefined /*out*/; resourceInputs["trafficIdentifier"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(DedicatedDomain.__pulumiType, name, resourceInputs, opts); } } exports.DedicatedDomain = DedicatedDomain; /** @internal */ DedicatedDomain.__pulumiType = 'huaweicloud:Waf/dedicatedDomain:DedicatedDomain'; //# sourceMappingURL=dedicatedDomain.js.map