Skip to content
This repository has been archived by the owner on Oct 31, 2019. It is now read-only.

Commit

Permalink
move the volume configuration to its own file
Browse files Browse the repository at this point in the history
  • Loading branch information
afeld committed Aug 31, 2017
1 parent 5ab523c commit d7a6f1c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 22 deletions.
22 changes: 0 additions & 22 deletions terraform/ec2.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,25 +42,3 @@ resource "aws_eip" "public" {
instance = "${aws_instance.wordpress.id}"
vpc = true
}

resource "aws_ebs_volume" "wp_content" {
# TODO deletion protection
availability_zone = "${data.aws_subnet.public.availability_zone}"
size = 10
}

resource "aws_volume_attachment" "wp_content" {
device_name = "/dev/sdf"
volume_id = "${aws_ebs_volume.wp_content.id}"
instance_id = "${aws_instance.wordpress.id}"

# https://github.com/hashicorp/terraform/issues/2740#issuecomment-288549352
skip_destroy = true
provisioner "remote-exec" {
script = "files/attach-data-volume.sh"
connection {
user = "${var.ssh_user}"
host = "${aws_eip.public.public_ip}"
}
}
}
21 changes: 21 additions & 0 deletions terraform/volume.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
resource "aws_ebs_volume" "wp_content" {
# TODO deletion protection
availability_zone = "${data.aws_subnet.public.availability_zone}"
size = 10
}

resource "aws_volume_attachment" "wp_content" {
device_name = "/dev/sdf"
volume_id = "${aws_ebs_volume.wp_content.id}"
instance_id = "${aws_instance.wordpress.id}"

# https://github.com/hashicorp/terraform/issues/2740#issuecomment-288549352
skip_destroy = true
provisioner "remote-exec" {
script = "files/attach-data-volume.sh"
connection {
user = "${var.ssh_user}"
host = "${aws_eip.public.public_ip}"
}
}
}

0 comments on commit d7a6f1c

Please sign in to comment.