terraform-provider-stackit
terraform-provider-stackit copied to clipboard
STACKIT Service Account Email
Hi,
why do I need to specify the Service Account Email Adresse in combination with the Access Token?
╷
│ Error: Error creating project
│
│ with stackit_resourcemanager_project.project-hub,
│ on 03-project.tf line 9, in resource "stackit_resourcemanager_project" "project-hub":
│ 9: resource "stackit_resourcemanager_project" "project-hub" {
│
│ The service account e-mail cannot be empty: set it in the provider configuration or through the STACKIT_SERVICE_ACCOUNT_EMAIL or in your credentials file (default filepath is ~/.stackit/credentials.json)
Because the Service Account Email Adress is part of the JWT Token itself and could be extracted 🤔
Example Terraform Code to extract Service Account Email:
jsondecode(base64decode(split(".", var.STACKIT_SERVICE_ACCOUNT_TOKEN)[1])).email