chore(terraform): refactor region overrides in mapping funcs (#872)
This commit is contained in:
parent
0272a86292
commit
5e5404b459
31 changed files with 185 additions and 194 deletions
|
|
@ -12,7 +12,6 @@ import (
|
|||
"github.com/hashicorp/terraform-plugin-framework/types"
|
||||
"github.com/hashicorp/terraform-plugin-log/tflog"
|
||||
"github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core"
|
||||
"github.com/stackitcloud/terraform-provider-stackit/stackit/internal/utils"
|
||||
"github.com/stackitcloud/terraform-provider-stackit/stackit/internal/validate"
|
||||
|
||||
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
|
||||
|
|
@ -114,12 +113,7 @@ func (r *credentialsGroupDataSource) Read(ctx context.Context, req datasource.Re
|
|||
}
|
||||
projectId := model.ProjectId.ValueString()
|
||||
credentialsGroupId := model.CredentialsGroupId.ValueString()
|
||||
var region string
|
||||
if utils.IsUndefined(model.Region) {
|
||||
region = r.providerData.GetRegion()
|
||||
} else {
|
||||
region = model.Region.ValueString()
|
||||
}
|
||||
region := r.providerData.GetRegionWithOverride(model.Region)
|
||||
|
||||
ctx = tflog.SetField(ctx, "project_id", projectId)
|
||||
ctx = tflog.SetField(ctx, "credentials_group_id", credentialsGroupId)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue