Skip to content

Add default timeout for snapshot create #536

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
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
3 changes: 3 additions & 0 deletions vultr/resource_vultr_snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ func resourceVultrSnapshot() *schema.Resource {
Computed: true,
},
},
Timeouts: &schema.ResourceTimeout{
Create: schema.DefaultTimeout(30 * time.Minute), //nolint:mnd
},
}
}

Expand Down
17 changes: 17 additions & 0 deletions website/docs/r/snapshot.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,23 @@ The following arguments are supported:
* `instance_id` - (Required) ID of a given instance that you want to create a snapshot from.
* `description` - (Optional) The description for the given snapshot.

Snapshots often exceed the default timeout built in to all create requests in
the provider. In order to customize that, you may specify a custome value in a
`timeouts` block of the resource definition

* `timeouts` - (Optional) The create timeout value can be manually set

``` hcl
resource "vultr_snapshot" "sn" {
instance_id = resource.vultr_instance.test-inst.id
description = "terraform timeout test"

timeouts {
create = "60m"
}
}
```

## Attributes Reference

The following attributes are exported:
Expand Down
Loading