UNPKG

@pulumi/aws

Version:

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

114 lines 5.39 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.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, { ...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?.arn; resourceInputs["description"] = state?.description; resourceInputs["hsmConfigurationIdentifier"] = state?.hsmConfigurationIdentifier; resourceInputs["hsmIpAddress"] = state?.hsmIpAddress; resourceInputs["hsmPartitionName"] = state?.hsmPartitionName; resourceInputs["hsmPartitionPassword"] = state?.hsmPartitionPassword; resourceInputs["hsmServerPublicCertificate"] = state?.hsmServerPublicCertificate; resourceInputs["region"] = state?.region; resourceInputs["tags"] = state?.tags; resourceInputs["tagsAll"] = state?.tagsAll; } else { const args = argsOrState; if (args?.description === undefined && !opts.urn) { throw new Error("Missing required property 'description'"); } if (args?.hsmConfigurationIdentifier === undefined && !opts.urn) { throw new Error("Missing required property 'hsmConfigurationIdentifier'"); } if (args?.hsmIpAddress === undefined && !opts.urn) { throw new Error("Missing required property 'hsmIpAddress'"); } if (args?.hsmPartitionName === undefined && !opts.urn) { throw new Error("Missing required property 'hsmPartitionName'"); } if (args?.hsmPartitionPassword === undefined && !opts.urn) { throw new Error("Missing required property 'hsmPartitionPassword'"); } if (args?.hsmServerPublicCertificate === undefined && !opts.urn) { throw new Error("Missing required property 'hsmServerPublicCertificate'"); } resourceInputs["description"] = args?.description; resourceInputs["hsmConfigurationIdentifier"] = args?.hsmConfigurationIdentifier; resourceInputs["hsmIpAddress"] = args?.hsmIpAddress; resourceInputs["hsmPartitionName"] = args?.hsmPartitionName; resourceInputs["hsmPartitionPassword"] = args?.hsmPartitionPassword ? pulumi.secret(args.hsmPartitionPassword) : undefined; resourceInputs["hsmServerPublicCertificate"] = args?.hsmServerPublicCertificate; resourceInputs["region"] = args?.region; resourceInputs["tags"] = args?.tags; 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