ucloud 1.39.1 published on Monday, Apr 14, 2025 by ucloud
ucloud.getBaremetalImages
Explore with Pulumi AI
The ucloud.getBaremetalImages
data source provides a list of bare metal images available in UCloud. The images can be filtered by their properties.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as ucloud from "@pulumi/ucloud";
const example = ucloud.getBaremetalImages({
availabilityZone: "cn-bj2-02",
imageType: "base",
osType: "CentOS",
instanceType: "xyz-type",
});
export const imageId = example.then(example => example.images?.[0]?.id);
import pulumi
import pulumi_ucloud as ucloud
example = ucloud.get_baremetal_images(availability_zone="cn-bj2-02",
image_type="base",
os_type="CentOS",
instance_type="xyz-type")
pulumi.export("imageId", 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.GetBaremetalImages(ctx, &ucloud.GetBaremetalImagesArgs{
AvailabilityZone: pulumi.StringRef("cn-bj2-02"),
ImageType: pulumi.StringRef("base"),
OsType: pulumi.StringRef("CentOS"),
InstanceType: pulumi.StringRef("xyz-type"),
}, nil)
if err != nil {
return err
}
ctx.Export("imageId", 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.GetBaremetalImages.Invoke(new()
{
AvailabilityZone = "cn-bj2-02",
ImageType = "base",
OsType = "CentOS",
InstanceType = "xyz-type",
});
return new Dictionary<string, object?>
{
["imageId"] = example.Apply(getBaremetalImagesResult => getBaremetalImagesResult.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.GetBaremetalImagesArgs;
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.getBaremetalImages(GetBaremetalImagesArgs.builder()
.availabilityZone("cn-bj2-02")
.imageType("base")
.osType("CentOS")
.instanceType("xyz-type")
.build());
ctx.export("imageId", example.applyValue(getBaremetalImagesResult -> getBaremetalImagesResult.images()[0].id()));
}
}
variables:
example:
fn::invoke:
function: ucloud:getBaremetalImages
arguments:
availabilityZone: cn-bj2-02
imageType: base
osType: CentOS
instanceType: xyz-type
outputs:
imageId: ${example.images[0].id}
Using getBaremetalImages
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 getBaremetalImages(args: GetBaremetalImagesArgs, opts?: InvokeOptions): Promise<GetBaremetalImagesResult>
function getBaremetalImagesOutput(args: GetBaremetalImagesOutputArgs, opts?: InvokeOptions): Output<GetBaremetalImagesResult>
def get_baremetal_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,
instance_type: Optional[str] = None,
name_regex: Optional[str] = None,
os_type: Optional[str] = None,
output_file: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetBaremetalImagesResult
def get_baremetal_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,
instance_type: Optional[pulumi.Input[str]] = 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[GetBaremetalImagesResult]
func GetBaremetalImages(ctx *Context, args *GetBaremetalImagesArgs, opts ...InvokeOption) (*GetBaremetalImagesResult, error)
func GetBaremetalImagesOutput(ctx *Context, args *GetBaremetalImagesOutputArgs, opts ...InvokeOption) GetBaremetalImagesResultOutput
> Note: This function is named GetBaremetalImages
in the Go SDK.
public static class GetBaremetalImages
{
public static Task<GetBaremetalImagesResult> InvokeAsync(GetBaremetalImagesArgs args, InvokeOptions? opts = null)
public static Output<GetBaremetalImagesResult> Invoke(GetBaremetalImagesInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetBaremetalImagesResult> getBaremetalImages(GetBaremetalImagesArgs args, InvokeOptions options)
public static Output<GetBaremetalImagesResult> getBaremetalImages(GetBaremetalImagesArgs args, InvokeOptions options)
fn::invoke:
function: ucloud:index/getBaremetalImages:getBaremetalImages
arguments:
# arguments dictionary
The following arguments are supported:
- Availability
Zone string - The availability zone where the images are located.
- Id string
- The ID of the image.
- Ids List<string>
- A list of image IDs, all the images belong to this region will be retrieved if the ID is
[]
. - Image
Id string - Image
Type string - The type of image. Possible values are
base
for standard images andcustom
for custom images. - Instance
Type string - Machine type of the bare metal instance where the images can be installed.
- 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
CentOS
,Ubuntu
, andWindows
. - Output
File string - File name where to save data source results (after running
pulumi preview
).
- Availability
Zone string - The availability zone where the images are located.
- Id string
- The ID of the image.
- Ids []string
- A list of image IDs, all the images belong to this region will be retrieved if the ID is
[]
. - Image
Id string - Image
Type string - The type of image. Possible values are
base
for standard images andcustom
for custom images. - Instance
Type string - Machine type of the bare metal instance where the images can be installed.
- 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
CentOS
,Ubuntu
, andWindows
. - Output
File string - File name where to save data source results (after running
pulumi preview
).
- availability
Zone String - The availability zone where the images are located.
- id String
- The ID of the image.
- ids List<String>
- A list of image IDs, all the images belong to this region will be retrieved if the ID is
[]
. - image
Id String - image
Type String - The type of image. Possible values are
base
for standard images andcustom
for custom images. - instance
Type String - Machine type of the bare metal instance where the images can be installed.
- 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
CentOS
,Ubuntu
, andWindows
. - output
File String - File name where to save data source results (after running
pulumi preview
).
- availability
Zone string - The availability zone where the images are located.
- id string
- The ID of the image.
- ids string[]
- A list of image IDs, all the images belong to this region will be retrieved if the ID is
[]
. - image
Id string - image
Type string - The type of image. Possible values are
base
for standard images andcustom
for custom images. - instance
Type string - Machine type of the bare metal instance where the images can be installed.
- 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
CentOS
,Ubuntu
, andWindows
. - output
File string - File name where to save data source results (after running
pulumi preview
).
- availability_
zone str - The availability zone where the images are located.
- id str
- The ID of the image.
- ids Sequence[str]
- A list of image IDs, all the images belong to this region will be retrieved if the ID is
[]
. - image_
id str - image_
type str - The type of image. Possible values are
base
for standard images andcustom
for custom images. - instance_
type str - Machine type of the bare metal instance where the images can be installed.
- 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
CentOS
,Ubuntu
, andWindows
. - output_
file str - File name where to save data source results (after running
pulumi preview
).
- availability
Zone String - The availability zone where the images are located.
- id String
- The ID of the image.
- ids List<String>
- A list of image IDs, all the images belong to this region will be retrieved if the ID is
[]
. - image
Id String - image
Type String - The type of image. Possible values are
base
for standard images andcustom
for custom images. - instance
Type String - Machine type of the bare metal instance where the images can be installed.
- 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
CentOS
,Ubuntu
, andWindows
. - output
File String - File name where to save data source results (after running
pulumi preview
).
getBaremetalImages Result
The following output properties are available:
- Id string
- The ID of the image.
- Ids List<string>
- Images
List<Get
Baremetal Images Image> - A list of images that match the given criteria. Each image has the following attributes:
- Total
Count double - The total number of images that satisfy the given criteria.
- Availability
Zone string - The availability zone where the image is located.
- Image
Id string - Image
Type string - Instance
Type string - Name
Regex string - Os
Type string - The type of the OS.
- Output
File string
- Id string
- The ID of the image.
- Ids []string
- Images
[]Get
Baremetal Images Image - A list of images that match the given criteria. Each image has the following attributes:
- Total
Count float64 - The total number of images that satisfy the given criteria.
- Availability
Zone string - The availability zone where the image is located.
- Image
Id string - Image
Type string - Instance
Type string - Name
Regex string - Os
Type string - The type of the OS.
- Output
File string
- id String
- The ID of the image.
- ids List<String>
- images
List<Get
Baremetal Images Image> - A list of images that match the given criteria. Each image has the following attributes:
- total
Count Double - The total number of images that satisfy the given criteria.
- availability
Zone String - The availability zone where the image is located.
- image
Id String - image
Type String - instance
Type String - name
Regex String - os
Type String - The type of the OS.
- output
File String
- id string
- The ID of the image.
- ids string[]
- images
Get
Baremetal Images Image[] - A list of images that match the given criteria. Each image has the following attributes:
- total
Count number - The total number of images that satisfy the given criteria.
- availability
Zone string - The availability zone where the image is located.
- image
Id string - image
Type string - instance
Type string - name
Regex string - os
Type string - The type of the OS.
- output
File string
- id str
- The ID of the image.
- ids Sequence[str]
- images
Sequence[Get
Baremetal Images Image] - A list of images that match the given criteria. Each image has the following attributes:
- total_
count float - The total number of images that satisfy the given criteria.
- availability_
zone str - The availability zone where the image is located.
- image_
id str - image_
type str - instance_
type str - name_
regex str - os_
type str - The type of the OS.
- output_
file str
- id String
- The ID of the image.
- ids List<String>
- images List<Property Map>
- A list of images that match the given criteria. Each image has the following attributes:
- total
Count Number - The total number of images that satisfy the given criteria.
- availability
Zone String - The availability zone where the image is located.
- image
Id String - image
Type String - instance
Type String - name
Regex String - os
Type String - The type of the OS.
- output
File String
Supporting Types
GetBaremetalImagesImage
- Availability
Zone string - The availability zone where the images are located.
- Description string
- The description of the image, if any.
- Id string
- The ID of the image.
- Name string
- The name of the image.
- Os
Name string - The name of the OS.
- Os
Type string - The type of OS. Possible values are
CentOS
,Ubuntu
, andWindows
. - Size double
- Status string
- The status of image. Possible values are
Available
,Making
andUnavailable
. - Type string
- The type of the image.
- Availability
Zone string - The availability zone where the images are located.
- Description string
- The description of the image, if any.
- Id string
- The ID of the image.
- Name string
- The name of the image.
- Os
Name string - The name of the OS.
- Os
Type string - The type of OS. Possible values are
CentOS
,Ubuntu
, andWindows
. - Size float64
- Status string
- The status of image. Possible values are
Available
,Making
andUnavailable
. - Type string
- The type of the image.
- availability
Zone String - The availability zone where the images are located.
- description String
- The description of the image, if any.
- id String
- The ID of the image.
- name String
- The name of the image.
- os
Name String - The name of the OS.
- os
Type String - The type of OS. Possible values are
CentOS
,Ubuntu
, andWindows
. - size Double
- status String
- The status of image. Possible values are
Available
,Making
andUnavailable
. - type String
- The type of the image.
- availability
Zone string - The availability zone where the images are located.
- description string
- The description of the image, if any.
- id string
- The ID of the image.
- name string
- The name of the image.
- os
Name string - The name of the OS.
- os
Type string - The type of OS. Possible values are
CentOS
,Ubuntu
, andWindows
. - size number
- status string
- The status of image. Possible values are
Available
,Making
andUnavailable
. - type string
- The type of the image.
- availability_
zone str - The availability zone where the images are located.
- description str
- The description of the image, if any.
- id str
- The ID of the image.
- name str
- The name of the image.
- os_
name str - The name of the OS.
- os_
type str - The type of OS. Possible values are
CentOS
,Ubuntu
, andWindows
. - size float
- status str
- The status of image. Possible values are
Available
,Making
andUnavailable
. - type str
- The type of the image.
- availability
Zone String - The availability zone where the images are located.
- description String
- The description of the image, if any.
- id String
- The ID of the image.
- name String
- The name of the image.
- os
Name String - The name of the OS.
- os
Type String - The type of OS. Possible values are
CentOS
,Ubuntu
, andWindows
. - size Number
- status String
- The status of image. Possible values are
Available
,Making
andUnavailable
. - type String
- The type of the image.
Package Details
- Repository
- ucloud ucloud/terraform-provider-ucloud
- License
- Notes
- This Pulumi package is based on the
ucloud
Terraform Provider.