UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

113 lines 5.42 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.CustomAuthorizer = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages an APIG custom authorizer resource within HuaweiCloud. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pulumi from "@huaweicloudos/pulumi"; * * const config = new pulumi.Config(); * const instanceId = config.requireObject("instanceId"); * const authorizerName = config.requireObject("authorizerName"); * const functionUrn = config.requireObject("functionUrn"); * const test = new huaweicloud.dedicatedapig.CustomAuthorizer("test", { * instanceId: instanceId, * functionUrn: functionUrn, * functionVersion: "latest", * type: "FRONTEND", * cacheAge: 60, * identities: [{ * name: "user_name", * location: "QUERY", * }], * }); * ``` * * ## Import * * Custom Authorizers of the APIG can be imported using their `name` and related dedicated instance IDs, separated by a slash, e.g. * * ```sh * $ pulumi import huaweicloud:DedicatedApig/customAuthorizer:CustomAuthorizer test <instance_id>/<name> * ``` */ class CustomAuthorizer extends pulumi.CustomResource { /** * Get an existing CustomAuthorizer 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 CustomAuthorizer(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of CustomAuthorizer. 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'] === CustomAuthorizer.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["cacheAge"] = state ? state.cacheAge : undefined; resourceInputs["createdAt"] = state ? state.createdAt : undefined; resourceInputs["functionAliasUri"] = state ? state.functionAliasUri : undefined; resourceInputs["functionUrn"] = state ? state.functionUrn : undefined; resourceInputs["functionVersion"] = state ? state.functionVersion : undefined; resourceInputs["identities"] = state ? state.identities : undefined; resourceInputs["instanceId"] = state ? state.instanceId : undefined; resourceInputs["isBodySend"] = state ? state.isBodySend : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["networkType"] = state ? state.networkType : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["type"] = state ? state.type : undefined; resourceInputs["userData"] = state ? state.userData : undefined; } else { const args = argsOrState; if ((!args || args.functionUrn === undefined) && !opts.urn) { throw new Error("Missing required property 'functionUrn'"); } if ((!args || args.instanceId === undefined) && !opts.urn) { throw new Error("Missing required property 'instanceId'"); } resourceInputs["cacheAge"] = args ? args.cacheAge : undefined; resourceInputs["functionAliasUri"] = args ? args.functionAliasUri : undefined; resourceInputs["functionUrn"] = args ? args.functionUrn : undefined; resourceInputs["functionVersion"] = args ? args.functionVersion : undefined; resourceInputs["identities"] = args ? args.identities : undefined; resourceInputs["instanceId"] = args ? args.instanceId : undefined; resourceInputs["isBodySend"] = args ? args.isBodySend : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["networkType"] = args ? args.networkType : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["type"] = args ? args.type : undefined; resourceInputs["userData"] = args ? args.userData : undefined; resourceInputs["createdAt"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(CustomAuthorizer.__pulumiType, name, resourceInputs, opts); } } exports.CustomAuthorizer = CustomAuthorizer; /** @internal */ CustomAuthorizer.__pulumiType = 'huaweicloud:DedicatedApig/customAuthorizer:CustomAuthorizer'; //# sourceMappingURL=customAuthorizer.js.map