UNPKG

@pulumi/aws

Version:

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

117 lines 5.45 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.ReplicaExternalKey = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages a KMS multi-Region replica key that uses external key material. * See the [AWS KMS Developer Guide](https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-import.html) for more information on importing key material into multi-Region keys. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const primary = new aws.kms.ExternalKey("primary", { * description: "Multi-Region primary key", * deletionWindowInDays: 30, * multiRegion: true, * enabled: true, * keyMaterialBase64: "...", * }); * const replica = new aws.kms.ReplicaExternalKey("replica", { * description: "Multi-Region replica key", * deletionWindowInDays: 7, * primaryKeyArn: primaryAwsKmsExternal.arn, * keyMaterialBase64: "...", * }); * ``` * * ## Import * * Using `pulumi import`, import KMS multi-Region replica keys using the `id`. For example: * * ```sh * $ pulumi import aws:kms/replicaExternalKey:ReplicaExternalKey example 1234abcd-12ab-34cd-56ef-1234567890ab * ``` */ class ReplicaExternalKey extends pulumi.CustomResource { /** * Get an existing ReplicaExternalKey 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 ReplicaExternalKey(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of ReplicaExternalKey. 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'] === ReplicaExternalKey.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["arn"] = state?.arn; resourceInputs["bypassPolicyLockoutSafetyCheck"] = state?.bypassPolicyLockoutSafetyCheck; resourceInputs["deletionWindowInDays"] = state?.deletionWindowInDays; resourceInputs["description"] = state?.description; resourceInputs["enabled"] = state?.enabled; resourceInputs["expirationModel"] = state?.expirationModel; resourceInputs["keyId"] = state?.keyId; resourceInputs["keyMaterialBase64"] = state?.keyMaterialBase64; resourceInputs["keyState"] = state?.keyState; resourceInputs["keyUsage"] = state?.keyUsage; resourceInputs["policy"] = state?.policy; resourceInputs["primaryKeyArn"] = state?.primaryKeyArn; resourceInputs["region"] = state?.region; resourceInputs["tags"] = state?.tags; resourceInputs["tagsAll"] = state?.tagsAll; resourceInputs["validTo"] = state?.validTo; } else { const args = argsOrState; if (args?.primaryKeyArn === undefined && !opts.urn) { throw new Error("Missing required property 'primaryKeyArn'"); } resourceInputs["bypassPolicyLockoutSafetyCheck"] = args?.bypassPolicyLockoutSafetyCheck; resourceInputs["deletionWindowInDays"] = args?.deletionWindowInDays; resourceInputs["description"] = args?.description; resourceInputs["enabled"] = args?.enabled; resourceInputs["keyMaterialBase64"] = args?.keyMaterialBase64 ? pulumi.secret(args.keyMaterialBase64) : undefined; resourceInputs["policy"] = args?.policy; resourceInputs["primaryKeyArn"] = args?.primaryKeyArn; resourceInputs["region"] = args?.region; resourceInputs["tags"] = args?.tags; resourceInputs["validTo"] = args?.validTo; resourceInputs["arn"] = undefined /*out*/; resourceInputs["expirationModel"] = undefined /*out*/; resourceInputs["keyId"] = 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(ReplicaExternalKey.__pulumiType, name, resourceInputs, opts); } } exports.ReplicaExternalKey = ReplicaExternalKey; /** @internal */ ReplicaExternalKey.__pulumiType = 'aws:kms/replicaExternalKey:ReplicaExternalKey'; //# sourceMappingURL=replicaExternalKey.js.map