digitalocean / digitalocean/packer-plugin-digitalocean

Add option to skip snapshot creation

Open
#133 0 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
27
Forks
15
PR merge metrics
No merged PRs in 30d

Description

#### Description

The DigitalOcean builder could have an option to skip the snapshot creation.

Other builders like the AWS and GCP one already implement this, with the [`skip_create_ami`](https://developer.hashicorp.com/packer/integrations/hashicorp/amazon/latest/components/builder/ebs#ebs-specific-configuration-reference) and [`skip_create_image`](https://developer.hashicorp.com/packer/integrations/hashicorp/googlecompute/latest/components/builder/googlecompute#optional:) configuration options respectively.

#### Use Case(s)

This behavior would be useful in CI/CD environments, where we could test that an image configuration is valid in a pipeline, without actually creating the resource on DigitalOcean. Current alternatives require calling the DigitalOcean API to delete the snapshot after the long-running create snapshot and transfer snapshot steps are done.

#### Potential configuration

```hcl
source "digitalocean" "example" {
api_token = "YOUR API KEY"
image = "ubuntu-22-04-x64"
region = "nyc3"
size = "s-1vcpu-1gb"
ssh_username = "root"
# new option
skip_create_snapshot = true
}
```

#### Potential References

AWS and GCP builders do it on the `step_create_*.go` files, which seem equivalent to the `step_snapshot.go` in this repository.

- [AWS](https://github.com/hashicorp/packer-plugin-amazon/blob/v1.3.1/builder/ebs/step_create_ami.go#L39)
- [GCP](https://github.com/hashicorp/packer-plugin-googlecompute/blob/v1.1.4/builder/googlecompute/step_create_image.go#L31)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.