» aws_cloudhsm_v2_cluster

Creates an Amazon CloudHSM v2 cluster.

For information about CloudHSM v2, see the AWS CloudHSM User Guide and the Amazon CloudHSM API Reference.

» Example Usage

The following example below creates a CloudHSM cluster.

provider "aws" {
  region = "${var.aws_region}"
}

data "aws_availability_zones" "available" {}

resource "aws_vpc" "cloudhsm2_vpc" {
  cidr_block = "10.0.0.0/16"

  tags {
    Name = "example-aws_cloudhsm_v2_cluster"
  }
}

resource "aws_subnet" "cloudhsm2_subnets" {
  count                   = 2
  vpc_id                  = "${aws_vpc.cloudhsm2_vpc.id}"
  cidr_block              = "${element(var.subnets, count.index)}"
  map_public_ip_on_launch = false
  availability_zone       = "${element(data.aws_availability_zones.available.names, count.index)}"

  tags {
    Name = "example-aws_cloudhsm_v2_cluster"
  }
}

resource "aws_cloudhsm_v2_cluster" "cloudhsm_v2_cluster" {
  hsm_type   = "hsm1.medium"
  subnet_ids = ["${aws_subnet.cloudhsm2_subnets.*.id}"]

  tags {
    Name = "example-aws_cloudhsm_v2_cluster"
  }
}

» Argument Reference

The following arguments are supported:

  • source_backup_identifier - (Optional) The id of Cloud HSM v2 cluster backup to be restored.
  • hsm_type - (Required) The type of HSM module in the cluster. Currently, only hsm1.medium is supported.
  • subnet_ids - (Required) The IDs of subnets in which cluster will operate.

» Attributes Reference

The following attributes are exported: