From 48a4f72e4f0020813345deee198d94226522b272 Mon Sep 17 00:00:00 2001 From: Tobias Reisinger Date: Mon, 30 Sep 2024 20:31:04 +0200 Subject: [PATCH] Split up contabo provider vars --- main.tf | 5 ++++- modules/infrastructure/main.tf | 8 ++++---- modules/infrastructure/variables.tf | 20 +++++++++++++------- secrets.auto.tfvars.example | 8 ++++++++ variables.tf | 20 +++++++++++++------- 5 files changed, 42 insertions(+), 19 deletions(-) diff --git a/main.tf b/main.tf index d63fcbc..5054fd4 100644 --- a/main.tf +++ b/main.tf @@ -35,7 +35,10 @@ module "services" { module "infrastructure" { source = "./modules/infrastructure" - contabo_provider_vars = var.contabo_provider_vars + contabo_client_id = var.contabo_client_id + contabo_client_secret = var.contabo_client_secret + contabo_user = var.contabo_user + contabo_pass = var.contabo_pass hcloud_token = var.hcloud_token diff --git a/modules/infrastructure/main.tf b/modules/infrastructure/main.tf index 9dd9b43..e34ce79 100644 --- a/modules/infrastructure/main.tf +++ b/modules/infrastructure/main.tf @@ -24,10 +24,10 @@ terraform { } provider "contabo" { - oauth2_client_id = var.contabo_provider_vars.client_id - oauth2_client_secret = var.contabo_provider_vars.client_secret - oauth2_user = var.contabo_provider_vars.user - oauth2_pass = var.contabo_provider_vars.pass + oauth2_client_id = var.contabo_client_id + oauth2_client_secret = var.contabo_client_secret + oauth2_user = var.contabo_user + oauth2_pass = var.contabo_pass } provider "hcloud" { diff --git a/modules/infrastructure/variables.tf b/modules/infrastructure/variables.tf index a1db0ab..7728ad6 100644 --- a/modules/infrastructure/variables.tf +++ b/modules/infrastructure/variables.tf @@ -1,10 +1,16 @@ -variable "contabo_provider_vars" { - type = object({ - client_id = string - client_secret = string - user = string - pass = string - }) +variable "contabo_client_id" { + sensitive = true +} + +variable "contabo_client_secret" { + sensitive = true +} + +variable "contabo_user" { + sensitive = true +} + +variable "contabo_pass" { sensitive = true } diff --git a/secrets.auto.tfvars.example b/secrets.auto.tfvars.example index 0f0fb31..41ee2b5 100644 --- a/secrets.auto.tfvars.example +++ b/secrets.auto.tfvars.example @@ -4,6 +4,14 @@ backend_endpoint = "" backend_region = "" backend_bucket = "" + +authentik_token = "" + +contabo_client_id = "" +contabo_client_secret = "" +contabo_user = "" +contabo_pass = "" + hcloud_token = "" ovh_application_key = "" diff --git a/variables.tf b/variables.tf index b105e0d..b1908fc 100644 --- a/variables.tf +++ b/variables.tf @@ -28,13 +28,19 @@ variable "authentik_token" { } -variable "contabo_provider_vars" { - type = object({ - client_id = string - client_secret = string - user = string - pass = string - }) +variable "contabo_client_id" { + sensitive = true +} + +variable "contabo_client_secret" { + sensitive = true +} + +variable "contabo_user" { + sensitive = true +} + +variable "contabo_pass" { sensitive = true }