terraform-provider-stackit icon indicating copy to clipboard operation
terraform-provider-stackit copied to clipboard

STACKIT Service Account Email

Open BackInBash opened this issue 1 year ago • 1 comments
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

BackInBash avatar Aug 28 '24 14:08 BackInBash

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.

vicentepinto98 avatar Aug 29 '24 08:08 vicentepinto98

The deprecation of the service_account_email config was released in 0.37.0

marceljk avatar Dec 19 '24 16:12 marceljk