Split up contabo provider vars

This commit is contained in:
Tobias Reisinger 2024-09-30 20:31:04 +02:00
parent 048ea26034
commit 48a4f72e4f
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
5 changed files with 42 additions and 19 deletions

View file

@ -35,7 +35,10 @@ module "services" {
module "infrastructure" { module "infrastructure" {
source = "./modules/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 hcloud_token = var.hcloud_token

View file

@ -24,10 +24,10 @@ terraform {
} }
provider "contabo" { provider "contabo" {
oauth2_client_id = var.contabo_provider_vars.client_id oauth2_client_id = var.contabo_client_id
oauth2_client_secret = var.contabo_provider_vars.client_secret oauth2_client_secret = var.contabo_client_secret
oauth2_user = var.contabo_provider_vars.user oauth2_user = var.contabo_user
oauth2_pass = var.contabo_provider_vars.pass oauth2_pass = var.contabo_pass
} }
provider "hcloud" { provider "hcloud" {

View file

@ -1,10 +1,16 @@
variable "contabo_provider_vars" { variable "contabo_client_id" {
type = object({ sensitive = true
client_id = string }
client_secret = string
user = string variable "contabo_client_secret" {
pass = string sensitive = true
}) }
variable "contabo_user" {
sensitive = true
}
variable "contabo_pass" {
sensitive = true sensitive = true
} }

View file

@ -4,6 +4,14 @@ backend_endpoint = ""
backend_region = "" backend_region = ""
backend_bucket = "" backend_bucket = ""
authentik_token = ""
contabo_client_id = ""
contabo_client_secret = ""
contabo_user = ""
contabo_pass = ""
hcloud_token = "" hcloud_token = ""
ovh_application_key = "" ovh_application_key = ""

View file

@ -28,13 +28,19 @@ variable "authentik_token" {
} }
variable "contabo_provider_vars" { variable "contabo_client_id" {
type = object({ sensitive = true
client_id = string }
client_secret = string
user = string variable "contabo_client_secret" {
pass = string sensitive = true
}) }
variable "contabo_user" {
sensitive = true
}
variable "contabo_pass" {
sensitive = true sensitive = true
} }