Last active
August 22, 2016 20:17
-
-
Save micahlmartin/56e16155739d7cfc0ec0588afd6f99af to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-/+ module.base.mysql_galera.aws_volume_attachment.mysql_galera_ebs_attachment.0 | |
device_name: "/dev/sdh" => "/dev/sdh" | |
force_detach: "" => "<computed>" | |
instance_id: "i-xxx" => "${element(aws_instance.mysql_galera.*.id, count.index)}" (forces new resource) | |
volume_id: "vol-xxx" => "${element(aws_ebs_volume.mysql_galera_ebs_volume.*.id, count.index)}" (forces new resource) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_instance" "mysql_galera" { | |
count = "${var.instances}" | |
ami = "${var.ami_id}" | |
instance_type = "${var.instance_type}" | |
vpc_security_group_ids = ["${var.security_groups}"] | |
subnet_id = "${element(var.subnets, count.index)}" | |
user_data = "${data.template_cloudinit_config.config.rendered}" | |
iam_instance_profile = "${var.iam_instance_profile}" | |
ebs_optimized = true | |
.... | |
} | |
resource "aws_ebs_volume" "mysql_galera_ebs_volume" { | |
depends_on = ["aws_instance.mysql_galera"] | |
count = "${var.instances}" | |
availability_zone = "${element(aws_instance.mysql_galera.*.availability_zone, count.index)}" | |
encrypted = "${var.ebs_encrypted}" | |
size = "${var.ebs_size}" | |
type = "${var.ebs_type}" | |
} | |
resource "aws_volume_attachment" "mysql_galera_ebs_attachment" { | |
count = "${var.instances}" | |
device_name = "/dev/sdh" | |
volume_id = "${element(aws_ebs_volume.mysql_galera_ebs_volume.*.id, count.index)}" | |
instance_id = "${element(aws_instance.mysql_galera.*.id, count.index)}" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment