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.
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)
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
})
}
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 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}
Create Hsm Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Hsm(name: string, args: HsmArgs, opts?: CustomResourceOptions);
@overload
def Hsm(resource_name: str,
args: HsmArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Hsm(resource_name: str,
opts: Optional[ResourceOptions] = None,
cluster_id: Optional[str] = None,
availability_zone: Optional[str] = None,
ip_address: Optional[str] = None,
subnet_id: Optional[str] = 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.
Parameters
- 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.
Constructor example
The following reference example uses placeholder values for all input properties.
var hsmResource = new Aws.CloudHsmV2.Hsm("hsmResource", new()
{
ClusterId = "string",
AvailabilityZone = "string",
IpAddress = "string",
SubnetId = "string",
});
example, err := cloudhsmv2.NewHsm(ctx, "hsmResource", &cloudhsmv2.HsmArgs{
ClusterId: pulumi.String("string"),
AvailabilityZone: pulumi.String("string"),
IpAddress: pulumi.String("string"),
SubnetId: pulumi.String("string"),
})
var hsmResource = new Hsm("hsmResource", HsmArgs.builder()
.clusterId("string")
.availabilityZone("string")
.ipAddress("string")
.subnetId("string")
.build());
hsm_resource = aws.cloudhsmv2.Hsm("hsmResource",
cluster_id="string",
availability_zone="string",
ip_address="string",
subnet_id="string")
const hsmResource = new aws.cloudhsmv2.Hsm("hsmResource", {
clusterId: "string",
availabilityZone: "string",
ipAddress: "string",
subnetId: "string",
});
type: aws:cloudhsmv2:Hsm
properties:
availabilityZone: string
clusterId: string
ipAddress: string
subnetId: string
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
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
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
Using pulumi import
, import HSM modules using their HSM ID. For example:
$ pulumi import aws:cloudhsmv2/hsm:Hsm bar hsm-quo8dahtaca
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.