Skip to content
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

Add more docs examples on using droplet snapshots #846

Merged
merged 1 commit into from
Jul 12, 2022
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
Add more docs examples on using droplet snapshots
  • Loading branch information
mkjmdski committed Jul 12, 2022
commit 3783c011b2930750d9970e5f7624ce901a753216
18 changes: 18 additions & 0 deletions docs/data-sources/droplet_snapshot.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,24 @@ data "digitalocean_droplet_snapshot" "web-snapshot" {
}
```

Create image from snapshot:

```hcl
data "digitalocean_droplet_snapshot" "web-snapshot" {
name_regex = "^web"
region = "nyc3"
most_recent = true
}

resource "digitalocean_droplet" "from-snapshot" {
image = data.digitalocean_droplet_snapshot.web-snapshot.id
name = "web-02"
region = "nyc3"
size = "s-2vcpu-4gb"
}
```


## Argument Reference

* `name` - (Optional) The name of the Droplet snapshot.
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/droplet.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ resource "digitalocean_droplet" "web" {

The following arguments are supported:

* `image` - (Required) The Droplet image ID or slug.
* `image` - (Required) The Droplet image ID or slug. This could be either image ID or droplet snapshot ID.
* `name` - (Required) The Droplet name.
* `region` - (Required) The region to start in.
* `size` - (Required) The unique slug that indentifies the type of Droplet. You can find a list of available slugs on [DigitalOcean API documentation](https://docs.digitalocean.com/reference/api/api-reference/#tag/Sizes).
Expand Down
8 changes: 8 additions & 0 deletions docs/resources/droplet_snapshot.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ resource "digitalocean_droplet_snapshot" "web-snapshot" {
droplet_id = digitalocean_droplet.web.id
name = "web-snapshot-01"
}


resource "digitalocean_droplet" "from-snapshot" {
image = digitalocean_droplet_snapshot.web-snapshot.id
name = "web-02"
region = "nyc3"
size = "s-2vcpu-4gb"
}
```

## Argument Reference
Expand Down