Skip to content

Commit

Permalink
r/aws_db_instance: Fix resource leak on error during creation.
Browse files Browse the repository at this point in the history
  • Loading branch information
mergenci committed Jul 4, 2024
1 parent 8d7cddc commit ddd8d36
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .changelog/38252.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
resource/aws_db_instance: Fix resource leak on error during creation.
```
1 change: 1 addition & 0 deletions internal/service/rds/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -1768,6 +1768,7 @@ func resourceInstanceCreate(ctx context.Context, d *schema.ResourceData, meta in
var instance *rds.DBInstance
var err error
if instance, err = waitDBInstanceAvailableSDKv1(ctx, conn, identifier, d.Timeout(schema.TimeoutCreate)); err != nil {
d.SetId(resourceID)
return sdkdiag.AppendErrorf(diags, "waiting for RDS DB Instance (%s) create: %s", identifier, err)
}

Expand Down

0 comments on commit ddd8d36

Please sign in to comment.