Skip to content

Commit d40aaaa

Browse files
authored
add attach_on_boot to the resource_volume_attachement schema (#369)
* add attach_on_boot to the resource_volume_attachement schema * update test
1 parent 9ba8c81 commit d40aaaa

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

Diff for: civo/volume/resource_volume_attachment.go

+7
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ func ResourceVolumeAttachment() *schema.Resource {
3939
ForceNew: true,
4040
Description: "The region for the volume attachment",
4141
},
42+
"attach_at_boot": {
43+
Type: schema.TypeBool,
44+
Optional: true,
45+
Default: false,
46+
ForceNew: true,
47+
Description: "Whether to attach the instance to the volume at boot",
48+
},
4249
},
4350
CreateContext: resourceVolumeAttachmentCreate,
4451
ReadContext: resourceVolumeAttachmentRead,

Diff for: civo/volume/resource_volume_attachment_test.go

+2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ func TestAccCivoVolumeAttachment_basic(t *testing.T) {
3737
resource.TestCheckResourceAttrSet(resName, "id"),
3838
resource.TestCheckResourceAttrSet(resName, "instance_id"),
3939
resource.TestCheckResourceAttrSet(resName, "volume_id"),
40+
resource.TestCheckResourceAttrSet(resName, "attach_on_boot"),
4041
),
4142
},
4243
},
@@ -98,6 +99,7 @@ resource "civo_volume_attachment" "foobar" {
9899
instance_id = civo_instance.vm.id
99100
volume_id = civo_volume.foo.id
100101
region = "LON1"
102+
attach_on_boot = true
101103
}
102104
`, name, name)
103105
}

0 commit comments

Comments
 (0)