feature(iac): fix service-account module

This commit is contained in:
Florian Heuer 2025-08-22 22:27:03 +02:00
parent d20df2a00e
commit 5c93a4a668
2 changed files with 10 additions and 1 deletions

View file

@ -1,3 +1,8 @@
output "service_account_name" {
description = "The name of the service account"
value = var.service_account_name
}
output "service_account_email" { output "service_account_email" {
description = "The email of the service account" description = "The email of the service account"
value = stackit_service_account.this.email value = stackit_service_account.this.email

View file

@ -3,6 +3,10 @@ resource "stackit_service_account" "this" {
project_id = var.stackit_project_id project_id = var.stackit_project_id
} }
resource "time_rotating" "this" {
rotation_days = 3
}
resource "stackit_service_account_key" "this" { resource "stackit_service_account_key" "this" {
count = var.service_account_create_key ? 1 : 0 count = var.service_account_create_key ? 1 : 0
@ -13,7 +17,7 @@ resource "stackit_service_account_key" "this" {
ttl_days = var.service_account_ttl_days ttl_days = var.service_account_ttl_days
} }
resource "stackit_service_account_attachment" "this" { resource "stackit_server_service_account_attach" "this" {
count = var.attach_to_server ? 1 : 0 count = var.attach_to_server ? 1 : 0
project_id = var.stackit_project_id project_id = var.stackit_project_id