@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
97 lines • 4.78 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.Cluster = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Creates an Amazon CloudHSM v2 cluster.
*
* For information about CloudHSM v2, see the
* [AWS CloudHSM User Guide](https://docs.aws.amazon.com/cloudhsm/latest/userguide/introduction.html) and the [Amazon
* CloudHSM API Reference][2].
*
* > **NOTE:** A CloudHSM Cluster can take several minutes to set up.
* Practically no single attribute can be updated, except for `tags`.
* If you need to delete a cluster, you have to remove its HSM modules first.
* To initialize cluster, you have to add an HSM instance to the cluster, then sign CSR and upload it.
*
* ## Import
*
* Using `pulumi import`, import CloudHSM v2 Clusters using the cluster `id`. For example:
*
* ```sh
* $ pulumi import aws:cloudhsmv2/cluster:Cluster test_cluster cluster-aeb282a201
* ```
*/
class Cluster extends pulumi.CustomResource {
/**
* Get an existing Cluster 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 Cluster(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Cluster. 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'] === Cluster.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["clusterCertificates"] = state ? state.clusterCertificates : undefined;
resourceInputs["clusterId"] = state ? state.clusterId : undefined;
resourceInputs["clusterState"] = state ? state.clusterState : undefined;
resourceInputs["hsmType"] = state ? state.hsmType : undefined;
resourceInputs["mode"] = state ? state.mode : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["securityGroupId"] = state ? state.securityGroupId : undefined;
resourceInputs["sourceBackupIdentifier"] = state ? state.sourceBackupIdentifier : undefined;
resourceInputs["subnetIds"] = state ? state.subnetIds : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["tagsAll"] = state ? state.tagsAll : undefined;
resourceInputs["vpcId"] = state ? state.vpcId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.hsmType === undefined) && !opts.urn) {
throw new Error("Missing required property 'hsmType'");
}
if ((!args || args.subnetIds === undefined) && !opts.urn) {
throw new Error("Missing required property 'subnetIds'");
}
resourceInputs["hsmType"] = args ? args.hsmType : undefined;
resourceInputs["mode"] = args ? args.mode : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["sourceBackupIdentifier"] = args ? args.sourceBackupIdentifier : undefined;
resourceInputs["subnetIds"] = args ? args.subnetIds : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["clusterCertificates"] = undefined /*out*/;
resourceInputs["clusterId"] = undefined /*out*/;
resourceInputs["clusterState"] = undefined /*out*/;
resourceInputs["securityGroupId"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
resourceInputs["vpcId"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Cluster.__pulumiType, name, resourceInputs, opts);
}
}
exports.Cluster = Cluster;
/** @internal */
Cluster.__pulumiType = 'aws:cloudhsmv2/cluster:Cluster';
//# sourceMappingURL=cluster.js.map