@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
141 lines • 6.03 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.CustomKeyStore = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Resource for managing an AWS KMS (Key Management) Custom Key Store.
*
* ## Example Usage
*
* ### CloudHSM
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
* import * as std from "@pulumi/std";
*
* const test = new aws.kms.CustomKeyStore("test", {
* cloudHsmClusterId: cloudHsmClusterId,
* customKeyStoreName: "kms-custom-key-store-test",
* keyStorePassword: "noplaintextpasswords1",
* trustAnchorCertificate: std.file({
* input: "anchor-certificate.crt",
* }).then(invoke => invoke.result),
* });
* ```
*
* ### External Key Store (VPC)
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.kms.CustomKeyStore("example", {
* customKeyStoreName: "example-vpc-xks",
* customKeyStoreType: "EXTERNAL_KEY_STORE",
* xksProxyAuthenticationCredential: {
* accessKeyId: ephemeralAccessKeyId,
* rawSecretAccessKey: ephemeralSecretAccessKey,
* },
* xksProxyConnectivity: "VPC_ENDPOINT_SERVICE",
* xksProxyUriEndpoint: "https://myproxy-private.xks.example.com",
* xksProxyUriPath: "/kms/xks/v1",
* xksProxyVpcEndpointServiceName: "com.amazonaws.vpce.us-east-1.vpce-svc-example",
* });
* ```
*
* ### External Key Store (Public)
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.kms.CustomKeyStore("example", {
* customKeyStoreName: "example-public-xks",
* customKeyStoreType: "EXTERNAL_KEY_STORE",
* xksProxyAuthenticationCredential: {
* accessKeyId: ephemeralAccessKeyId,
* rawSecretAccessKey: ephemeralSecretAccessKey,
* },
* xksProxyConnectivity: "PUBLIC_ENDPOINT",
* xksProxyUriEndpoint: "https://myproxy.xks.example.com",
* xksProxyUriPath: "/kms/xks/v1",
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import KMS (Key Management) Custom Key Store using the `id`. For example:
*
* ```sh
* $ pulumi import aws:kms/customKeyStore:CustomKeyStore example cks-5ebd4ef395a96288e
* ```
*/
class CustomKeyStore extends pulumi.CustomResource {
/**
* Get an existing CustomKeyStore 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 CustomKeyStore(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of CustomKeyStore. 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'] === CustomKeyStore.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["cloudHsmClusterId"] = state?.cloudHsmClusterId;
resourceInputs["customKeyStoreName"] = state?.customKeyStoreName;
resourceInputs["customKeyStoreType"] = state?.customKeyStoreType;
resourceInputs["keyStorePassword"] = state?.keyStorePassword;
resourceInputs["region"] = state?.region;
resourceInputs["trustAnchorCertificate"] = state?.trustAnchorCertificate;
resourceInputs["xksProxyAuthenticationCredential"] = state?.xksProxyAuthenticationCredential;
resourceInputs["xksProxyConnectivity"] = state?.xksProxyConnectivity;
resourceInputs["xksProxyUriEndpoint"] = state?.xksProxyUriEndpoint;
resourceInputs["xksProxyUriPath"] = state?.xksProxyUriPath;
resourceInputs["xksProxyVpcEndpointServiceName"] = state?.xksProxyVpcEndpointServiceName;
}
else {
const args = argsOrState;
if (args?.customKeyStoreName === undefined && !opts.urn) {
throw new Error("Missing required property 'customKeyStoreName'");
}
resourceInputs["cloudHsmClusterId"] = args?.cloudHsmClusterId;
resourceInputs["customKeyStoreName"] = args?.customKeyStoreName;
resourceInputs["customKeyStoreType"] = args?.customKeyStoreType;
resourceInputs["keyStorePassword"] = args?.keyStorePassword;
resourceInputs["region"] = args?.region;
resourceInputs["trustAnchorCertificate"] = args?.trustAnchorCertificate;
resourceInputs["xksProxyAuthenticationCredential"] = args?.xksProxyAuthenticationCredential;
resourceInputs["xksProxyConnectivity"] = args?.xksProxyConnectivity;
resourceInputs["xksProxyUriEndpoint"] = args?.xksProxyUriEndpoint;
resourceInputs["xksProxyUriPath"] = args?.xksProxyUriPath;
resourceInputs["xksProxyVpcEndpointServiceName"] = args?.xksProxyVpcEndpointServiceName;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(CustomKeyStore.__pulumiType, name, resourceInputs, opts);
}
}
exports.CustomKeyStore = CustomKeyStore;
/** @internal */
CustomKeyStore.__pulumiType = 'aws:kms/customKeyStore:CustomKeyStore';
//# sourceMappingURL=customKeyStore.js.map