vra 0.12.0 published on Monday, Apr 14, 2025 by vmware
vra.getImage
Explore with Pulumi AI
The vra.getImage
data source can be used to discover the lookup machine images with cloud accounts. This can then be used with resource that require an image. For example, to create an image profile using the vra.ImageProfile
resource.
Example Usage
This is an example of how to lookup images.
Image data source by Id:
import * as pulumi from "@pulumi/pulumi";
import * as vra from "@pulumi/vra";
const _this = vra.getImage({
id: _var.image_id,
});
import pulumi
import pulumi_vra as vra
this = vra.get_image(id=var["image_id"])
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/vra/vra"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := vra.GetImage(ctx, &vra.GetImageArgs{
Id: pulumi.StringRef(_var.Image_id),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Vra = Pulumi.Vra;
return await Deployment.RunAsync(() =>
{
var @this = Vra.GetImage.Invoke(new()
{
Id = @var.Image_id,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.vra.VraFunctions;
import com.pulumi.vra.inputs.GetImageArgs;
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 this = VraFunctions.getImage(GetImageArgs.builder()
.id(var_.image_id())
.build());
}
}
variables:
this:
fn::invoke:
function: vra:getImage
arguments:
id: ${var.image_id}
Image data source by filter query:
import * as pulumi from "@pulumi/pulumi";
import * as vra from "@pulumi/vra";
const _this = vra.getImage({
filter: `name eq '${_var.image_name}'`,
});
import pulumi
import pulumi_vra as vra
this = vra.get_image(filter=f"name eq '{var['image_name']}'")
package main
import (
"fmt"
"github.com/pulumi/pulumi-terraform-provider/sdks/go/vra/vra"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := vra.GetImage(ctx, &vra.GetImageArgs{
Filter: pulumi.StringRef(fmt.Sprintf("name eq '%v'", _var.Image_name)),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Vra = Pulumi.Vra;
return await Deployment.RunAsync(() =>
{
var @this = Vra.GetImage.Invoke(new()
{
Filter = $"name eq '{@var.Image_name}'",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.vra.VraFunctions;
import com.pulumi.vra.inputs.GetImageArgs;
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 this = VraFunctions.getImage(GetImageArgs.builder()
.filter(String.format("name eq '%s'", var_.image_name()))
.build());
}
}
variables:
this:
fn::invoke:
function: vra:getImage
arguments:
filter: name eq '${var.image_name}'
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(filter: Optional[str] = None,
id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetImageResult
def get_image_output(filter: Optional[pulumi.Input[str]] = None,
id: 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)
public static Output<GetImageResult> getImage(GetImageArgs args, InvokeOptions options)
fn::invoke:
function: vra:index/getImage:getImage
arguments:
# arguments dictionary
The following arguments are supported:
getImage Result
The following output properties are available:
- Created
At string - Date when the entity was created. The date is in ISO 8601 and UTC
- Custom
Properties Dictionary<string, string> - A list of key value pair of custom properties for the image resource.
- Description string
- A human-friendly description.
- External
Id string - External entity Id on the provider side.
- Id string
- Links
List<Get
Image Link> - HATEOAS of the entity.
- Name string
- A human-friendly name used as an identifier for the image resource instance.
- Org
Id string - The id of the organization this entity belongs to.
- Os
Family string - Operating System family of the image.
- Owner string
- Email of the user that owns the entity.
- Private bool
- Indicates whether this image is private. For vSphere, private images are considered to be templates and snapshots and public are Content Library Items.
- Region string
- The region of the image. For a vSphere cloud account, it is the
externalRegionId
such asDatacenter:datacenter-2
and for an AWS cloud account, it is region name such asus-east-1
, etc. - Updated
At string - Date when the entity was last updated. The date is ISO 8601 and UTC.
- Filter string
- Created
At string - Date when the entity was created. The date is in ISO 8601 and UTC
- Custom
Properties map[string]string - A list of key value pair of custom properties for the image resource.
- Description string
- A human-friendly description.
- External
Id string - External entity Id on the provider side.
- Id string
- Links
[]Get
Image Link - HATEOAS of the entity.
- Name string
- A human-friendly name used as an identifier for the image resource instance.
- Org
Id string - The id of the organization this entity belongs to.
- Os
Family string - Operating System family of the image.
- Owner string
- Email of the user that owns the entity.
- Private bool
- Indicates whether this image is private. For vSphere, private images are considered to be templates and snapshots and public are Content Library Items.
- Region string
- The region of the image. For a vSphere cloud account, it is the
externalRegionId
such asDatacenter:datacenter-2
and for an AWS cloud account, it is region name such asus-east-1
, etc. - Updated
At string - Date when the entity was last updated. The date is ISO 8601 and UTC.
- Filter string
- created
At String - Date when the entity was created. The date is in ISO 8601 and UTC
- custom
Properties Map<String,String> - A list of key value pair of custom properties for the image resource.
- description String
- A human-friendly description.
- external
Id String - External entity Id on the provider side.
- id String
- links
List<Get
Image Link> - HATEOAS of the entity.
- name String
- A human-friendly name used as an identifier for the image resource instance.
- org
Id String - The id of the organization this entity belongs to.
- os
Family String - Operating System family of the image.
- owner String
- Email of the user that owns the entity.
- private_ Boolean
- Indicates whether this image is private. For vSphere, private images are considered to be templates and snapshots and public are Content Library Items.
- region String
- The region of the image. For a vSphere cloud account, it is the
externalRegionId
such asDatacenter:datacenter-2
and for an AWS cloud account, it is region name such asus-east-1
, etc. - updated
At String - Date when the entity was last updated. The date is ISO 8601 and UTC.
- filter String
- created
At string - Date when the entity was created. The date is in ISO 8601 and UTC
- custom
Properties {[key: string]: string} - A list of key value pair of custom properties for the image resource.
- description string
- A human-friendly description.
- external
Id string - External entity Id on the provider side.
- id string
- links
Get
Image Link[] - HATEOAS of the entity.
- name string
- A human-friendly name used as an identifier for the image resource instance.
- org
Id string - The id of the organization this entity belongs to.
- os
Family string - Operating System family of the image.
- owner string
- Email of the user that owns the entity.
- private boolean
- Indicates whether this image is private. For vSphere, private images are considered to be templates and snapshots and public are Content Library Items.
- region string
- The region of the image. For a vSphere cloud account, it is the
externalRegionId
such asDatacenter:datacenter-2
and for an AWS cloud account, it is region name such asus-east-1
, etc. - updated
At string - Date when the entity was last updated. The date is ISO 8601 and UTC.
- filter string
- created_
at str - Date when the entity was created. The date is in ISO 8601 and UTC
- custom_
properties Mapping[str, str] - A list of key value pair of custom properties for the image resource.
- description str
- A human-friendly description.
- external_
id str - External entity Id on the provider side.
- id str
- links
Sequence[Get
Image Link] - HATEOAS of the entity.
- name str
- A human-friendly name used as an identifier for the image resource instance.
- org_
id str - The id of the organization this entity belongs to.
- os_
family str - Operating System family of the image.
- owner str
- Email of the user that owns the entity.
- private bool
- Indicates whether this image is private. For vSphere, private images are considered to be templates and snapshots and public are Content Library Items.
- region str
- The region of the image. For a vSphere cloud account, it is the
externalRegionId
such asDatacenter:datacenter-2
and for an AWS cloud account, it is region name such asus-east-1
, etc. - updated_
at str - Date when the entity was last updated. The date is ISO 8601 and UTC.
- filter str
- created
At String - Date when the entity was created. The date is in ISO 8601 and UTC
- custom
Properties Map<String> - A list of key value pair of custom properties for the image resource.
- description String
- A human-friendly description.
- external
Id String - External entity Id on the provider side.
- id String
- links List<Property Map>
- HATEOAS of the entity.
- name String
- A human-friendly name used as an identifier for the image resource instance.
- org
Id String - The id of the organization this entity belongs to.
- os
Family String - Operating System family of the image.
- owner String
- Email of the user that owns the entity.
- private Boolean
- Indicates whether this image is private. For vSphere, private images are considered to be templates and snapshots and public are Content Library Items.
- region String
- The region of the image. For a vSphere cloud account, it is the
externalRegionId
such asDatacenter:datacenter-2
and for an AWS cloud account, it is region name such asus-east-1
, etc. - updated
At String - Date when the entity was last updated. The date is ISO 8601 and UTC.
- filter String
Supporting Types
GetImageLink
Package Details
- Repository
- vra vmware/terraform-provider-vra
- License
- Notes
- This Pulumi package is based on the
vra
Terraform Provider.