Attach the created volume
This commit is contained in:
		| @@ -1,5 +1,5 @@ | ||||
| resource "digitalocean_volume" "this" { | ||||
|   count                   = var.volume_size >= 1 ? 1 : 0 | ||||
|   count                   = var.volume_size > 1 ? 1 : 0 | ||||
|   description             = "Data Volume for ${var.host_name}.${var.domain_name}" | ||||
|   initial_filesystem_type = "ext4" | ||||
|   name                    = "${var.host_name}.${var.domain_name}" | ||||
|   | ||||
							
								
								
									
										5
									
								
								resource.digitalocean_volume_attachment.this.tf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								resource.digitalocean_volume_attachment.this.tf
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | ||||
| resource "digitalocean_volume_attachment" "this" { | ||||
|   count      = var.volume_size > 0 ? 1 : 0 | ||||
|   droplet_id = digitalocean_droplet.this.id | ||||
|   volume_id  = digitalocean_volume.this[0].id | ||||
| } | ||||
		Reference in New Issue
	
	Block a user