Skip to content

Commit 1a2693c

Browse files
authored
Add default timeout for snapshot create (#536)
* Add default timeout for snapshot create * Ignore magic number * Add documentation for the snapshot timeouts
1 parent 4ccd6ca commit 1a2693c

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

vultr/resource_vultr_snapshot.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ func resourceVultrSnapshot() *schema.Resource {
5555
Computed: true,
5656
},
5757
},
58+
Timeouts: &schema.ResourceTimeout{
59+
Create: schema.DefaultTimeout(30 * time.Minute), //nolint:mnd
60+
},
5861
}
5962
}
6063

website/docs/r/snapshot.html.markdown

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,23 @@ The following arguments are supported:
3434
* `instance_id` - (Required) ID of a given instance that you want to create a snapshot from.
3535
* `description` - (Optional) The description for the given snapshot.
3636

37+
Snapshots often exceed the default timeout built in to all create requests in
38+
the provider. In order to customize that, you may specify a custome value in a
39+
`timeouts` block of the resource definition
40+
41+
* `timeouts` - (Optional) The create timeout value can be manually set
42+
43+
``` hcl
44+
resource "vultr_snapshot" "sn" {
45+
instance_id = resource.vultr_instance.test-inst.id
46+
description = "terraform timeout test"
47+
48+
timeouts {
49+
create = "60m"
50+
}
51+
}
52+
```
53+
3754
## Attributes Reference
3855

3956
The following attributes are exported:

0 commit comments

Comments
 (0)