digitalocean_custom_image
Generated on 14 Oct 2025
from Terraform version
v2.68.0
Provides a resource which can be used to create a custom image from a URL. The URL must point to an image in one of the following file formats:
- Raw (.img) with an MBR or GPT partition table
- qcow2
- VHDX
- VDI
- VMDK
The image may be compressed using gzip or bzip2. See the DigitalOcean Custom Image documentation for additional requirements.
Example Usage
resource "digitalocean_custom_image" "flatcar" {
name = "flatcar"
url = "https://stable.release.flatcar-linux.net/amd64-usr/2605.7.0/flatcar_production_digitalocean_image.bin.bz2"
regions = ["nyc3"]
}
resource "digitalocean_droplet" "example" {
image = digitalocean_custom_image.flatcar.id
name = "example-01"
region = "nyc3"
size = "s-1vcpu-1gb"
ssh_keys = [12345]
}Argument Reference
The following arguments are supported:
name- (Required) A name for the Custom Image.url- (Required) A URL from which the custom Linux virtual machine image may be retrieved.regions- (Required) A list of regions. (Currently only one is supported).description- An optional description for the image.distribution- An optional distribution name for the image. Valid values are documented heretags- A list of optional tags for the image.
Attributes Reference
The following attributes are exported:
image_idA unique number that can be used to identify and reference a specific image.typeDescribes the kind of image.slugA uniquely identifying string for each image.publicIndicates whether the image in question is public or not.min_disk_sizeThe minimum disk size in GB required for a Droplet to use this image.size_gigabytesThe size of the image in gigabytes.created_atA time value given in ISO8601 combined date and time format that represents when the image was created.statusA status string indicating the state of a custom image.