From cb28f04f2cb2e82d72f2f13371c1bde344fc9c83 Mon Sep 17 00:00:00 2001 From: Bartek Pacia Date: Fri, 18 Oct 2024 00:31:23 +0200 Subject: [PATCH] add my public ssh key --- infra-do/droplet-executor.tf | 4 +++- infra-do/droplet-influx.tf | 2 ++ infra-do/droplet-vpc.tf | 6 ++++++ infra-do/id_ed25519.pub | 1 + infra-do/outputs.tf | 7 ------- 5 files changed, 12 insertions(+), 8 deletions(-) create mode 100644 infra-do/id_ed25519.pub diff --git a/infra-do/droplet-executor.tf b/infra-do/droplet-executor.tf index b4c6e1d..3639967 100644 --- a/infra-do/droplet-executor.tf +++ b/infra-do/droplet-executor.tf @@ -4,6 +4,8 @@ resource "digitalocean_droplet" "executor" { size = "s-1vcpu-2gb" # doctl compute size list image = "ubuntu-24-04-x64" + ssh_keys = [digitalocean_ssh_key.default.fingerprint] + volume_ids = [] vpc_uuid = digitalocean_vpc.default.id @@ -36,7 +38,7 @@ resource "digitalocean_droplet" "executor" { - echo "DB_NAME=${digitalocean_database_cluster.postgres.name}" >> .executor.env # Influx config - - echo "INFLUXDB_URL=TODO" >> .executor.env + - echo "INFLUXDB_URL=http://${digitalocean_droplet.influxdb.ipv4_address_private}:8086" >> .executor.env - echo "INFLUXDB_ORG=${var.influxdb_org}" >> .executor.env - echo "INFLUXDB_BUCKET=${var.influxdb_bucket}" >> .executor.env - echo "INFLUXDB_TOKEN=${var.influxdb_token}" >> .executor.env diff --git a/infra-do/droplet-influx.tf b/infra-do/droplet-influx.tf index c08a3cb..033ddcc 100644 --- a/infra-do/droplet-influx.tf +++ b/infra-do/droplet-influx.tf @@ -4,6 +4,8 @@ resource "digitalocean_droplet" "influxdb" { size = "s-1vcpu-512mb-10gb" # doctl compute size list image = "ubuntu-24-04-x64" + ssh_keys = [digitalocean_ssh_key.default.fingerprint] + volume_ids = [digitalocean_volume.influxdb_volume.id] vpc_uuid = digitalocean_vpc.default.id diff --git a/infra-do/droplet-vpc.tf b/infra-do/droplet-vpc.tf index 3373b29..daadc4b 100644 --- a/infra-do/droplet-vpc.tf +++ b/infra-do/droplet-vpc.tf @@ -3,3 +3,9 @@ resource "digitalocean_vpc" "default" { region = "sfo3" ip_range = "10.0.0.0/16" } + +resource "digitalocean_ssh_key" "default" { + name = "main key" + public_key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAxpBCyn17WmbL4hzzMuInkihbz2801p1Y/ay+rzyICo" + +} diff --git a/infra-do/id_ed25519.pub b/infra-do/id_ed25519.pub new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/infra-do/id_ed25519.pub @@ -0,0 +1 @@ + diff --git a/infra-do/outputs.tf b/infra-do/outputs.tf index 71344b4..6e40502 100644 --- a/infra-do/outputs.tf +++ b/infra-do/outputs.tf @@ -26,10 +26,3 @@ output "live_domain" { output "volume_id" { value = digitalocean_volume.influxdb_volume.id } - -output "influx_droplet_ip" { - value = digitalocean_droplet.influxdb.private_networking -} -output "droplet_1_private_ip" { - value = digitalocean_droplet.executor.private_networking -}