HsmArgs

data class HsmArgs(val availabilityZone: Output<String>? = null, val clusterId: Output<String>? = null, val ipAddress: Output<String>? = null, val subnetId: Output<String>? = null) : ConvertibleToJava<HsmArgs>

Creates an HSM module in Amazon CloudHSM v2 cluster.

Example Usage

The following example below creates an HSM module in CloudHSM cluster.

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 pulumi
import pulumi_aws as aws
cluster = aws.cloudhsmv2.get_cluster(cluster_id=cloudhsm_cluster_id)
cloudhsm_v2_hsm = aws.cloudhsmv2.Hsm("cloudhsm_v2_hsm",
subnet_id=cluster.subnet_ids[0],
cluster_id=cluster.cluster_id)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var cluster = Aws.CloudHsmV2.GetCluster.Invoke(new()
{
ClusterId = cloudhsmClusterId,
});
var cloudhsmV2Hsm = new Aws.CloudHsmV2.Hsm("cloudhsm_v2_hsm", new()
{
SubnetId = cluster.Apply(getClusterResult => getClusterResult.SubnetIds[0]),
ClusterId = cluster.Apply(getClusterResult => getClusterResult.ClusterId),
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cloudhsmv2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cluster, err := cloudhsmv2.LookupCluster(ctx, &cloudhsmv2.LookupClusterArgs{
ClusterId: cloudhsmClusterId,
}, nil)
if err != nil {
return err
}
_, err = cloudhsmv2.NewHsm(ctx, "cloudhsm_v2_hsm", &cloudhsmv2.HsmArgs{
SubnetId: pulumi.String(cluster.SubnetIds[0]),
ClusterId: pulumi.String(cluster.ClusterId),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.cloudhsmv2.Cloudhsmv2Functions;
import com.pulumi.aws.cloudhsmv2.inputs.GetClusterArgs;
import com.pulumi.aws.cloudhsmv2.Hsm;
import com.pulumi.aws.cloudhsmv2.HsmArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var cluster = Cloudhsmv2Functions.getCluster(GetClusterArgs.builder()
.clusterId(cloudhsmClusterId)
.build());
var cloudhsmV2Hsm = new Hsm("cloudhsmV2Hsm", HsmArgs.builder()
.subnetId(cluster.applyValue(getClusterResult -> getClusterResult.subnetIds()[0]))
.clusterId(cluster.applyValue(getClusterResult -> getClusterResult.clusterId()))
.build());
}
}
resources:
cloudhsmV2Hsm:
type: aws:cloudhsmv2:Hsm
name: cloudhsm_v2_hsm
properties:
subnetId: ${cluster.subnetIds[0]}
clusterId: ${cluster.clusterId}
variables:
cluster:
fn::invoke:
function: aws:cloudhsmv2:getCluster
arguments:
clusterId: ${cloudhsmClusterId}

Import

Using pulumi import, import HSM modules using their HSM ID. For example:

$ pulumi import aws:cloudhsmv2/hsm:Hsm bar hsm-quo8dahtaca

Constructors

Link copied to clipboard
constructor(availabilityZone: Output<String>? = null, clusterId: Output<String>? = null, ipAddress: Output<String>? = null, subnetId: Output<String>? = null)

Properties

Link copied to clipboard
val availabilityZone: Output<String>? = null

The IDs of AZ in which HSM module will be located. Conflicts with subnet_id.

Link copied to clipboard
val clusterId: Output<String>? = null

The ID of Cloud HSM v2 cluster to which HSM will be added.

Link copied to clipboard
val ipAddress: Output<String>? = null

The IP address of HSM module. Must be within the CIDR of selected subnet.

Link copied to clipboard
val subnetId: Output<String>? = null

The ID of subnet in which HSM module will be located. Conflicts with availability_zone.

Functions

Link copied to clipboard
open override fun toJava(): HsmArgs