DigitalOcean
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 the 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",
},
},
},
}));
}
}
package main
import (
"github.com/pulumi/pulumi-digitalocean/sdk/v4/go/digitalocean"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := digitalocean.GetImages(ctx, &GetImagesArgs{
Filters: []GetImagesFilter{
GetImagesFilter{
Key: "distribution",
Values: []string{
"Ubuntu",
},
},
},
}, nil)
if err != nil {
return err
}
return nil
})
}
Coming soon!
import pulumi
import pulumi_digitalocean as digitalocean
ubuntu = digitalocean.get_images(filters=[digitalocean.GetImagesFilterArgs(
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"],
}],
}));
Coming soon!
Using getImages
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getImages(args: GetImagesArgs, opts?: InvokeOptions): Promise<GetImagesResult>
function getImagesOutput(args: GetImagesOutputArgs, opts?: InvokeOptions): Output<GetImagesResult>
def get_images(filters: Optional[Sequence[GetImagesFilter]] = None,
sorts: Optional[Sequence[GetImagesSort]] = None,
opts: Optional[InvokeOptions] = None) -> GetImagesResult
def get_images_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetImagesFilterArgs]]]] = None,
sorts: Optional[pulumi.Input[Sequence[pulumi.Input[GetImagesSortArgs]]]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetImagesResult]
func GetImages(ctx *Context, args *GetImagesArgs, opts ...InvokeOption) (*GetImagesResult, error)
func GetImagesOutput(ctx *Context, args *GetImagesOutputArgs, opts ...InvokeOption) GetImagesResultOutput
> Note: This function is named GetImages
in the Go SDK.
public static class GetImages
{
public static Task<GetImagesResult> InvokeAsync(GetImagesArgs args, InvokeOptions? opts = null)
public static Output<GetImagesResult> Invoke(GetImagesInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetImagesResult> getImages(GetImagesArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
Function: digitalocean:index/getImages:getImages
Arguments:
# Arguments dictionary
The following arguments are supported:
- Filters
List<Pulumi.
Digital Ocean. Inputs. Get Images Filter> Filter the results. The
filter
block is documented below.- Sorts
List<Pulumi.
Digital Ocean. Inputs. Get Images Sort> Sort the results. The
sort
block is documented below.
- Filters
[]Get
Images Filter Filter the results. The
filter
block is documented below.- Sorts
[]Get
Images Sort Sort the results. The
sort
block is documented below.
- filters
List<Get
Images Filter> Filter the results. The
filter
block is documented below.- sorts
List<Get
Images Sort> Sort the results. The
sort
block is documented below.
- filters
Get
Images Filter[] Filter the results. The
filter
block is documented below.- sorts
Get
Images Sort[] Sort the results. The
sort
block is documented below.
- filters
Sequence[Get
Images Filter] Filter the results. The
filter
block is documented below.- sorts
Sequence[Get
Images Sort] Sort the results. The
sort
block is documented below.
- filters List<Property Map>
Filter the results. The
filter
block is documented below.- sorts List<Property Map>
Sort the results. The
sort
block 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
filter
andsort
criteria. 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.
- 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
filter
andsort
criteria. 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.
- Filters
[]Get
Images Filter - Sorts
[]Get
Images Sort
- id String
The provider-assigned unique ID for this managed resource.
- images
List<Get
Images Image> A set of images satisfying any
filter
andsort
criteria. 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.
- filters
List<Get
Images Filter> - sorts
List<Get
Images Sort>
- id string
The provider-assigned unique ID for this managed resource.
- images
Get
Images Image[] A set of images satisfying any
filter
andsort
criteria. 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.
- filters
Get
Images Filter[] - sorts
Get
Images Sort[]
- id str
The provider-assigned unique ID for this managed resource.
- images
Sequence[Get
Images Image] A set of images satisfying any
filter
andsort
criteria. 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.
- filters
Sequence[Get
Images Filter] - sorts
Sequence[Get
Images Sort]
- id String
The provider-assigned unique ID for this managed resource.
- images List<Property Map>
A set of images satisfying any
filter
andsort
criteria. 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.
- filters List<Property Map>
- sorts List<Property Map>
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
key
field. Only retrieves images where thekey
field takes on one or more of the values provided here.- All bool
Set to
true
to require that a field match all of thevalues
instead of just one or more of them. This is useful when matching against multi-valued fields such as lists or sets where you want to ensure that all of thevalues
are present in the list or set.- Match
By string One of
exact
(default),re
, orsubstring
. For string-typed fields, specifyre
to match by using thevalues
as regular expressions, or specifysubstring
to match by treating thevalues
as substrings to find within the string field.
- 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
key
field. Only retrieves images where thekey
field takes on one or more of the values provided here.- All bool
Set to
true
to require that a field match all of thevalues
instead of just one or more of them. This is useful when matching against multi-valued fields such as lists or sets where you want to ensure that all of thevalues
are present in the list or set.- Match
By string One of
exact
(default),re
, orsubstring
. For string-typed fields, specifyre
to match by using thevalues
as regular expressions, or specifysubstring
to match by treating thevalues
as substrings to find within the string field.
- 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
key
field. Only retrieves images where thekey
field takes on one or more of the values provided here.- all Boolean
Set to
true
to require that a field match all of thevalues
instead of just one or more of them. This is useful when matching against multi-valued fields such as lists or sets where you want to ensure that all of thevalues
are present in the list or set.- match
By String One of
exact
(default),re
, orsubstring
. For string-typed fields, specifyre
to match by using thevalues
as regular expressions, or specifysubstring
to match by treating thevalues
as substrings to find within the string field.
- 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
key
field. Only retrieves images where thekey
field takes on one or more of the values provided here.- all boolean
Set to
true
to require that a field match all of thevalues
instead of just one or more of them. This is useful when matching against multi-valued fields such as lists or sets where you want to ensure that all of thevalues
are present in the list or set.- match
By string One of
exact
(default),re
, orsubstring
. For string-typed fields, specifyre
to match by using thevalues
as regular expressions, or specifysubstring
to match by treating thevalues
as substrings to find within the string field.
- 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 Sequence[str]
A list of values to match against the
key
field. Only retrieves images where thekey
field takes on one or more of the values provided here.- all bool
Set to
true
to require that a field match all of thevalues
instead of just one or more of them. This is useful when matching against multi-valued fields such as lists or sets where you want to ensure that all of thevalues
are present in the list or set.- match_
by str One of
exact
(default),re
, orsubstring
. For string-typed fields, specifyre
to match by using thevalues
as regular expressions, or specifysubstring
to match by treating thevalues
as substrings to find within the string field.
- 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
key
field. Only retrieves images where thekey
field takes on one or more of the values provided here.- all Boolean
Set to
true
to require that a field match all of thevalues
instead of just one or more of them. This is useful when matching against multi-valued fields such as lists or sets where you want to ensure that all of thevalues
are present in the list or set.- match
By String One of
exact
(default),re
, orsubstring
. For string-typed fields, specifyre
to match by using thevalues
as regular expressions, or specifysubstring
to match by treating thevalues
as substrings to find within the string field.
GetImagesImage
- Created string
- Description string
- Distribution string
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.
- Error
Message string - Id int
- Image string
The id of the image (legacy parameter).
- Min
Disk intSize - Name string
- Private bool
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 imagecreated
: When the image was createdstatus
: Current status of the imageerror_message
: Any applicable error message pertaining to the image
- Regions List<string>
- Size
Gigabytes double - Slug string
- Status string
- List<string>
- Type string
- Created string
- Description string
- Distribution string
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.
- Error
Message string - Id int
- Image string
The id of the image (legacy parameter).
- Min
Disk intSize - Name string
- Private bool
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 imagecreated
: When the image was createdstatus
: Current status of the imageerror_message
: Any applicable error message pertaining to the image
- Regions []string
- Size
Gigabytes float64 - Slug string
- Status string
- []string
- Type string
- created String
- description String
- distribution String
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.
- error
Message String - id Integer
- image String
The id of the image (legacy parameter).
- min
Disk IntegerSize - name String
- private_ Boolean
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 imagecreated
: When the image was createdstatus
: Current status of the imageerror_message
: Any applicable error message pertaining to the image
- regions List<String>
- size
Gigabytes Double - slug String
- status String
- List<String>
- type String
- created string
- description string
- distribution string
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.
- error
Message string - id number
- image string
The id of the image (legacy parameter).
- min
Disk numberSize - name string
- private boolean
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 imagecreated
: When the image was createdstatus
: Current status of the imageerror_message
: Any applicable error message pertaining to the image
- regions string[]
- size
Gigabytes number - slug string
- status string
- string[]
- type string
- created str
- description str
- distribution str
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.
- error_
message str - id int
- image str
The id of the image (legacy parameter).
- min_
disk_ intsize - name str
- private bool
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 imagecreated
: When the image was createdstatus
: Current status of the imageerror_message
: Any applicable error message pertaining to the image
- regions Sequence[str]
- size_
gigabytes float - slug str
- status str
- Sequence[str]
- type str
- created String
- description String
- distribution String
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.
- error
Message String - id Number
- image String
The id of the image (legacy parameter).
- min
Disk NumberSize - name String
- private Boolean
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 imagecreated
: When the image was createdstatus
: Current status of the imageerror_message
: Any applicable error message pertaining to the image
- regions List<String>
- size
Gigabytes Number - slug String
- status String
- List<String>
- type String
GetImagesSort
Package Details
- Repository
- https://github.com/pulumi/pulumi-digitalocean
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
digitalocean
Terraform Provider.