Skip to content

add attach_on_boot to the resource_volume_attachement schema #369

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
}
Loading