@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
128 lines • 5.55 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.ReplicaKey = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages a KMS multi-Region replica key.
*
* ## Example Usage
*
* ### AWS Provider v6 (and below)
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const primary = new aws.kms.Key("primary", {
* description: "Multi-Region primary key",
* deletionWindowInDays: 30,
* multiRegion: true,
* });
* const replica = new aws.kms.ReplicaKey("replica", {
* description: "Multi-Region replica key",
* deletionWindowInDays: 7,
* primaryKeyArn: primary.arn,
* });
* ```
*
* ### AWS Provider v7 (and above)
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const primary = new aws.kms.Key("primary", {
* region: "us-east-1",
* description: "Multi-Region primary key",
* deletionWindowInDays: 30,
* multiRegion: true,
* });
* const replica = new aws.kms.ReplicaKey("replica", {
* description: "Multi-Region replica key",
* deletionWindowInDays: 7,
* primaryKeyArn: primary.arn,
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import KMS multi-Region replica keys using the `id`. For example:
*
* ```sh
* $ pulumi import aws:kms/replicaKey:ReplicaKey example 1234abcd-12ab-34cd-56ef-1234567890ab
* ```
*/
class ReplicaKey extends pulumi.CustomResource {
/**
* Get an existing ReplicaKey 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 ReplicaKey(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of ReplicaKey. 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'] === ReplicaKey.__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["keyId"] = state ? state.keyId : undefined;
resourceInputs["keyRotationEnabled"] = state ? state.keyRotationEnabled : undefined;
resourceInputs["keySpec"] = state ? state.keySpec : undefined;
resourceInputs["keyUsage"] = state ? state.keyUsage : undefined;
resourceInputs["policy"] = state ? state.policy : undefined;
resourceInputs["primaryKeyArn"] = state ? state.primaryKeyArn : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["tagsAll"] = state ? state.tagsAll : undefined;
}
else {
const args = argsOrState;
if ((!args || args.primaryKeyArn === undefined) && !opts.urn) {
throw new Error("Missing required property 'primaryKeyArn'");
}
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["policy"] = args ? args.policy : undefined;
resourceInputs["primaryKeyArn"] = args ? args.primaryKeyArn : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["keyId"] = undefined /*out*/;
resourceInputs["keyRotationEnabled"] = undefined /*out*/;
resourceInputs["keySpec"] = undefined /*out*/;
resourceInputs["keyUsage"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ReplicaKey.__pulumiType, name, resourceInputs, opts);
}
}
exports.ReplicaKey = ReplicaKey;
/** @internal */
ReplicaKey.__pulumiType = 'aws:kms/replicaKey:ReplicaKey';
//# sourceMappingURL=replicaKey.js.map