-
Notifications
You must be signed in to change notification settings - Fork 0
/
vault.tf
43 lines (33 loc) · 1.36 KB
/
vault.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
module "vault_elb" {
# Use version v0.3.0 of the vault-elb module
source = "github.com/hashicorp/terraform-aws-vault//modules/vault-elb?ref=v0.3.0"
name = "vault"
vpc_id = "${module.vpc.vpc_id}"
subnet_ids = "${module.vpc.public_subnets}"
allowed_inbound_cidr_blocks = ["${var.vpc_cidr}"]
}
module "vault_cluster" {
# Use version v0.3.0 of the vault-cluster module
source = "github.com/hashicorp/terraform-aws-vault//modules/vault-cluster?ref=v0.3.0"
# Specify the ID of the Vault AMI. You should build this using the scripts in the install-vault module.
ami_id = "${var.ami_id == "" ? data.aws_ami.nomad_consul.image_id : var.ami_id}"
load_balancers = ["${module.vault_elb.load_balancer_name}"]
cluster_name = "vault-${var.cluster_name}"
instance_type = "${var.vault_instance_type}"
cluster_size = "${var.num_vault_servers}"
cluster_tag_key = "Name"
user_data = "${data.template_file.user_data_vault.rendered}"
vpc_id = "${module.vpc.vpc_id}"
subnet_ids = "${module.vpc.private_subnets}"
allowed_inbound_security_group_ids = []
allowed_inbound_cidr_blocks = ["${var.vpc_cidr}"]
allowed_ssh_cidr_blocks = ["${var.vpc_cidr}"]
ssh_key_name = "${var.ssh_key_name}"
cluster_extra_tags = [
{
key = "${var.cluster_tag_key}"
value = "${var.cluster_name}"
propagate_at_launch = true
}
]
}