GetImages
Get information on images for use in other resources (e.g. creating a Droplet based on a snapshot), with the ability to filter and sort the results. If no filters are specified, all images will be returned.
This data source is useful if the image in question is not managed by this provider or you need to utilize any of the image’s data.
Note: You can use the digitalocean..getImage data source to obtain metadata
about a single image if you already know the slug, unique name, or id to retrieve.
Example Usage
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
class MyStack : Stack
{
public MyStack()
{
var ubuntu = Output.Create(DigitalOcean.GetImages.InvokeAsync(new DigitalOcean.GetImagesArgs
{
Filters =
{
new DigitalOcean.Inputs.GetImagesFilterArgs
{
Key = "distribution",
Values =
{
"Ubuntu",
},
},
},
}));
}
}
Coming soon!
import pulumi
import pulumi_digitalocean as digitalocean
ubuntu = digitalocean.get_images(filters=[{
"key": "distribution",
"values": ["Ubuntu"],
}])import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";
const ubuntu = pulumi.output(digitalocean.getImages({
filters: [{
key: "distribution",
values: ["Ubuntu"],
}],
}, { async: true }));Using GetImages
function getImages(args: GetImagesArgs, opts?: InvokeOptions): Promise<GetImagesResult>function get_images(filters=None, sorts=None, opts=None)func GetImages(ctx *Context, args *GetImagesArgs, opts ...InvokeOption) (*GetImagesResult, error)public static class GetImages {
public static Task<GetImagesResult> InvokeAsync(GetImagesArgs args, InvokeOptions? opts = null)
}The following arguments are supported:
- Filters
List<Pulumi.
Digital Ocean. Inputs. Get Images Filter Args> Filter the results. The
filterblock is documented below.- Sorts
List<Pulumi.
Digital Ocean. Inputs. Get Images Sort Args> Sort the results. The
sortblock is documented below.
- Filters
[]Get
Images Filter Filter the results. The
filterblock is documented below.- Sorts
[]Get
Images Sort Sort the results. The
sortblock is documented below.
- filters
Get
Images Filter[] Filter the results. The
filterblock is documented below.- sorts
Get
Images Sort[] Sort the results. The
sortblock is documented below.
- filters
List[Get
Images Filter] Filter the results. The
filterblock is documented below.- sorts
List[Get
Images Sort] Sort the results. The
sortblock is documented below.
GetImages Result
The following output properties are available:
- Id string
The provider-assigned unique ID for this managed resource.
- Images
List<Pulumi.
Digital Ocean. Outputs. Get Images Image> A set of images satisfying any
filterandsortcriteria. Each image has the following attributes:
-slug: Unique text identifier of the image. -id: The ID of the image. -name: The name of the image. -type: Type of the image. -distribution- The name of the distribution of the OS of the image. -min_disk_size: The minimum ‘disk’ required for the image. -size_gigabytes: The size of the image in GB. -private- Is image a public image or not. Public images represent Linux distributions or One-Click Applications, while non-public images represent snapshots and backups and are only available within your account. -regions: A set of the regions that the image is available in. -tags: A set of tags applied to the image -created: When the image was created -status: Current status of the image -error_message: Any applicable error message pertaining to the image -image- The id of the image (legacy parameter).- Filters
List<Pulumi.
Digital Ocean. Outputs. Get Images Filter> - Sorts
List<Pulumi.
Digital Ocean. Outputs. Get Images Sort>
- Id string
The provider-assigned unique ID for this managed resource.
- Images
[]Get
Images Image A set of images satisfying any
filterandsortcriteria. Each image has the following attributes:
-slug: Unique text identifier of the image. -id: The ID of the image. -name: The name of the image. -type: Type of the image. -distribution- The name of the distribution of the OS of the image. -min_disk_size: The minimum ‘disk’ required for the image. -size_gigabytes: The size of the image in GB. -private- Is image a public image or not. Public images represent Linux distributions or One-Click Applications, while non-public images represent snapshots and backups and are only available within your account. -regions: A set of the regions that the image is available in. -tags: A set of tags applied to the image -created: When the image was created -status: Current status of the image -error_message: Any applicable error message pertaining to the image -image- The id of the image (legacy parameter).- Filters
[]Get
Images Filter - Sorts
[]Get
Images Sort
- id string
The provider-assigned unique ID for this managed resource.
- images
Get
Images Image[] A set of images satisfying any
filterandsortcriteria. Each image has the following attributes:
-slug: Unique text identifier of the image. -id: The ID of the image. -name: The name of the image. -type: Type of the image. -distribution- The name of the distribution of the OS of the image. -min_disk_size: The minimum ‘disk’ required for the image. -size_gigabytes: The size of the image in GB. -private- Is image a public image or not. Public images represent Linux distributions or One-Click Applications, while non-public images represent snapshots and backups and are only available within your account. -regions: A set of the regions that the image is available in. -tags: A set of tags applied to the image -created: When the image was created -status: Current status of the image -error_message: Any applicable error message pertaining to the image -image- The id of the image (legacy parameter).- filters
Get
Images Filter[] - sorts
Get
Images Sort[]
- id str
The provider-assigned unique ID for this managed resource.
- images
List[Get
Images Image] A set of images satisfying any
filterandsortcriteria. Each image has the following attributes:
-slug: Unique text identifier of the image. -id: The ID of the image. -name: The name of the image. -type: Type of the image. -distribution- The name of the distribution of the OS of the image. -min_disk_size: The minimum ‘disk’ required for the image. -size_gigabytes: The size of the image in GB. -private- Is image a public image or not. Public images represent Linux distributions or One-Click Applications, while non-public images represent snapshots and backups and are only available within your account. -regions: A set of the regions that the image is available in. -tags: A set of tags applied to the image -created: When the image was created -status: Current status of the image -error_message: Any applicable error message pertaining to the image -image- The id of the image (legacy parameter).- filters
List[Get
Images Filter] - sorts
List[Get
Images Sort]
Supporting Types
GetImagesFilter
- Key string
Filter the images by this key. This may be one of
distribution,error_message,id,image,min_disk_size,name,private,regions,size_gigabytes,slug,status,tags, ortype.- Values List<string>
A list of values to match against the
keyfield. Only retrieves images where thekeyfield takes on one or more of the values provided here.
- Key string
Filter the images by this key. This may be one of
distribution,error_message,id,image,min_disk_size,name,private,regions,size_gigabytes,slug,status,tags, ortype.- Values []string
A list of values to match against the
keyfield. Only retrieves images where thekeyfield takes on one or more of the values provided here.
- key string
Filter the images by this key. This may be one of
distribution,error_message,id,image,min_disk_size,name,private,regions,size_gigabytes,slug,status,tags, ortype.- values string[]
A list of values to match against the
keyfield. Only retrieves images where thekeyfield takes on one or more of the values provided here.
- key str
Filter the images by this key. This may be one of
distribution,error_message,id,image,min_disk_size,name,private,regions,size_gigabytes,slug,status,tags, ortype.- values List[str]
A list of values to match against the
keyfield. Only retrieves images where thekeyfield takes on one or more of the values provided here.
GetImagesImage
See the output API doc for this type.
See the output API doc for this type.
See the output API doc for this type.
GetImagesSort
Package Details
- Repository
- https://github.com/pulumi/pulumi-digitalocean
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
digitaloceanTerraform Provider.