-
Notifications
You must be signed in to change notification settings - Fork 37
/
slave_launch_configuration.tf
36 lines (32 loc) · 1.27 KB
/
slave_launch_configuration.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
resource "aws_launch_configuration" "slave" {
security_groups = ["${aws_security_group.slave.id}"]
image_id = "${var.instance_ami}"
instance_type = "${var.slave_instance_type}"
key_name = "${aws_key_pair.dcos.key_name}"
user_data = "${template_file.slave_user_data.rendered}"
associate_public_ip_address = false
root_block_device {
volume_type = "gp2"
volume_size = "64"
delete_on_termination = true
}
lifecycle {
create_before_destroy = false
}
}
resource "template_file" "slave_user_data" {
filename = "${path.module}/slave_user_data.yml"
vars {
stack_name = "${var.stack_name}"
aws_region = "${var.aws_region}"
aws_access_key_id = "${aws_iam_access_key.host_keys.id}"
aws_secret_access_key = "${aws_iam_access_key.host_keys.secret}"
fallback_dns = "${var.fallback_dns}"
internal_master_lb_dns_name = "${aws_elb.internal_master.dns_name}"
dcos_lb_dns_name = "${aws_elb.dcos.dns_name}"
exhibitor_s3_bucket = "${aws_s3_bucket.exhibitor.id}"
bootstrap_repo_root = "${var.bootstrap_repo_root}"
mesos_quorum = "${var.master_quorum_count}"
master_instance_count = "${var.master_instance_count}"
}
}