image
Generated on 13 Feb 2026
from digitalocean.cloud version
v1.2.1
Synopsis
Create, update, or delete custom images. Custom images allow you to create Droplets from your own disk images or import images from other cloud providers. View the API documentation at https://docs.digitalocean.com/reference/api/api-reference/#tag/Images.
Requirements
- pydo >= 0.1.3
- azure-core >= 1.26.1
Parameters
| Parameter | Choices / Default | Description |
|---|---|---|
client_override_optionsdict |
Client override options (developer use). For example, can be used to override the DigitalOcean API endpoint for an internal test suite. If provided, these options will knock out existing options. | |
descriptionstr |
An optional description for the image. | |
distributionstr |
The name of the distribution for the image. | |
idint |
The unique identifier of the image. Used for lookup when updating or deleting. | |
module_override_optionsdict |
Module override options (developer use). Can be used to override module options to support experimental or future options. If provided, these options will knock out existing options. | |
namestr / required |
The display name for the image. | |
regionstr |
The slug identifier for the region where the image will be available. | |
statestr |
Choices:
|
State of the resource, present to create, absent to destroy. |
tagslist / elements=str |
A list of tags to apply to the image. | |
timeoutint |
Default: 300 |
Polling timeout in seconds. |
tokenstr |
DigitalOcean API token. There are several environment variables which can be used to provide this value. DIGITALOCEAN_ACCESS_TOKEN, DIGITALOCEAN_TOKEN, DO_API_TOKEN, DO_API_KEY, DO_OAUTH_TOKEN and OAUTH_TOKEN |
|
urlstr |
The URL from which the custom image will be imported. Required when creating a new image. |
Examples
- name: Create custom image from URL
digitalocean.cloud.image:
token: "{{ token }}"
state: present
name: my-custom-image
url: https://example.com/my-image.qcow2
region: nyc3
distribution: Ubuntu
description: My custom Ubuntu image
- name: Update image name
digitalocean.cloud.image:
token: "{{ token }}"
state: present
name: my-renamed-image
id: 12345678
- name: Delete image
digitalocean.cloud.image:
token: "{{ token }}"
state: absent
name: my-custom-image
id: 12345678Return Values
| Key | Returned | Description |
|---|---|---|
errordict |
failure | DigitalOcean API error. Sample: |
imagedict |
always | Image information. Sample: |
msgstr |
always | Image result information. Sample: |