ucloud.getImages
Explore with Pulumi AI
This data source providers a list of available image resources according to their availability zone, image ID and other fields.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as ucloud from "@pulumi/ucloud";
const example = ucloud.getImages({
availabilityZone: "cn-bj2-02",
imageType: "base",
nameRegex: "^CentOS 7.[1-2] 64",
mostRecent: true,
});
export const first = example.then(example => example.images?.[0]?.id);
import pulumi
import pulumi_ucloud as ucloud
example = ucloud.get_images(availability_zone="cn-bj2-02",
image_type="base",
name_regex="^CentOS 7.[1-2] 64",
most_recent=True)
pulumi.export("first", example.images[0].id)
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/ucloud/ucloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := ucloud.GetImages(ctx, &ucloud.GetImagesArgs{
AvailabilityZone: pulumi.StringRef("cn-bj2-02"),
ImageType: pulumi.StringRef("base"),
NameRegex: pulumi.StringRef("^CentOS 7.[1-2] 64"),
MostRecent: pulumi.BoolRef(true),
}, nil)
if err != nil {
return err
}
ctx.Export("first", example.Images[0].Id)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ucloud = Pulumi.Ucloud;
return await Deployment.RunAsync(() =>
{
var example = Ucloud.GetImages.Invoke(new()
{
AvailabilityZone = "cn-bj2-02",
ImageType = "base",
NameRegex = "^CentOS 7.[1-2] 64",
MostRecent = true,
});
return new Dictionary<string, object?>
{
["first"] = example.Apply(getImagesResult => getImagesResult.Images[0]?.Id),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ucloud.UcloudFunctions;
import com.pulumi.ucloud.inputs.GetImagesArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var example = UcloudFunctions.getImages(GetImagesArgs.builder()
.availabilityZone("cn-bj2-02")
.imageType("base")
.nameRegex("^CentOS 7.[1-2] 64")
.mostRecent(true)
.build());
ctx.export("first", example.applyValue(getImagesResult -> getImagesResult.images()[0].id()));
}
}
variables:
example:
fn::invoke:
function: ucloud:getImages
arguments:
availabilityZone: cn-bj2-02
imageType: base
nameRegex: ^CentOS 7.[1-2] 64
mostRecent: true
outputs:
first: ${example.images[0].id}
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(availability_zone: Optional[str] = None,
id: Optional[str] = None,
ids: Optional[Sequence[str]] = None,
image_id: Optional[str] = None,
image_type: Optional[str] = None,
most_recent: Optional[bool] = None,
name_regex: Optional[str] = None,
os_type: Optional[str] = None,
output_file: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetImagesResult
def get_images_output(availability_zone: Optional[pulumi.Input[str]] = None,
id: Optional[pulumi.Input[str]] = None,
ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
image_id: Optional[pulumi.Input[str]] = None,
image_type: Optional[pulumi.Input[str]] = None,
most_recent: Optional[pulumi.Input[bool]] = None,
name_regex: Optional[pulumi.Input[str]] = None,
os_type: Optional[pulumi.Input[str]] = None,
output_file: Optional[pulumi.Input[str]] = 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)
public static Output<GetImagesResult> getImages(GetImagesArgs args, InvokeOptions options)
fn::invoke:
function: ucloud:index/getImages:getImages
arguments:
# arguments dictionary
The following arguments are supported:
- Availability
Zone string - Availability zone where images are located. such as:
cn-bj2-02
. You may refer to list of availability zone. - Id string
- The ID of image.
- Ids List<string>
A list of image IDs, all the images belong to this region will be retrieved if the ID is
[]
.Note this argument conflicts with
image_id
.- Image
Id string The ID of image.
Note this argument conflicts with
ids
.- Image
Type string - The type of image. Possible values are:
base
as standard image,business
as owned by market place, andcustom
as custom-image, all the image types will be retrieved by default. - Most
Recent bool - If more than one result is returned, use the most recent image.
- Name
Regex string - A regex string to filter resulting images by name. (Such as:
^CentOS 7.[1-2] 64
means CentOS 7.1 of 64-bit operating system or CentOS 7.2 of 64-bit operating system, "^Ubuntu 16.04 64" means Ubuntu 16.04 of 64-bit operating system). - Os
Type string - The type of OS. Possible values are:
linux
andwindows
, all the OS types will be retrieved by default. - Output
File string - File name where to save data source results (after running
pulumi preview
).
- Availability
Zone string - Availability zone where images are located. such as:
cn-bj2-02
. You may refer to list of availability zone. - Id string
- The ID of image.
- Ids []string
A list of image IDs, all the images belong to this region will be retrieved if the ID is
[]
.Note this argument conflicts with
image_id
.- Image
Id string The ID of image.
Note this argument conflicts with
ids
.- Image
Type string - The type of image. Possible values are:
base
as standard image,business
as owned by market place, andcustom
as custom-image, all the image types will be retrieved by default. - Most
Recent bool - If more than one result is returned, use the most recent image.
- Name
Regex string - A regex string to filter resulting images by name. (Such as:
^CentOS 7.[1-2] 64
means CentOS 7.1 of 64-bit operating system or CentOS 7.2 of 64-bit operating system, "^Ubuntu 16.04 64" means Ubuntu 16.04 of 64-bit operating system). - Os
Type string - The type of OS. Possible values are:
linux
andwindows
, all the OS types will be retrieved by default. - Output
File string - File name where to save data source results (after running
pulumi preview
).
- availability
Zone String - Availability zone where images are located. such as:
cn-bj2-02
. You may refer to list of availability zone. - id String
- The ID of image.
- ids List<String>
A list of image IDs, all the images belong to this region will be retrieved if the ID is
[]
.Note this argument conflicts with
image_id
.- image
Id String The ID of image.
Note this argument conflicts with
ids
.- image
Type String - The type of image. Possible values are:
base
as standard image,business
as owned by market place, andcustom
as custom-image, all the image types will be retrieved by default. - most
Recent Boolean - If more than one result is returned, use the most recent image.
- name
Regex String - A regex string to filter resulting images by name. (Such as:
^CentOS 7.[1-2] 64
means CentOS 7.1 of 64-bit operating system or CentOS 7.2 of 64-bit operating system, "^Ubuntu 16.04 64" means Ubuntu 16.04 of 64-bit operating system). - os
Type String - The type of OS. Possible values are:
linux
andwindows
, all the OS types will be retrieved by default. - output
File String - File name where to save data source results (after running
pulumi preview
).
- availability
Zone string - Availability zone where images are located. such as:
cn-bj2-02
. You may refer to list of availability zone. - id string
- The ID of image.
- ids string[]
A list of image IDs, all the images belong to this region will be retrieved if the ID is
[]
.Note this argument conflicts with
image_id
.- image
Id string The ID of image.
Note this argument conflicts with
ids
.- image
Type string - The type of image. Possible values are:
base
as standard image,business
as owned by market place, andcustom
as custom-image, all the image types will be retrieved by default. - most
Recent boolean - If more than one result is returned, use the most recent image.
- name
Regex string - A regex string to filter resulting images by name. (Such as:
^CentOS 7.[1-2] 64
means CentOS 7.1 of 64-bit operating system or CentOS 7.2 of 64-bit operating system, "^Ubuntu 16.04 64" means Ubuntu 16.04 of 64-bit operating system). - os
Type string - The type of OS. Possible values are:
linux
andwindows
, all the OS types will be retrieved by default. - output
File string - File name where to save data source results (after running
pulumi preview
).
- availability_
zone str - Availability zone where images are located. such as:
cn-bj2-02
. You may refer to list of availability zone. - id str
- The ID of image.
- ids Sequence[str]
A list of image IDs, all the images belong to this region will be retrieved if the ID is
[]
.Note this argument conflicts with
image_id
.- image_
id str The ID of image.
Note this argument conflicts with
ids
.- image_
type str - The type of image. Possible values are:
base
as standard image,business
as owned by market place, andcustom
as custom-image, all the image types will be retrieved by default. - most_
recent bool - If more than one result is returned, use the most recent image.
- name_
regex str - A regex string to filter resulting images by name. (Such as:
^CentOS 7.[1-2] 64
means CentOS 7.1 of 64-bit operating system or CentOS 7.2 of 64-bit operating system, "^Ubuntu 16.04 64" means Ubuntu 16.04 of 64-bit operating system). - os_
type str - The type of OS. Possible values are:
linux
andwindows
, all the OS types will be retrieved by default. - output_
file str - File name where to save data source results (after running
pulumi preview
).
- availability
Zone String - Availability zone where images are located. such as:
cn-bj2-02
. You may refer to list of availability zone. - id String
- The ID of image.
- ids List<String>
A list of image IDs, all the images belong to this region will be retrieved if the ID is
[]
.Note this argument conflicts with
image_id
.- image
Id String The ID of image.
Note this argument conflicts with
ids
.- image
Type String - The type of image. Possible values are:
base
as standard image,business
as owned by market place, andcustom
as custom-image, all the image types will be retrieved by default. - most
Recent Boolean - If more than one result is returned, use the most recent image.
- name
Regex String - A regex string to filter resulting images by name. (Such as:
^CentOS 7.[1-2] 64
means CentOS 7.1 of 64-bit operating system or CentOS 7.2 of 64-bit operating system, "^Ubuntu 16.04 64" means Ubuntu 16.04 of 64-bit operating system). - os
Type String - The type of OS. Possible values are:
linux
andwindows
, all the OS types will be retrieved by default. - output
File String - File name where to save data source results (after running
pulumi preview
).
getImages Result
The following output properties are available:
- Id string
- The ID of image.
- Ids List<string>
- Images
List<Get
Images Image> - It is a nested type which documented below.
- Total
Count double - Total number of images that satisfy the condition.
- Availability
Zone string - Availability zone where image is located.
- Image
Id string - Image
Type string - Most
Recent bool - Name
Regex string - Os
Type string - The type of OS.
- Output
File string
- Id string
- The ID of image.
- Ids []string
- Images
[]Get
Images Image - It is a nested type which documented below.
- Total
Count float64 - Total number of images that satisfy the condition.
- Availability
Zone string - Availability zone where image is located.
- Image
Id string - Image
Type string - Most
Recent bool - Name
Regex string - Os
Type string - The type of OS.
- Output
File string
- id String
- The ID of image.
- ids List<String>
- images
List<Get
Images Image> - It is a nested type which documented below.
- total
Count Double - Total number of images that satisfy the condition.
- availability
Zone String - Availability zone where image is located.
- image
Id String - image
Type String - most
Recent Boolean - name
Regex String - os
Type String - The type of OS.
- output
File String
- id string
- The ID of image.
- ids string[]
- images
Get
Images Image[] - It is a nested type which documented below.
- total
Count number - Total number of images that satisfy the condition.
- availability
Zone string - Availability zone where image is located.
- image
Id string - image
Type string - most
Recent boolean - name
Regex string - os
Type string - The type of OS.
- output
File string
- id str
- The ID of image.
- ids Sequence[str]
- images
Sequence[Get
Images Image] - It is a nested type which documented below.
- total_
count float - Total number of images that satisfy the condition.
- availability_
zone str - Availability zone where image is located.
- image_
id str - image_
type str - most_
recent bool - name_
regex str - os_
type str - The type of OS.
- output_
file str
- id String
- The ID of image.
- ids List<String>
- images List<Property Map>
- It is a nested type which documented below.
- total
Count Number - Total number of images that satisfy the condition.
- availability
Zone String - Availability zone where image is located.
- image
Id String - image
Type String - most
Recent Boolean - name
Regex String - os
Type String - The type of OS.
- output
File String
Supporting Types
GetImagesImage
- Availability
Zone string - Availability zone where images are located. such as:
cn-bj2-02
. You may refer to list of availability zone. - Create
Time string - The time of creation for image, formatted in RFC3339 time string.
- Description string
- The description of image if any.
- Features List<string>
- To identify if any particular feature belongs to the instance, the value is
NetEnhnced
as I/O enhanced instance for now. - Id string
- The ID of image.
- Name string
- The name of image.
- Os
Name string - The name of OS.
- Os
Type string - The type of OS. Possible values are:
linux
andwindows
, all the OS types will be retrieved by default. - Size double
- The size of image.
- Status string
- The status of image. Possible values are
Available
,Making
andUnavailable
. - Type string
- The type of image.
- Availability
Zone string - Availability zone where images are located. such as:
cn-bj2-02
. You may refer to list of availability zone. - Create
Time string - The time of creation for image, formatted in RFC3339 time string.
- Description string
- The description of image if any.
- Features []string
- To identify if any particular feature belongs to the instance, the value is
NetEnhnced
as I/O enhanced instance for now. - Id string
- The ID of image.
- Name string
- The name of image.
- Os
Name string - The name of OS.
- Os
Type string - The type of OS. Possible values are:
linux
andwindows
, all the OS types will be retrieved by default. - Size float64
- The size of image.
- Status string
- The status of image. Possible values are
Available
,Making
andUnavailable
. - Type string
- The type of image.
- availability
Zone String - Availability zone where images are located. such as:
cn-bj2-02
. You may refer to list of availability zone. - create
Time String - The time of creation for image, formatted in RFC3339 time string.
- description String
- The description of image if any.
- features List<String>
- To identify if any particular feature belongs to the instance, the value is
NetEnhnced
as I/O enhanced instance for now. - id String
- The ID of image.
- name String
- The name of image.
- os
Name String - The name of OS.
- os
Type String - The type of OS. Possible values are:
linux
andwindows
, all the OS types will be retrieved by default. - size Double
- The size of image.
- status String
- The status of image. Possible values are
Available
,Making
andUnavailable
. - type String
- The type of image.
- availability
Zone string - Availability zone where images are located. such as:
cn-bj2-02
. You may refer to list of availability zone. - create
Time string - The time of creation for image, formatted in RFC3339 time string.
- description string
- The description of image if any.
- features string[]
- To identify if any particular feature belongs to the instance, the value is
NetEnhnced
as I/O enhanced instance for now. - id string
- The ID of image.
- name string
- The name of image.
- os
Name string - The name of OS.
- os
Type string - The type of OS. Possible values are:
linux
andwindows
, all the OS types will be retrieved by default. - size number
- The size of image.
- status string
- The status of image. Possible values are
Available
,Making
andUnavailable
. - type string
- The type of image.
- availability_
zone str - Availability zone where images are located. such as:
cn-bj2-02
. You may refer to list of availability zone. - create_
time str - The time of creation for image, formatted in RFC3339 time string.
- description str
- The description of image if any.
- features Sequence[str]
- To identify if any particular feature belongs to the instance, the value is
NetEnhnced
as I/O enhanced instance for now. - id str
- The ID of image.
- name str
- The name of image.
- os_
name str - The name of OS.
- os_
type str - The type of OS. Possible values are:
linux
andwindows
, all the OS types will be retrieved by default. - size float
- The size of image.
- status str
- The status of image. Possible values are
Available
,Making
andUnavailable
. - type str
- The type of image.
- availability
Zone String - Availability zone where images are located. such as:
cn-bj2-02
. You may refer to list of availability zone. - create
Time String - The time of creation for image, formatted in RFC3339 time string.
- description String
- The description of image if any.
- features List<String>
- To identify if any particular feature belongs to the instance, the value is
NetEnhnced
as I/O enhanced instance for now. - id String
- The ID of image.
- name String
- The name of image.
- os
Name String - The name of OS.
- os
Type String - The type of OS. Possible values are:
linux
andwindows
, all the OS types will be retrieved by default. - size Number
- The size of image.
- status String
- The status of image. Possible values are
Available
,Making
andUnavailable
. - type String
- The type of image.
Package Details
- Repository
- ucloud ucloud/terraform-provider-ucloud
- License
- Notes
- This Pulumi package is based on the
ucloud
Terraform Provider.