Add volume creation without attachment

This commit is contained in:
Jason Rothstein 2020-08-09 15:22:07 -05:00
parent 47a869da68
commit 6249fafed2
2 changed files with 12 additions and 0 deletions

View File

@ -0,0 +1,8 @@
resource "digitalocean_volume" "this" {
count = var.volume_size == 0 ? 1 : 0
description = "Data Volume for ${var.host_name}.${var.domain_name}"
initial_filesystem_type = "ext4"
name = "${var.host_name}.${var.domain_name}"
region = var.region
size = var.volume_size
}

4
variable.volume_size.tf Normal file
View File

@ -0,0 +1,4 @@
variable "volume_size" {
default = "0"
type = number
}