@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
114 lines • 5.84 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.HsmConfiguration = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Creates an HSM configuration that contains the information required by an Amazon Redshift cluster to store and use database encryption keys in a Hardware Security Module (HSM).
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.redshift.HsmConfiguration("example", {
* description: "example",
* hsmConfigurationIdentifier: "example",
* hsmIpAddress: "10.0.0.1",
* hsmPartitionName: "aws",
* hsmPartitionPassword: "example",
* hsmServerPublicCertificate: "example",
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import Redshift HSM Client Certificates using `hsm_configuration_identifier`. For example:
*
* ```sh
* $ pulumi import aws:redshift/hsmConfiguration:HsmConfiguration example example
* ```
*/
class HsmConfiguration extends pulumi.CustomResource {
/**
* Get an existing HsmConfiguration 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 HsmConfiguration(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of HsmConfiguration. 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'] === HsmConfiguration.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["arn"] = state ? state.arn : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["hsmConfigurationIdentifier"] = state ? state.hsmConfigurationIdentifier : undefined;
resourceInputs["hsmIpAddress"] = state ? state.hsmIpAddress : undefined;
resourceInputs["hsmPartitionName"] = state ? state.hsmPartitionName : undefined;
resourceInputs["hsmPartitionPassword"] = state ? state.hsmPartitionPassword : undefined;
resourceInputs["hsmServerPublicCertificate"] = state ? state.hsmServerPublicCertificate : 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.description === undefined) && !opts.urn) {
throw new Error("Missing required property 'description'");
}
if ((!args || args.hsmConfigurationIdentifier === undefined) && !opts.urn) {
throw new Error("Missing required property 'hsmConfigurationIdentifier'");
}
if ((!args || args.hsmIpAddress === undefined) && !opts.urn) {
throw new Error("Missing required property 'hsmIpAddress'");
}
if ((!args || args.hsmPartitionName === undefined) && !opts.urn) {
throw new Error("Missing required property 'hsmPartitionName'");
}
if ((!args || args.hsmPartitionPassword === undefined) && !opts.urn) {
throw new Error("Missing required property 'hsmPartitionPassword'");
}
if ((!args || args.hsmServerPublicCertificate === undefined) && !opts.urn) {
throw new Error("Missing required property 'hsmServerPublicCertificate'");
}
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["hsmConfigurationIdentifier"] = args ? args.hsmConfigurationIdentifier : undefined;
resourceInputs["hsmIpAddress"] = args ? args.hsmIpAddress : undefined;
resourceInputs["hsmPartitionName"] = args ? args.hsmPartitionName : undefined;
resourceInputs["hsmPartitionPassword"] = (args === null || args === void 0 ? void 0 : args.hsmPartitionPassword) ? pulumi.secret(args.hsmPartitionPassword) : undefined;
resourceInputs["hsmServerPublicCertificate"] = args ? args.hsmServerPublicCertificate : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["hsmPartitionPassword"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(HsmConfiguration.__pulumiType, name, resourceInputs, opts);
}
}
exports.HsmConfiguration = HsmConfiguration;
/** @internal */
HsmConfiguration.__pulumiType = 'aws:redshift/hsmConfiguration:HsmConfiguration';
//# sourceMappingURL=hsmConfiguration.js.map