chore(terraform): use a util func to build internal terraform id (#869)
This commit is contained in:
parent
801ef6033d
commit
b313ef6a39
72 changed files with 205 additions and 538 deletions
9
.github/docs/contribution-guide/resource.go
vendored
9
.github/docs/contribution-guide/resource.go
vendored
|
|
@ -16,6 +16,7 @@ import (
|
|||
"github.com/stackitcloud/terraform-provider-stackit/stackit/internal/conversion"
|
||||
"github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core"
|
||||
fooUtils "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/foo/utils"
|
||||
"github.com/stackitcloud/terraform-provider-stackit/stackit/internal/utils"
|
||||
|
||||
"github.com/stackitcloud/stackit-sdk-go/services/foo" // Import service "foo" from the STACKIT SDK for Go
|
||||
// (...)
|
||||
|
|
@ -264,13 +265,7 @@ func mapFields(barResp *foo.GetBarResponse, model *Model) error {
|
|||
bar := barResp.Bar
|
||||
model.BarId = types.StringPointerValue(bar.BarId)
|
||||
|
||||
idParts := []string{
|
||||
model.ProjectId.ValueString(),
|
||||
model.BarId.ValueString(),
|
||||
}
|
||||
model.Id = types.StringValue(
|
||||
strings.Join(idParts, core.Separator),
|
||||
)
|
||||
model.Id = utils.BuildInternalTerraformId(model.ProjectId.ValueString(), model.BarId.ValueString())
|
||||
|
||||
model.MyRequiredField = types.StringPointerValue(bar.MyRequiredField)
|
||||
model.MyOptionalField = types.StringPointerValue(bar.MyOptionalField)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue