Skip to content
This repository has been archived by the owner on Apr 30, 2021. It is now read-only.

Commit

Permalink
No longer use terraform to manage the state of the cloudHSMs.
Browse files Browse the repository at this point in the history
Due to:
hashicorp/terraform-provider-aws#8648
and the inability to scale an HSM cluster out from terraform it makes
sense to not manage the cloudHSMs from terraform.
  • Loading branch information
blairboy362 committed Jul 2, 2019
1 parent a71a918 commit f10952d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 23 deletions.
3 changes: 3 additions & 0 deletions charts/gsp-cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ global:
ci:
privateKey: ""
publicKey: ""
cloudHsm:
enabled: false
ipAddress: 127.0.0.1

adminRoleARNs: []
adminUserARNs: []
Expand Down
4 changes: 3 additions & 1 deletion modules/gsp-cluster/data/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ global:
# move these to gsp-namespace terraform output
canary:
verificationKeys: []

cloudHsm:
enabled: false

adminRoleARNs: ${admin_role_arns}
adminUserARNs: ${admin_user_arns}
sreRoleARNs: ${sre_role_arns}
Expand Down
18 changes: 0 additions & 18 deletions modules/hsm/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,6 @@ resource "aws_security_group_rule" "hsm-worker-ingress" {
source_security_group_id = "${var.source_security_group_id}"
}

# We can only create one HSM in Terraform rather than the multiple we require for high availability as you must create
# a single HSM, initialise and activate it (which is done manually) before you can create more as they are clones of the
# first HSM. The other HSMs will need to be created after the Terraform apply
# Manual steps to initalise and activate the HSM can be followed from
# https://docs.aws.amazon.com/cloudhsm/latest/userguide/configure-sg.html onwards
resource "aws_cloudhsm_v2_hsm" "cloudhsm_v2_hsm" {
subnet_id = "${aws_cloudhsm_v2_cluster.cluster.subnet_ids[0]}"
cluster_id = "${aws_cloudhsm_v2_cluster.cluster.cluster_id}"
}

module "lambda_splunk_forwarder" {
source = "../lambda_splunk_forwarder"

Expand All @@ -69,11 +59,3 @@ module "lambda_splunk_forwarder" {
splunk_hec_url = "${var.splunk_hec_url}"
splunk_index = "${var.splunk_index}"
}

data "aws_network_interface" "hsm" {
id = "${aws_cloudhsm_v2_hsm.cloudhsm_v2_hsm.hsm_eni_id}"
}

output "hsm_ips" {
value = ["${data.aws_network_interface.hsm.private_ips}"]
}
4 changes: 0 additions & 4 deletions pipelines/deployer/deployer.tf
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,3 @@ output "values" {
sensitive = true
value = "${module.gsp-cluster.values}"
}

output "hsm_ips" {
value = "${module.hsm.hsm_ips}"
}

0 comments on commit f10952d

Please sign in to comment.