feature(iac): add service-account module #3

Merged
florian.heuer merged 3 commits from feature/STACKITCIN-125-sa-module into main 2025-08-25 10:01:15 +00:00
2 changed files with 10 additions and 1 deletions
Showing only changes of commit 5c93a4a668 - Show all commits

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" {
description = "The email of the service account"
value = stackit_service_account.this.email

View file

@ -3,6 +3,10 @@ resource "stackit_service_account" "this" {
project_id = var.stackit_project_id
}
resource "time_rotating" "this" {
rotation_days = 3
}
resource "stackit_service_account_key" "this" {
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
}
resource "stackit_service_account_attachment" "this" {
resource "stackit_server_service_account_attach" "this" {
count = var.attach_to_server ? 1 : 0
project_id = var.stackit_project_id