UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

86 lines 3.23 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.ApiKey = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides an AWS WAFv2 API Key resource. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.wafv2.ApiKey("example", { * scope: "REGIONAL", * tokenDomains: ["example.com"], * }); * ``` * * ## Import * * Using `pulumi import`, import WAFv2 API Key using `api_key,scope`. For example: * * ```sh * $ pulumi import aws:wafv2/apiKey:ApiKey example a1b2c3d4-5678-90ab-cdef-EXAMPLE11111,REGIONAL * ``` */ class ApiKey extends pulumi.CustomResource { /** * Get an existing ApiKey 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 ApiKey(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of ApiKey. 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'] === ApiKey.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["apiKey"] = state?.apiKey; resourceInputs["region"] = state?.region; resourceInputs["scope"] = state?.scope; resourceInputs["tokenDomains"] = state?.tokenDomains; } else { const args = argsOrState; if (args?.scope === undefined && !opts.urn) { throw new Error("Missing required property 'scope'"); } if (args?.tokenDomains === undefined && !opts.urn) { throw new Error("Missing required property 'tokenDomains'"); } resourceInputs["region"] = args?.region; resourceInputs["scope"] = args?.scope; resourceInputs["tokenDomains"] = args?.tokenDomains; resourceInputs["apiKey"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["apiKey"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(ApiKey.__pulumiType, name, resourceInputs, opts); } } exports.ApiKey = ApiKey; /** @internal */ ApiKey.__pulumiType = 'aws:wafv2/apiKey:ApiKey'; //# sourceMappingURL=apiKey.js.map