aws logo
AWS Classic v5.41.0, May 15 23

aws.cloudhsmv2.Hsm

Explore with Pulumi AI

Creates an HSM module in Amazon CloudHSM v2 cluster.

Example Usage

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

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 = @var.Cloudhsm_cluster_id,
    });

    var cloudhsmV2Hsm = new Aws.CloudHsmV2.Hsm("cloudhsmV2Hsm", new()
    {
        SubnetId = cluster.Apply(getClusterResult => getClusterResult.SubnetIds[0]),
        ClusterId = cluster.Apply(getClusterResult => getClusterResult.ClusterId),
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/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: _var.Cloudhsm_cluster_id,
		}, nil)
		if err != nil {
			return err
		}
		_, err = cloudhsmv2.NewHsm(ctx, "cloudhsmV2Hsm", &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(var_.cloudhsm_cluster_id())
            .build());

        var cloudhsmV2Hsm = new Hsm("cloudhsmV2Hsm", HsmArgs.builder()        
            .subnetId(cluster.applyValue(getClusterResult -> getClusterResult.subnetIds()[0]))
            .clusterId(cluster.applyValue(getClusterResult -> getClusterResult.clusterId()))
            .build());

    }
}
import pulumi
import pulumi_aws as aws

cluster = aws.cloudhsmv2.get_cluster(cluster_id=var["cloudhsm_cluster_id"])
cloudhsm_v2_hsm = aws.cloudhsmv2.Hsm("cloudhsmV2Hsm",
    subnet_id=cluster.subnet_ids[0],
    cluster_id=cluster.cluster_id)
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const cluster = aws.cloudhsmv2.getCluster({
    clusterId: _var.cloudhsm_cluster_id,
});
const cloudhsmV2Hsm = new aws.cloudhsmv2.Hsm("cloudhsmV2Hsm", {
    subnetId: cluster.then(cluster => cluster.subnetIds?.[0]),
    clusterId: cluster.then(cluster => cluster.clusterId),
});
resources:
  cloudhsmV2Hsm:
    type: aws:cloudhsmv2:Hsm
    properties:
      subnetId: ${cluster.subnetIds[0]}
      clusterId: ${cluster.clusterId}
variables:
  cluster:
    fn::invoke:
      Function: aws:cloudhsmv2:getCluster
      Arguments:
        clusterId: ${var.cloudhsm_cluster_id}

Create Hsm Resource

new Hsm(name: string, args: HsmArgs, opts?: CustomResourceOptions);
@overload
def Hsm(resource_name: str,
        opts: Optional[ResourceOptions] = None,
        availability_zone: Optional[str] = None,
        cluster_id: Optional[str] = None,
        ip_address: Optional[str] = None,
        subnet_id: Optional[str] = None)
@overload
def Hsm(resource_name: str,
        args: HsmArgs,
        opts: Optional[ResourceOptions] = None)
func NewHsm(ctx *Context, name string, args HsmArgs, opts ...ResourceOption) (*Hsm, error)
public Hsm(string name, HsmArgs args, CustomResourceOptions? opts = null)
public Hsm(String name, HsmArgs args)
public Hsm(String name, HsmArgs args, CustomResourceOptions options)
type: aws:cloudhsmv2:Hsm
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args HsmArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args HsmArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args HsmArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args HsmArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args HsmArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Hsm Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The Hsm resource accepts the following input properties:

ClusterId string

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

AvailabilityZone string

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

IpAddress string

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

SubnetId string

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

ClusterId string

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

AvailabilityZone string

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

IpAddress string

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

SubnetId string

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

clusterId String

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

availabilityZone String

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

ipAddress String

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

subnetId String

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

clusterId string

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

availabilityZone string

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

ipAddress string

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

subnetId string

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

cluster_id str

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

availability_zone str

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

ip_address str

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

subnet_id str

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

clusterId String

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

availabilityZone String

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

ipAddress String

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

subnetId String

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

Outputs

All input properties are implicitly available as output properties. Additionally, the Hsm resource produces the following output properties:

HsmEniId string

The id of the ENI interface allocated for HSM module.

HsmId string

The id of the HSM module.

Id string

The provider-assigned unique ID for this managed resource.

State string

The state of the HSM module.

HsmEniId string

The id of the ENI interface allocated for HSM module.

HsmId string

The id of the HSM module.

HsmState string

The state of the HSM module.

Id string

The provider-assigned unique ID for this managed resource.

hsmEniId String

The id of the ENI interface allocated for HSM module.

hsmId String

The id of the HSM module.

hsmState String

The state of the HSM module.

id String

The provider-assigned unique ID for this managed resource.

hsmEniId string

The id of the ENI interface allocated for HSM module.

hsmId string

The id of the HSM module.

hsmState string

The state of the HSM module.

id string

The provider-assigned unique ID for this managed resource.

hsm_eni_id str

The id of the ENI interface allocated for HSM module.

hsm_id str

The id of the HSM module.

hsm_state str

The state of the HSM module.

id str

The provider-assigned unique ID for this managed resource.

hsmEniId String

The id of the ENI interface allocated for HSM module.

hsmId String

The id of the HSM module.

hsmState String

The state of the HSM module.

id String

The provider-assigned unique ID for this managed resource.

Look up Existing Hsm Resource

Get an existing Hsm resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: HsmState, opts?: CustomResourceOptions): Hsm
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        availability_zone: Optional[str] = None,
        cluster_id: Optional[str] = None,
        hsm_eni_id: Optional[str] = None,
        hsm_id: Optional[str] = None,
        hsm_state: Optional[str] = None,
        ip_address: Optional[str] = None,
        subnet_id: Optional[str] = None) -> Hsm
func GetHsm(ctx *Context, name string, id IDInput, state *HsmState, opts ...ResourceOption) (*Hsm, error)
public static Hsm Get(string name, Input<string> id, HsmState? state, CustomResourceOptions? opts = null)
public static Hsm get(String name, Output<String> id, HsmState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
AvailabilityZone string

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

ClusterId string

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

HsmEniId string

The id of the ENI interface allocated for HSM module.

HsmId string

The id of the HSM module.

IpAddress string

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

State string

The state of the HSM module.

SubnetId string

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

AvailabilityZone string

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

ClusterId string

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

HsmEniId string

The id of the ENI interface allocated for HSM module.

HsmId string

The id of the HSM module.

HsmState string

The state of the HSM module.

IpAddress string

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

SubnetId string

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

availabilityZone String

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

clusterId String

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

hsmEniId String

The id of the ENI interface allocated for HSM module.

hsmId String

The id of the HSM module.

hsmState String

The state of the HSM module.

ipAddress String

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

subnetId String

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

availabilityZone string

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

clusterId string

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

hsmEniId string

The id of the ENI interface allocated for HSM module.

hsmId string

The id of the HSM module.

hsmState string

The state of the HSM module.

ipAddress string

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

subnetId string

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

availability_zone str

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

cluster_id str

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

hsm_eni_id str

The id of the ENI interface allocated for HSM module.

hsm_id str

The id of the HSM module.

hsm_state str

The state of the HSM module.

ip_address str

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

subnet_id str

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

availabilityZone String

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

clusterId String

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

hsmEniId String

The id of the ENI interface allocated for HSM module.

hsmId String

The id of the HSM module.

hsmState String

The state of the HSM module.

ipAddress String

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

subnetId String

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

Import

HSM modules can be imported using their HSM ID, e.g.,

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

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.