UNPKG

@pulumi/aws

Version:

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

100 lines 5.25 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.ExternalKey = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages a single-Region or multi-Region primary KMS key that uses external key material. * To instead manage a single-Region or multi-Region primary KMS key where AWS automatically generates and potentially rotates key material, see the `aws.kms.Key` resource. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.kms.ExternalKey("example", {description: "KMS EXTERNAL for AMI encryption"}); * ``` * * ## Import * * Using `pulumi import`, import KMS External Keys using the `id`. For example: * * ```sh * $ pulumi import aws:kms/externalKey:ExternalKey a arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab * ``` */ class ExternalKey extends pulumi.CustomResource { /** * Get an existing ExternalKey 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 ExternalKey(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of ExternalKey. 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'] === ExternalKey.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["arn"] = state ? state.arn : undefined; resourceInputs["bypassPolicyLockoutSafetyCheck"] = state ? state.bypassPolicyLockoutSafetyCheck : undefined; resourceInputs["deletionWindowInDays"] = state ? state.deletionWindowInDays : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["enabled"] = state ? state.enabled : undefined; resourceInputs["expirationModel"] = state ? state.expirationModel : undefined; resourceInputs["keyMaterialBase64"] = state ? state.keyMaterialBase64 : undefined; resourceInputs["keyState"] = state ? state.keyState : undefined; resourceInputs["keyUsage"] = state ? state.keyUsage : undefined; resourceInputs["multiRegion"] = state ? state.multiRegion : undefined; resourceInputs["policy"] = state ? state.policy : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["tagsAll"] = state ? state.tagsAll : undefined; resourceInputs["validTo"] = state ? state.validTo : undefined; } else { const args = argsOrState; resourceInputs["bypassPolicyLockoutSafetyCheck"] = args ? args.bypassPolicyLockoutSafetyCheck : undefined; resourceInputs["deletionWindowInDays"] = args ? args.deletionWindowInDays : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["enabled"] = args ? args.enabled : undefined; resourceInputs["keyMaterialBase64"] = (args === null || args === void 0 ? void 0 : args.keyMaterialBase64) ? pulumi.secret(args.keyMaterialBase64) : undefined; resourceInputs["multiRegion"] = args ? args.multiRegion : undefined; resourceInputs["policy"] = args ? args.policy : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["validTo"] = args ? args.validTo : undefined; resourceInputs["arn"] = undefined /*out*/; resourceInputs["expirationModel"] = undefined /*out*/; resourceInputs["keyState"] = undefined /*out*/; resourceInputs["keyUsage"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["keyMaterialBase64"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(ExternalKey.__pulumiType, name, resourceInputs, opts); } } exports.ExternalKey = ExternalKey; /** @internal */ ExternalKey.__pulumiType = 'aws:kms/externalKey:ExternalKey'; //# sourceMappingURL=externalKey.js.map