get Images
This data source provides available image resources. It contains user's private images, system images provided by Alibaba Cloud, other public images and the ones available on the image market.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const imagesDs = alicloud.ecs.getImages({
owners: "system",
nameRegex: "^centos_6",
});
export const firstImageId = imagesDs.then(imagesDs => imagesDs.images?.[0]?.id);
import pulumi
import pulumi_alicloud as alicloud
images_ds = alicloud.ecs.get_images(owners="system",
name_regex="^centos_6")
pulumi.export("firstImageId", images_ds.images[0].id)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var imagesDs = AliCloud.Ecs.GetImages.Invoke(new()
{
Owners = "system",
NameRegex = "^centos_6",
});
return new Dictionary<string, object?>
{
["firstImageId"] = imagesDs.Apply(getImagesResult => getImagesResult.Images[0]?.Id),
};
});
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
imagesDs, err := ecs.GetImages(ctx, &ecs.GetImagesArgs{
Owners: pulumi.StringRef("system"),
NameRegex: pulumi.StringRef("^centos_6"),
}, nil)
if err != nil {
return err
}
ctx.Export("firstImageId", imagesDs.Images[0].Id)
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.ecs.EcsFunctions;
import com.pulumi.alicloud.ecs.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 imagesDs = EcsFunctions.getImages(GetImagesArgs.builder()
.owners("system")
.nameRegex("^centos_6")
.build());
ctx.export("firstImageId", imagesDs.images()[0].id());
}
}
variables:
imagesDs:
fn::invoke:
function: alicloud:ecs:getImages
arguments:
owners: system
nameRegex: ^centos_6
outputs:
firstImageId: ${imagesDs.images[0].id}
Return
A collection of values returned by getImages.
Parameters
A collection of arguments for invoking getImages.
Return
A collection of values returned by getImages.
Parameters
The scenario in which the image will be used. Default value: CreateEcs
. Valid values:
CreateEcs
: instance creation.ChangeOS
: replacement of the system disk or operating system.
The image architecture. Valid values: i386
and x86_64
.
Specifies whether the image is running on an ECS instance. Default value: false
. Valid values:
The name of the image family. You can set this parameter to query images of the specified image family. This parameter is empty by default.
The ID of the image.
The name of the image.
The ID of the Alibaba Cloud account to which the image belongs. This parameter takes effect only when you query shared images or community images.
The instance type for which the image can be used.
Specifies whether the image supports cloud-init.
Specifies whether the image can be used on I/O optimized instances.
If more than one result are returned, select the most recent one.
A regex string to filter resulting images by name.
The operating system type of the image. Valid values: windows
and linux
.
File name where to save data source results (after running pulumi preview
).
NOTE: At least one of the
name_regex
,most_recent
andowners
must be set.
Filter results by a specific image owner. Valid items are system
, self
, others
, marketplace
.
The ID of the resource group to which the custom image belongs.
The ID of the snapshot used to create the custom image.
The status of the image. The following values are available, Separate multiple parameter values by using commas (,). Default value: Available
. Valid values:
Creating
: The image is being created.Waiting
: The image is waiting to be processed.Available
: The image is available.UnAvailable
: The image is unavailable.CreateFailed
: The image failed to be created.Deprecated
: The image is discontinued.
A mapping of tags to assign to the resource.
Specifies whether to check the validity of the request without actually making the request. Valid values:
See also
Return
A collection of values returned by getImages.
Parameters
Builder for com.pulumi.alicloud.ecs.kotlin.inputs.GetImagesPlainArgs.