fix(dns): store IDs immediately after provisioning (#1022)
relates to STACKITTPR-373
This commit is contained in:
parent
f0433984f4
commit
4103c33fd2
4 changed files with 133 additions and 18 deletions
|
|
@ -7,6 +7,8 @@ import (
|
|||
"regexp"
|
||||
"strings"
|
||||
|
||||
"github.com/hashicorp/terraform-plugin-framework/tfsdk"
|
||||
|
||||
"github.com/hashicorp/terraform-plugin-framework/attr"
|
||||
"github.com/hashicorp/terraform-plugin-framework/diag"
|
||||
"github.com/hashicorp/terraform-plugin-framework/path"
|
||||
|
|
@ -186,3 +188,11 @@ func CheckListRemoval(ctx context.Context, configModelList, planModelList types.
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// SetAndLogStateFields writes the given map of key-value pairs to the state
|
||||
func SetAndLogStateFields(ctx context.Context, diags *diag.Diagnostics, state *tfsdk.State, values map[string]any) {
|
||||
for key, val := range values {
|
||||
ctx = tflog.SetField(ctx, key, val)
|
||||
diags.Append(state.SetAttribute(ctx, path.Root(key), val)...)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue