@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
93 lines • 3.91 kB
JavaScript
// *** 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 API Gateway API Key.
*
* > **NOTE:** Since the API Gateway usage plans feature was launched on August 11, 2016, usage plans are now **required** to associate an API key with an API stage.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.apigateway.ApiKey("example", {name: "example"});
* ```
*
* ## Import
*
* Using `pulumi import`, import API Gateway Keys using the `id`. For example:
*
* ```sh
* $ pulumi import aws:apigateway/apiKey:ApiKey example 8bklk8bl1k3sB38D9B3l0enyWT8c09B30lkq0blk
* ```
*/
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["arn"] = state?.arn;
resourceInputs["createdDate"] = state?.createdDate;
resourceInputs["customerId"] = state?.customerId;
resourceInputs["description"] = state?.description;
resourceInputs["enabled"] = state?.enabled;
resourceInputs["lastUpdatedDate"] = state?.lastUpdatedDate;
resourceInputs["name"] = state?.name;
resourceInputs["region"] = state?.region;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
resourceInputs["value"] = state?.value;
}
else {
const args = argsOrState;
resourceInputs["customerId"] = args?.customerId;
resourceInputs["description"] = (args?.description) ?? "Managed by Pulumi";
resourceInputs["enabled"] = args?.enabled;
resourceInputs["name"] = args?.name;
resourceInputs["region"] = args?.region;
resourceInputs["tags"] = args?.tags;
resourceInputs["value"] = args?.value ? pulumi.secret(args.value) : undefined;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["createdDate"] = undefined /*out*/;
resourceInputs["lastUpdatedDate"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["value"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(ApiKey.__pulumiType, name, resourceInputs, opts);
}
}
exports.ApiKey = ApiKey;
/** @internal */
ApiKey.__pulumiType = 'aws:apigateway/apiKey:ApiKey';
//# sourceMappingURL=apiKey.js.map
;