Skip to content

Commit

Permalink
update terraform configs
Browse files Browse the repository at this point in the history
  • Loading branch information
geloman committed Nov 26, 2024
1 parent ab68d70 commit 8ee08d8
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 13 deletions.
1 change: 0 additions & 1 deletion terraform/data.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
data "digitalocean_droplet_snapshot" "eastblue" {
count = var.use_droplet_snapshot ? 0 : 1
name_regex = "^${var.droplet_snapshot}"
region = var.droplet_region
most_recent = true
Expand Down
2 changes: 1 addition & 1 deletion terraform/main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
provider "digitalocean" {}

resource "digitalocean_droplet" "droplet" {
image = try(data.digitalocean_droplet_snapshot.eastblue[0].id, var.droplet_image)
image = try(data.digitalocean_droplet_snapshot.eastblue.id, var.droplet_image)
name = var.droplet_name
region = var.droplet_region
size = var.droplet_size
Expand Down
11 changes: 5 additions & 6 deletions terraform/terraform.tfvars
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use_droplet_snapshot = false
droplet_name = "eastblue"
droplet_image = "ubuntu-24-04-x64"
droplet_snapshot = "eastblue-linux"
droplet_region = "sgp1"
droplet_ssh_keys = ["51:83:6f:ee:e7:74:39:75:77:1f:f2:12:7a:89:4b:5b"]
droplet_name = "eastblue"
droplet_image = "ubuntu-24-04-x64"
droplet_snapshot = "eastblue-linux"
droplet_region = "sgp1"
droplet_ssh_keys = ["51:83:6f:ee:e7:74:39:75:77:1f:f2:12:7a:89:4b:5b"]
5 changes: 0 additions & 5 deletions terraform/variables.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
variable "use_droplet_snapshot" {
description = "whether to use droplet snapshot or not"
type = bool
}

variable "droplet_name" {
description = "digitalocean droplet name"
type = string
Expand Down

0 comments on commit 8ee08d8

Please sign in to comment.