DigitalOcean
getImage
Get information on an image for use in other resources (e.g. creating a Droplet based on snapshot). This data source provides all of the image properties as configured on your DigitalOcean account. This is useful if the image in question is not managed by the provider or you need to utilize any of the image’s data.
An error is triggered if zero or more than one result is returned by the query.
Example Usage
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
class MyStack : Stack
{
public MyStack()
{
var example1 = Output.Create(DigitalOcean.GetImage.InvokeAsync(new DigitalOcean.GetImageArgs
{
Name = "example-1.0.0",
}));
}
}
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.GetImage(ctx, &GetImageArgs{
Name: pulumi.StringRef("example-1.0.0"),
}, nil)
if err != nil {
return err
}
return nil
})
}
package generated_program;
import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var example1 = Output.of(DigitaloceanFunctions.getImage(GetImageArgs.builder()
.name("example-1.0.0")
.build()));
}
}
import pulumi
import pulumi_digitalocean as digitalocean
example1 = digitalocean.get_image(name="example-1.0.0")
import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";
const example1 = pulumi.output(digitalocean.getImage({
name: "example-1.0.0",
}));
variables:
example1:
Fn::Invoke:
Function: digitalocean:getImage
Arguments:
name: example-1.0.0
Using getImage
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 getImage(args: GetImageArgs, opts?: InvokeOptions): Promise<GetImageResult>
function getImageOutput(args: GetImageOutputArgs, opts?: InvokeOptions): Output<GetImageResult>
def get_image(id: Optional[int] = None,
name: Optional[str] = None,
slug: Optional[str] = None,
source: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetImageResult
def get_image_output(id: Optional[pulumi.Input[int]] = None,
name: Optional[pulumi.Input[str]] = None,
slug: Optional[pulumi.Input[str]] = None,
source: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetImageResult]
func GetImage(ctx *Context, args *GetImageArgs, opts ...InvokeOption) (*GetImageResult, error)
func GetImageOutput(ctx *Context, args *GetImageOutputArgs, opts ...InvokeOption) GetImageResultOutput
> Note: This function is named GetImage
in the Go SDK.
public static class GetImage
{
public static Task<GetImageResult> InvokeAsync(GetImageArgs args, InvokeOptions? opts = null)
public static Output<GetImageResult> Invoke(GetImageInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetImageResult> getImage(GetImageArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
Function: digitalocean:index/getImage:getImage
Arguments:
# Arguments dictionary
The following arguments are supported:
getImage Result
The following output properties are available:
- 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
- Source 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
- Source 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
- source 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
- source 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
- source 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
- source String
Package Details
- Repository
- https://github.com/pulumi/pulumi-digitalocean
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
digitalocean
Terraform Provider.