chore(terraform): use a util func to build internal terraform id (#869)

This commit is contained in:
Ruben Hönle 2025-06-12 14:41:57 +02:00 committed by GitHub
parent 801ef6033d
commit b313ef6a39
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
72 changed files with 205 additions and 538 deletions

View file

@ -7,6 +7,8 @@ import (
"strings"
"time"
"github.com/stackitcloud/terraform-provider-stackit/stackit/internal/utils"
serviceaccountUtils "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/serviceaccount/utils"
"github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator"
@ -301,8 +303,7 @@ func mapFields(resp *serviceaccount.ServiceAccount, model *Model) error {
}
// Build the ID by combining the project ID and email and assign the model's fields.
idParts := []string{model.ProjectId.ValueString(), *resp.Email}
model.Id = types.StringValue(strings.Join(idParts, core.Separator))
model.Id = utils.BuildInternalTerraformId(model.ProjectId.ValueString(), *resp.Email)
model.Email = types.StringPointerValue(resp.Email)
model.ProjectId = types.StringPointerValue(resp.ProjectId)