Skip to content

Commit

Permalink
add attach_on_boot to the resource_volume_attachement schema (#369)
Browse files Browse the repository at this point in the history
* add attach_on_boot to the resource_volume_attachement schema
* update test
  • Loading branch information
dippydocus authored Feb 17, 2025
1 parent 9ba8c81 commit d40aaaa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions civo/volume/resource_volume_attachment.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions civo/volume/resource_volume_attachment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
),
},
},
Expand Down Expand Up @@ -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)
}

0 comments on commit d40aaaa

Please sign in to comment.