From 2addec9576477a9beedda0b3e998be1f82c7848b Mon Sep 17 00:00:00 2001 From: "Franky W." Date: Mon, 10 Jun 2024 12:33:11 +0200 Subject: [PATCH] Fix importing waiting room events There is currently a bug when importing a waiting room event because the value is out of range. The 3rd element of an array is indexed with value 2, not value 3 --- .changelog/3351.txt | 3 +++ .../sdkv2provider/resource_cloudflare_waiting_room_event.go | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 .changelog/3351.txt diff --git a/.changelog/3351.txt b/.changelog/3351.txt new file mode 100644 index 0000000000..135e94dbaf --- /dev/null +++ b/.changelog/3351.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/cloudflare_waiting_room_event: fix panic when trying to import a resource +``` diff --git a/internal/sdkv2provider/resource_cloudflare_waiting_room_event.go b/internal/sdkv2provider/resource_cloudflare_waiting_room_event.go index 69e2104550..168d0ef9c3 100644 --- a/internal/sdkv2provider/resource_cloudflare_waiting_room_event.go +++ b/internal/sdkv2provider/resource_cloudflare_waiting_room_event.go @@ -193,7 +193,7 @@ func resourceCloudflareWaitingRoomEventImport(ctx context.Context, d *schema.Res if len(idAttr) == 3 { zoneID = idAttr[0] waitingRoomID = idAttr[1] - waitingRoomEventID = idAttr[3] + waitingRoomEventID = idAttr[2] } else { return nil, fmt.Errorf("invalid id (\"%s\") specified, should be in format \"zoneID/waitingRoomID/eventID\" for import", d.Id()) }