Skip to content

Commit

Permalink
refactor: making things elegant
Browse files Browse the repository at this point in the history
  • Loading branch information
dd84ai committed Jul 29, 2024
1 parent d20f99f commit 91785ed
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 26 deletions.
4 changes: 0 additions & 4 deletions tf/production/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ module "server" {
name = "node-arm"
}

data "aws_ssm_parameter" "darkbot" {
name = "/terraform/hetzner/darkbot/production"
}

data "external" "secrets_darkbot" {
program = ["pass", "api/personal/terraform/hetzner/darkbot/production"]
}
Expand Down
12 changes: 8 additions & 4 deletions tf/production/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,20 @@ terraform {
}
}

data "external" "secrets_providers" {
program = ["bash", "${path.module}/secrets_providers.sh"]
data "external" "secrets_cloudflare" {
program = ["pass", "api/personal/terraform/cloudflare/dd84ai"]
}

data "external" "secrets_hetzner" {
program = ["pass", "api/personal/terraform/hetzner/production"]
}

provider "hcloud" {
token = data.external.secrets_providers.result["hetzner_token"]
token = data.external.secrets_hetzner.result["token"]
}

provider "cloudflare" {
api_token = data.external.secrets_providers.result["cloudflare_token"]
api_token = data.external.secrets_cloudflare.result["token"]
}

provider "kubernetes" {
Expand Down
7 changes: 0 additions & 7 deletions tf/production/secrets_providers.sh

This file was deleted.

12 changes: 8 additions & 4 deletions tf/staging/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,20 @@ terraform {
}
}

data "external" "secrets_providers" {
program = ["bash", "${path.module}/secrets_providers.sh"]
data "external" "secrets_cloudflare" {
program = ["pass", "api/personal/terraform/cloudflare/dd84ai"]
}

data "external" "secrets_hetzner" {
program = ["pass", "api/personal/terraform/hetzner/production"]
}

provider "hcloud" {
token = data.external.secrets_providers.result["hetzner_token"]
token = data.external.secrets_hetzner.result["token"]
}

provider "cloudflare" {
api_token = data.external.secrets_providers.result["cloudflare_token"]
api_token = data.external.secrets_cloudflare.result["token"]
}

provider "kubernetes" {
Expand Down
7 changes: 0 additions & 7 deletions tf/staging/secrets_providers.sh

This file was deleted.

0 comments on commit 91785ed

Please sign in to comment.