@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
81 lines • 3.46 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.DefaultKmsKey = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a resource to manage the default customer master key (CMK) that your AWS account uses to encrypt EBS volumes.
*
* Your AWS account has an AWS-managed default CMK that is used for encrypting an EBS volume when no CMK is specified in the API call that creates the volume.
* By using the `aws.ebs.DefaultKmsKey` resource, you can specify a customer-managed CMK to use in place of the AWS-managed default CMK.
*
* > **NOTE:** Creating an `aws.ebs.DefaultKmsKey` resource does not enable default EBS encryption. Use the `aws.ebs.EncryptionByDefault` to enable default EBS encryption.
*
* > **NOTE:** Destroying this resource will reset the default CMK to the account's AWS-managed default CMK for EBS.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.ebs.DefaultKmsKey("example", {keyArn: exampleAwsKmsKey.arn});
* ```
*
* ## Import
*
* Using `pulumi import`, import the EBS default KMS CMK using the KMS key ARN. For example:
*
* ```sh
* $ pulumi import aws:ebs/defaultKmsKey:DefaultKmsKey example arn:aws:kms:us-east-1:123456789012:key/abcd-1234
* ```
*/
class DefaultKmsKey extends pulumi.CustomResource {
/**
* Get an existing DefaultKmsKey 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 DefaultKmsKey(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of DefaultKmsKey. 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'] === DefaultKmsKey.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["keyArn"] = state?.keyArn;
resourceInputs["region"] = state?.region;
}
else {
const args = argsOrState;
if (args?.keyArn === undefined && !opts.urn) {
throw new Error("Missing required property 'keyArn'");
}
resourceInputs["keyArn"] = args?.keyArn;
resourceInputs["region"] = args?.region;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(DefaultKmsKey.__pulumiType, name, resourceInputs, opts);
}
}
exports.DefaultKmsKey = DefaultKmsKey;
/** @internal */
DefaultKmsKey.__pulumiType = 'aws:ebs/defaultKmsKey:DefaultKmsKey';
//# sourceMappingURL=defaultKmsKey.js.map
;