1. Packages
  2. Vra Provider
  3. API Docs
  4. getMachine
vra 0.12.0 published on Monday, Apr 14, 2025 by vmware

vra.getMachine

Explore with Pulumi AI

vra logo
vra 0.12.0 published on Monday, Apr 14, 2025 by vmware

    —layout: “vra”

    page_title: “VMware vRealize Automation: vra.Machine” description: |- Provides a data lookup for vra_machine.

    Data Source: vra.Machine

    Example Usage

    S

    This is an example of how to read a machine data source.

    import * as pulumi from "@pulumi/pulumi";
    import * as vra from "@pulumi/vra";
    
    const _this = vra.getMachine({
        id: _var.my_machine_id,
    });
    
    import pulumi
    import pulumi_vra as vra
    
    this = vra.get_machine(id=var["my_machine_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.LookupMachine(ctx, &vra.LookupMachineArgs{
    			Id: pulumi.StringRef(_var.My_machine_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.GetMachine.Invoke(new()
        {
            Id = @var.My_machine_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.GetMachineArgs;
    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.getMachine(GetMachineArgs.builder()
                .id(var_.my_machine_id())
                .build());
    
        }
    }
    
    variables:
      this:
        fn::invoke:
          function: vra:getMachine
          arguments:
            id: ${var.my_machine_id}
    

    Machine data source filter by name:

    import * as pulumi from "@pulumi/pulumi";
    import * as vra from "@pulumi/vra";
    
    const _this = vra.getMachine({
        filter: `name eq '${_var.machine_name}'`,
    });
    
    import pulumi
    import pulumi_vra as vra
    
    this = vra.get_machine(filter=f"name eq '{var['machine_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.LookupMachine(ctx, &vra.LookupMachineArgs{
    			Filter: pulumi.StringRef(fmt.Sprintf("name eq '%v'", _var.Machine_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.GetMachine.Invoke(new()
        {
            Filter = $"name eq '{@var.Machine_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.GetMachineArgs;
    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.getMachine(GetMachineArgs.builder()
                .filter(String.format("name eq '%s'", var_.machine_name()))
                .build());
    
        }
    }
    
    variables:
      this:
        fn::invoke:
          function: vra:getMachine
          arguments:
            filter: name eq '${var.machine_name}'
    

    Using getMachine

    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 getMachine(args: GetMachineArgs, opts?: InvokeOptions): Promise<GetMachineResult>
    function getMachineOutput(args: GetMachineOutputArgs, opts?: InvokeOptions): Output<GetMachineResult>
    def get_machine(description: Optional[str] = None,
                    filter: Optional[str] = None,
                    id: Optional[str] = None,
                    tags: Optional[Sequence[GetMachineTag]] = None,
                    opts: Optional[InvokeOptions] = None) -> GetMachineResult
    def get_machine_output(description: Optional[pulumi.Input[str]] = None,
                    filter: Optional[pulumi.Input[str]] = None,
                    id: Optional[pulumi.Input[str]] = None,
                    tags: Optional[pulumi.Input[Sequence[pulumi.Input[GetMachineTagArgs]]]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetMachineResult]
    func LookupMachine(ctx *Context, args *LookupMachineArgs, opts ...InvokeOption) (*LookupMachineResult, error)
    func LookupMachineOutput(ctx *Context, args *LookupMachineOutputArgs, opts ...InvokeOption) LookupMachineResultOutput

    > Note: This function is named LookupMachine in the Go SDK.

    public static class GetMachine 
    {
        public static Task<GetMachineResult> InvokeAsync(GetMachineArgs args, InvokeOptions? opts = null)
        public static Output<GetMachineResult> Invoke(GetMachineInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetMachineResult> getMachine(GetMachineArgs args, InvokeOptions options)
    public static Output<GetMachineResult> getMachine(GetMachineArgs args, InvokeOptions options)
    
    fn::invoke:
      function: vra:index/getMachine:getMachine
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Description string
    A human-friendly description.
    Filter string
    Filter query string that is supported by vRA multi-cloud IaaS API. Example: regionId eq '<regionId>' and cloudAccountId eq '<cloudAccountId>'.
    Id string
    The id of the image profile instance.
    Tags List<GetMachineTag>
    A set of tag keys and optional values that were set on this resource. example: [ { "key" : "ownedBy", "value": "Rainpole" } ]
    Description string
    A human-friendly description.
    Filter string
    Filter query string that is supported by vRA multi-cloud IaaS API. Example: regionId eq '<regionId>' and cloudAccountId eq '<cloudAccountId>'.
    Id string
    The id of the image profile instance.
    Tags []GetMachineTag
    A set of tag keys and optional values that were set on this resource. example: [ { "key" : "ownedBy", "value": "Rainpole" } ]
    description String
    A human-friendly description.
    filter String
    Filter query string that is supported by vRA multi-cloud IaaS API. Example: regionId eq '<regionId>' and cloudAccountId eq '<cloudAccountId>'.
    id String
    The id of the image profile instance.
    tags List<GetMachineTag>
    A set of tag keys and optional values that were set on this resource. example: [ { "key" : "ownedBy", "value": "Rainpole" } ]
    description string
    A human-friendly description.
    filter string
    Filter query string that is supported by vRA multi-cloud IaaS API. Example: regionId eq '<regionId>' and cloudAccountId eq '<cloudAccountId>'.
    id string
    The id of the image profile instance.
    tags GetMachineTag[]
    A set of tag keys and optional values that were set on this resource. example: [ { "key" : "ownedBy", "value": "Rainpole" } ]
    description str
    A human-friendly description.
    filter str
    Filter query string that is supported by vRA multi-cloud IaaS API. Example: regionId eq '<regionId>' and cloudAccountId eq '<cloudAccountId>'.
    id str
    The id of the image profile instance.
    tags Sequence[GetMachineTag]
    A set of tag keys and optional values that were set on this resource. example: [ { "key" : "ownedBy", "value": "Rainpole" } ]
    description String
    A human-friendly description.
    filter String
    Filter query string that is supported by vRA multi-cloud IaaS API. Example: regionId eq '<regionId>' and cloudAccountId eq '<cloudAccountId>'.
    id String
    The id of the image profile instance.
    tags List<Property Map>
    A set of tag keys and optional values that were set on this resource. example: [ { "key" : "ownedBy", "value": "Rainpole" } ]

    getMachine Result

    The following output properties are available:

    Address string
    Primary address allocated or in use by this machine. The actual type of the address depends on the adapter type. Typically it is either the public or the external IP address.
    CloudAccountIds List<string>
    Set of ids of the cloud accounts this resource belongs to.
    CreatedAt string
    Date when the entity was created. The date is in ISO 6801 and UTC.
    CustomProperties Dictionary<string, string>
    Additional properties that may be used to extend the base resource.
    DeploymentId string
    Deployment id that is associated with this resource.
    ExternalId string
    External entity Id on the provider side.
    ExternalRegionId string
    The external regionId of the resource.
    ExternalZoneId string
    The external zoneId of the resource.
    Id string
    Links List<GetMachineLink>
    HATEOAS of the entity
    Name string
    A human-friendly name used as an identifier in APIs that support this option.
    OrgId string
    The id of the organization this entity belongs to.
    Owner string
    Email of the user that owns the entity.
    PowerState string
    Power state of machine.
    ProjectId string
    The id of the project this resource belongs to.
    UpdatedAt string
    Description string
    Filter string
    Tags List<GetMachineTag>
    A set of tag keys and optional values that were set on this resource. example: [ { "key" : "ownedBy", "value": "Rainpole" } ]
    Address string
    Primary address allocated or in use by this machine. The actual type of the address depends on the adapter type. Typically it is either the public or the external IP address.
    CloudAccountIds []string
    Set of ids of the cloud accounts this resource belongs to.
    CreatedAt string
    Date when the entity was created. The date is in ISO 6801 and UTC.
    CustomProperties map[string]string
    Additional properties that may be used to extend the base resource.
    DeploymentId string
    Deployment id that is associated with this resource.
    ExternalId string
    External entity Id on the provider side.
    ExternalRegionId string
    The external regionId of the resource.
    ExternalZoneId string
    The external zoneId of the resource.
    Id string
    Links []GetMachineLink
    HATEOAS of the entity
    Name string
    A human-friendly name used as an identifier in APIs that support this option.
    OrgId string
    The id of the organization this entity belongs to.
    Owner string
    Email of the user that owns the entity.
    PowerState string
    Power state of machine.
    ProjectId string
    The id of the project this resource belongs to.
    UpdatedAt string
    Description string
    Filter string
    Tags []GetMachineTag
    A set of tag keys and optional values that were set on this resource. example: [ { "key" : "ownedBy", "value": "Rainpole" } ]
    address String
    Primary address allocated or in use by this machine. The actual type of the address depends on the adapter type. Typically it is either the public or the external IP address.
    cloudAccountIds List<String>
    Set of ids of the cloud accounts this resource belongs to.
    createdAt String
    Date when the entity was created. The date is in ISO 6801 and UTC.
    customProperties Map<String,String>
    Additional properties that may be used to extend the base resource.
    deploymentId String
    Deployment id that is associated with this resource.
    externalId String
    External entity Id on the provider side.
    externalRegionId String
    The external regionId of the resource.
    externalZoneId String
    The external zoneId of the resource.
    id String
    links List<GetMachineLink>
    HATEOAS of the entity
    name String
    A human-friendly name used as an identifier in APIs that support this option.
    orgId String
    The id of the organization this entity belongs to.
    owner String
    Email of the user that owns the entity.
    powerState String
    Power state of machine.
    projectId String
    The id of the project this resource belongs to.
    updatedAt String
    description String
    filter String
    tags List<GetMachineTag>
    A set of tag keys and optional values that were set on this resource. example: [ { "key" : "ownedBy", "value": "Rainpole" } ]
    address string
    Primary address allocated or in use by this machine. The actual type of the address depends on the adapter type. Typically it is either the public or the external IP address.
    cloudAccountIds string[]
    Set of ids of the cloud accounts this resource belongs to.
    createdAt string
    Date when the entity was created. The date is in ISO 6801 and UTC.
    customProperties {[key: string]: string}
    Additional properties that may be used to extend the base resource.
    deploymentId string
    Deployment id that is associated with this resource.
    externalId string
    External entity Id on the provider side.
    externalRegionId string
    The external regionId of the resource.
    externalZoneId string
    The external zoneId of the resource.
    id string
    links GetMachineLink[]
    HATEOAS of the entity
    name string
    A human-friendly name used as an identifier in APIs that support this option.
    orgId string
    The id of the organization this entity belongs to.
    owner string
    Email of the user that owns the entity.
    powerState string
    Power state of machine.
    projectId string
    The id of the project this resource belongs to.
    updatedAt string
    description string
    filter string
    tags GetMachineTag[]
    A set of tag keys and optional values that were set on this resource. example: [ { "key" : "ownedBy", "value": "Rainpole" } ]
    address str
    Primary address allocated or in use by this machine. The actual type of the address depends on the adapter type. Typically it is either the public or the external IP address.
    cloud_account_ids Sequence[str]
    Set of ids of the cloud accounts this resource belongs to.
    created_at str
    Date when the entity was created. The date is in ISO 6801 and UTC.
    custom_properties Mapping[str, str]
    Additional properties that may be used to extend the base resource.
    deployment_id str
    Deployment id that is associated with this resource.
    external_id str
    External entity Id on the provider side.
    external_region_id str
    The external regionId of the resource.
    external_zone_id str
    The external zoneId of the resource.
    id str
    links Sequence[GetMachineLink]
    HATEOAS of the entity
    name str
    A human-friendly name used as an identifier in APIs that support this option.
    org_id str
    The id of the organization this entity belongs to.
    owner str
    Email of the user that owns the entity.
    power_state str
    Power state of machine.
    project_id str
    The id of the project this resource belongs to.
    updated_at str
    description str
    filter str
    tags Sequence[GetMachineTag]
    A set of tag keys and optional values that were set on this resource. example: [ { "key" : "ownedBy", "value": "Rainpole" } ]
    address String
    Primary address allocated or in use by this machine. The actual type of the address depends on the adapter type. Typically it is either the public or the external IP address.
    cloudAccountIds List<String>
    Set of ids of the cloud accounts this resource belongs to.
    createdAt String
    Date when the entity was created. The date is in ISO 6801 and UTC.
    customProperties Map<String>
    Additional properties that may be used to extend the base resource.
    deploymentId String
    Deployment id that is associated with this resource.
    externalId String
    External entity Id on the provider side.
    externalRegionId String
    The external regionId of the resource.
    externalZoneId String
    The external zoneId of the resource.
    id String
    links List<Property Map>
    HATEOAS of the entity
    name String
    A human-friendly name used as an identifier in APIs that support this option.
    orgId String
    The id of the organization this entity belongs to.
    owner String
    Email of the user that owns the entity.
    powerState String
    Power state of machine.
    projectId String
    The id of the project this resource belongs to.
    updatedAt String
    description String
    filter String
    tags List<Property Map>
    A set of tag keys and optional values that were set on this resource. example: [ { "key" : "ownedBy", "value": "Rainpole" } ]

    Supporting Types

    Href string
    Hrefs List<string>
    Rel string
    Href string
    Hrefs []string
    Rel string
    href String
    hrefs List<String>
    rel String
    href string
    hrefs string[]
    rel string
    href str
    hrefs Sequence[str]
    rel str
    href String
    hrefs List<String>
    rel String

    GetMachineTag

    Key string
    Value string
    Key string
    Value string
    key String
    value String
    key string
    value string
    key str
    value str
    key String
    value String

    Package Details

    Repository
    vra vmware/terraform-provider-vra
    License
    Notes
    This Pulumi package is based on the vra Terraform Provider.
    vra logo
    vra 0.12.0 published on Monday, Apr 14, 2025 by vmware