diff options
author | EuAndreh <eu@euandre.org> | 2019-06-05 20:22:09 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2019-06-05 20:22:09 -0300 |
commit | 58d869f3ca3c980897e62cef55cda4fdf932affb (patch) | |
tree | 275f0bb6ceae93f5de4e6c2ebcfc206023600161 /vps.tf | |
parent | Always destroy infrastructure before applying (diff) | |
download | server-58d869f3ca3c980897e62cef55cda4fdf932affb.tar.gz server-58d869f3ca3c980897e62cef55cda4fdf932affb.tar.xz |
Add volume to VPS
Don't destroy everything on deploy. This would destroy the volume too.
Diffstat (limited to 'vps.tf')
-rw-r--r-- | vps.tf | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -42,3 +42,16 @@ resource "digitalocean_floating_ip_assignment" "vps" { ip_address = "${var.floating_ip}" droplet_id = "${digitalocean_droplet.vps.id}" } + +resource "digitalocean_volume" "vps_persistent_volume" { + region = "nyc3" + name = "vps-persistent-volume" + size = 10 + initial_filesystem_type = "ext4" + description = "Persistent disk to store docker volumes contents across droplets being created and destroyed" +} + +resource "digitalocean_volume_attachment" "foobar" { + volume_id = "${digitalocean_volume.vps_persistent_volume.id}" + droplet_id = "${digitalocean_droplet.vps.id}" +} |