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)
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:
- Cluster
Id string The ID of Cloud HSM v2 cluster to which HSM will be added.
- Availability
Zone string The IDs of AZ in which HSM module will be located. Conflicts with
subnet_id
.- Ip
Address string The IP address of HSM module. Must be within the CIDR of selected subnet.
- Subnet
Id string The ID of subnet in which HSM module will be located. Conflicts with
availability_zone
.
- Cluster
Id string The ID of Cloud HSM v2 cluster to which HSM will be added.
- Availability
Zone string The IDs of AZ in which HSM module will be located. Conflicts with
subnet_id
.- Ip
Address string The IP address of HSM module. Must be within the CIDR of selected subnet.
- Subnet
Id string The ID of subnet in which HSM module will be located. Conflicts with
availability_zone
.
- cluster
Id String The ID of Cloud HSM v2 cluster to which HSM will be added.
- availability
Zone String The IDs of AZ in which HSM module will be located. Conflicts with
subnet_id
.- ip
Address String The IP address of HSM module. Must be within the CIDR of selected subnet.
- subnet
Id String The ID of subnet in which HSM module will be located. Conflicts with
availability_zone
.
- cluster
Id string The ID of Cloud HSM v2 cluster to which HSM will be added.
- availability
Zone string The IDs of AZ in which HSM module will be located. Conflicts with
subnet_id
.- ip
Address string The IP address of HSM module. Must be within the CIDR of selected subnet.
- subnet
Id 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
.
- cluster
Id String The ID of Cloud HSM v2 cluster to which HSM will be added.
- availability
Zone String The IDs of AZ in which HSM module will be located. Conflicts with
subnet_id
.- ip
Address String The IP address of HSM module. Must be within the CIDR of selected subnet.
- subnet
Id 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:
- hsm_
eni_ strid 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.
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.
- Availability
Zone string The IDs of AZ in which HSM module will be located. Conflicts with
subnet_id
.- Cluster
Id string The ID of Cloud HSM v2 cluster to which HSM will be added.
- Hsm
Eni stringId The id of the ENI interface allocated for HSM module.
- Hsm
Id string The id of the HSM module.
- Ip
Address string The IP address of HSM module. Must be within the CIDR of selected subnet.
- State string
The state of the HSM module.
- Subnet
Id string The ID of subnet in which HSM module will be located. Conflicts with
availability_zone
.
- Availability
Zone string The IDs of AZ in which HSM module will be located. Conflicts with
subnet_id
.- Cluster
Id string The ID of Cloud HSM v2 cluster to which HSM will be added.
- Hsm
Eni stringId The id of the ENI interface allocated for HSM module.
- Hsm
Id string The id of the HSM module.
- Hsm
State string The state of the HSM module.
- Ip
Address string The IP address of HSM module. Must be within the CIDR of selected subnet.
- Subnet
Id string The ID of subnet in which HSM module will be located. Conflicts with
availability_zone
.
- availability
Zone String The IDs of AZ in which HSM module will be located. Conflicts with
subnet_id
.- cluster
Id String The ID of Cloud HSM v2 cluster to which HSM will be added.
- hsm
Eni StringId The id of the ENI interface allocated for HSM module.
- hsm
Id String The id of the HSM module.
- hsm
State String The state of the HSM module.
- ip
Address String The IP address of HSM module. Must be within the CIDR of selected subnet.
- subnet
Id String The ID of subnet in which HSM module will be located. Conflicts with
availability_zone
.
- availability
Zone string The IDs of AZ in which HSM module will be located. Conflicts with
subnet_id
.- cluster
Id string The ID of Cloud HSM v2 cluster to which HSM will be added.
- hsm
Eni stringId The id of the ENI interface allocated for HSM module.
- hsm
Id string The id of the HSM module.
- hsm
State string The state of the HSM module.
- ip
Address string The IP address of HSM module. Must be within the CIDR of selected subnet.
- subnet
Id 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_ strid 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
.
- availability
Zone String The IDs of AZ in which HSM module will be located. Conflicts with
subnet_id
.- cluster
Id String The ID of Cloud HSM v2 cluster to which HSM will be added.
- hsm
Eni StringId The id of the ENI interface allocated for HSM module.
- hsm
Id String The id of the HSM module.
- hsm
State String The state of the HSM module.
- ip
Address String The IP address of HSM module. Must be within the CIDR of selected subnet.
- subnet
Id 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.