UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

103 lines 4.47 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.SecurityPolicy = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages an ELB security policy resource within HuaweiCloud. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as huaweicloud from "@pulumi/huaweicloud"; * * const test = new huaweicloud.DedicatedElb.SecurityPolicy("test", { * ciphers: [ * "ECDHE-RSA-AES256-GCM-SHA384", * "ECDHE-RSA-AES128-GCM-SHA256", * ], * description: "this is a security policy", * protocols: [ * "TLSv1", * "TLSv1.1", * "TLSv1.2", * "TLSv1.3", * ], * }); * ``` * * ## Import * * The elb security policies can be imported using the `id`, e.g. bash * * ```sh * $ pulumi import huaweicloud:DedicatedElb/securityPolicy:SecurityPolicy test 0ce123456a00f2591fabc00385ff1234 * ``` */ class SecurityPolicy extends pulumi.CustomResource { /** * Get an existing SecurityPolicy 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 SecurityPolicy(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of SecurityPolicy. 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'] === SecurityPolicy.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["ciphers"] = state ? state.ciphers : undefined; resourceInputs["createdAt"] = state ? state.createdAt : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["enterpriseProjectId"] = state ? state.enterpriseProjectId : undefined; resourceInputs["listeners"] = state ? state.listeners : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["protocols"] = state ? state.protocols : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["updatedAt"] = state ? state.updatedAt : undefined; } else { const args = argsOrState; if ((!args || args.ciphers === undefined) && !opts.urn) { throw new Error("Missing required property 'ciphers'"); } if ((!args || args.protocols === undefined) && !opts.urn) { throw new Error("Missing required property 'protocols'"); } resourceInputs["ciphers"] = args ? args.ciphers : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["enterpriseProjectId"] = args ? args.enterpriseProjectId : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["protocols"] = args ? args.protocols : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["createdAt"] = undefined /*out*/; resourceInputs["listeners"] = undefined /*out*/; resourceInputs["updatedAt"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(SecurityPolicy.__pulumiType, name, resourceInputs, opts); } } exports.SecurityPolicy = SecurityPolicy; /** @internal */ SecurityPolicy.__pulumiType = 'huaweicloud:DedicatedElb/securityPolicy:SecurityPolicy'; //# sourceMappingURL=securityPolicy.js.map