terraform-provider-stackit
terraform-provider-stackit copied to clipboard
STACKIT Service Account Email
trafficstars
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
Hi @BackInBash , thanks for opening the issue. You are right, we could extract it from the JWT Token. We will also check if we need it at all, as it might not be required anymore. If that's the case, we'll remove this check.
The deprecation of the service_account_email config was released in 0.37.0