Skip to content

Commit e1e1093

Browse files
committed
setting the partial state if error occurs. This way the resource is tainted and will be recreated on the next run.
1 parent 9ce515c commit e1e1093

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

internal/service/odb/network.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ package odb
55
import (
66
"context"
77
"errors"
8+
"github.com/hashicorp/terraform-plugin-framework/path"
89
"time"
910

1011
"github.com/aws/aws-sdk-go-v2/aws"
@@ -255,6 +256,7 @@ func (r *resourceNetwork) Create(ctx context.Context, req resource.CreateRequest
255256

256257
createTimeout := r.CreateTimeout(ctx, plan.Timeouts)
257258
_, err = waitNetworkCreated(ctx, conn, *out.OdbNetworkId, createTimeout)
259+
resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root(names.AttrID), aws.ToString(out.OdbNetworkId))...)
258260
if err != nil {
259261
resp.Diagnostics.AddError(
260262
create.ProblemStandardMessage(names.ODB, create.ErrActionWaitingForCreation, ResNameNetwork, plan.DisplayName.String(), err),

0 commit comments

Comments
 (0)