From 1b6fa6fd36a9f4775d6ec8a4166e4c5f1fed1f86 Mon Sep 17 00:00:00 2001 From: andypowell Date: Mon, 17 Feb 2025 15:53:16 +0000 Subject: [PATCH 1/2] add attach_on_boot to the resource_volume_attachement schema --- civo/volume/resource_volume_attachment.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/civo/volume/resource_volume_attachment.go b/civo/volume/resource_volume_attachment.go index 1c1f86ef..c7009e92 100644 --- a/civo/volume/resource_volume_attachment.go +++ b/civo/volume/resource_volume_attachment.go @@ -39,6 +39,13 @@ func ResourceVolumeAttachment() *schema.Resource { ForceNew: true, Description: "The region for the volume attachment", }, + "attach_at_boot": { + Type: schema.TypeBool, + Optional: true, + Default: false, + ForceNew: true, + Description: "Whether to attach the instance to the volume at boot", + }, }, CreateContext: resourceVolumeAttachmentCreate, ReadContext: resourceVolumeAttachmentRead, From 3c0ea98fc375725be7451d443f22f4a594a2a06d Mon Sep 17 00:00:00 2001 From: andypowell Date: Mon, 17 Feb 2025 16:06:16 +0000 Subject: [PATCH 2/2] update test --- civo/volume/resource_volume_attachment_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/civo/volume/resource_volume_attachment_test.go b/civo/volume/resource_volume_attachment_test.go index 6b309176..772c127f 100644 --- a/civo/volume/resource_volume_attachment_test.go +++ b/civo/volume/resource_volume_attachment_test.go @@ -37,6 +37,7 @@ func TestAccCivoVolumeAttachment_basic(t *testing.T) { resource.TestCheckResourceAttrSet(resName, "id"), resource.TestCheckResourceAttrSet(resName, "instance_id"), resource.TestCheckResourceAttrSet(resName, "volume_id"), + resource.TestCheckResourceAttrSet(resName, "attach_on_boot"), ), }, }, @@ -98,6 +99,7 @@ resource "civo_volume_attachment" "foobar" { instance_id = civo_instance.vm.id volume_id = civo_volume.foo.id region = "LON1" + attach_on_boot = true } `, name, name) }