@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
94 lines • 3.64 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.Hsm = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Creates an HSM module in Amazon CloudHSM v2 cluster.
*
* ## Example Usage
*
* The following example below creates an HSM module in CloudHSM cluster.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const cluster = aws.cloudhsmv2.getCluster({
* clusterId: cloudhsmClusterId,
* });
* const cloudhsmV2Hsm = new aws.cloudhsmv2.Hsm("cloudhsm_v2_hsm", {
* subnetId: cluster.then(cluster => cluster.subnetIds?.[0]),
* clusterId: cluster.then(cluster => cluster.clusterId),
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import HSM modules using their HSM ID. For example:
*
* ```sh
* $ pulumi import aws:cloudhsmv2/hsm:Hsm bar hsm-quo8dahtaca
* ```
*/
class Hsm extends pulumi.CustomResource {
/**
* Get an existing Hsm 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 Hsm(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of Hsm. 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'] === Hsm.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["availabilityZone"] = state?.availabilityZone;
resourceInputs["clusterId"] = state?.clusterId;
resourceInputs["hsmEniId"] = state?.hsmEniId;
resourceInputs["hsmId"] = state?.hsmId;
resourceInputs["hsmState"] = state?.hsmState;
resourceInputs["ipAddress"] = state?.ipAddress;
resourceInputs["region"] = state?.region;
resourceInputs["subnetId"] = state?.subnetId;
}
else {
const args = argsOrState;
if (args?.clusterId === undefined && !opts.urn) {
throw new Error("Missing required property 'clusterId'");
}
resourceInputs["availabilityZone"] = args?.availabilityZone;
resourceInputs["clusterId"] = args?.clusterId;
resourceInputs["ipAddress"] = args?.ipAddress;
resourceInputs["region"] = args?.region;
resourceInputs["subnetId"] = args?.subnetId;
resourceInputs["hsmEniId"] = undefined /*out*/;
resourceInputs["hsmId"] = undefined /*out*/;
resourceInputs["hsmState"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Hsm.__pulumiType, name, resourceInputs, opts);
}
}
exports.Hsm = Hsm;
/** @internal */
Hsm.__pulumiType = 'aws:cloudhsmv2/hsm:Hsm';
//# sourceMappingURL=hsm.js.map
;