1. Packages
  2. Vkcs Provider
  3. API Docs
  4. getComputeInstance
vkcs 0.9.3 published on Tuesday, Apr 15, 2025 by vk-cs

vkcs.getComputeInstance

Explore with Pulumi AI

vkcs logo
vkcs 0.9.3 published on Tuesday, Apr 15, 2025 by vk-cs

    Use this data source to get the details of a running server

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as vkcs from "@pulumi/vkcs";
    
    const instance = vkcs.getComputeInstance({
        id: vkcs_compute_instance.basic.id,
    });
    
    import pulumi
    import pulumi_vkcs as vkcs
    
    instance = vkcs.get_compute_instance(id=vkcs_compute_instance["basic"]["id"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/vkcs/vkcs"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := vkcs.LookupComputeInstance(ctx, &vkcs.LookupComputeInstanceArgs{
    			Id: vkcs_compute_instance.Basic.Id,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Vkcs = Pulumi.Vkcs;
    
    return await Deployment.RunAsync(() => 
    {
        var instance = Vkcs.GetComputeInstance.Invoke(new()
        {
            Id = vkcs_compute_instance.Basic.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.vkcs.VkcsFunctions;
    import com.pulumi.vkcs.inputs.GetComputeInstanceArgs;
    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 instance = VkcsFunctions.getComputeInstance(GetComputeInstanceArgs.builder()
                .id(vkcs_compute_instance.basic().id())
                .build());
    
        }
    }
    
    variables:
      instance:
        fn::invoke:
          function: vkcs:getComputeInstance
          arguments:
            id: ${vkcs_compute_instance.basic.id}
    

    Using getComputeInstance

    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 getComputeInstance(args: GetComputeInstanceArgs, opts?: InvokeOptions): Promise<GetComputeInstanceResult>
    function getComputeInstanceOutput(args: GetComputeInstanceOutputArgs, opts?: InvokeOptions): Output<GetComputeInstanceResult>
    def get_compute_instance(id: Optional[str] = None,
                             networks: Optional[Sequence[GetComputeInstanceNetwork]] = None,
                             region: Optional[str] = None,
                             user_data: Optional[str] = None,
                             opts: Optional[InvokeOptions] = None) -> GetComputeInstanceResult
    def get_compute_instance_output(id: Optional[pulumi.Input[str]] = None,
                             networks: Optional[pulumi.Input[Sequence[pulumi.Input[GetComputeInstanceNetworkArgs]]]] = None,
                             region: Optional[pulumi.Input[str]] = None,
                             user_data: Optional[pulumi.Input[str]] = None,
                             opts: Optional[InvokeOptions] = None) -> Output[GetComputeInstanceResult]
    func LookupComputeInstance(ctx *Context, args *LookupComputeInstanceArgs, opts ...InvokeOption) (*LookupComputeInstanceResult, error)
    func LookupComputeInstanceOutput(ctx *Context, args *LookupComputeInstanceOutputArgs, opts ...InvokeOption) LookupComputeInstanceResultOutput

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

    public static class GetComputeInstance 
    {
        public static Task<GetComputeInstanceResult> InvokeAsync(GetComputeInstanceArgs args, InvokeOptions? opts = null)
        public static Output<GetComputeInstanceResult> Invoke(GetComputeInstanceInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetComputeInstanceResult> getComputeInstance(GetComputeInstanceArgs args, InvokeOptions options)
    public static Output<GetComputeInstanceResult> getComputeInstance(GetComputeInstanceArgs args, InvokeOptions options)
    
    fn::invoke:
      function: vkcs:index/getComputeInstance:getComputeInstance
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Id string
    required string → The UUID of the instance
    Networks List<GetComputeInstanceNetwork>
    → An array of maps, detailed below.
    Region string
    optional string → The region in which to obtain the Compute client. If omitted, the region argument of the provider is used.
    UserData string
    optional string → The user data added when the server was created.
    Id string
    required string → The UUID of the instance
    Networks []GetComputeInstanceNetwork
    → An array of maps, detailed below.
    Region string
    optional string → The region in which to obtain the Compute client. If omitted, the region argument of the provider is used.
    UserData string
    optional string → The user data added when the server was created.
    id String
    required string → The UUID of the instance
    networks List<GetComputeInstanceNetwork>
    → An array of maps, detailed below.
    region String
    optional string → The region in which to obtain the Compute client. If omitted, the region argument of the provider is used.
    userData String
    optional string → The user data added when the server was created.
    id string
    required string → The UUID of the instance
    networks GetComputeInstanceNetwork[]
    → An array of maps, detailed below.
    region string
    optional string → The region in which to obtain the Compute client. If omitted, the region argument of the provider is used.
    userData string
    optional string → The user data added when the server was created.
    id str
    required string → The UUID of the instance
    networks Sequence[GetComputeInstanceNetwork]
    → An array of maps, detailed below.
    region str
    optional string → The region in which to obtain the Compute client. If omitted, the region argument of the provider is used.
    user_data str
    optional string → The user data added when the server was created.
    id String
    required string → The UUID of the instance
    networks List<Property Map>
    → An array of maps, detailed below.
    region String
    optional string → The region in which to obtain the Compute client. If omitted, the region argument of the provider is used.
    userData String
    optional string → The user data added when the server was created.

    getComputeInstance Result

    The following output properties are available:

    AccessIpV4 string
    string → The first IPv4 address assigned to this server.
    AvailabilityZone string
    string → The availability zone of this server.
    FlavorId string
    string → The flavor ID used to create the server.
    FlavorName string
    string → The flavor name used to create the server.
    Id string
    ImageId string
    string → The image ID used to create the server.
    ImageName string
    string → The image name used to create the server.
    KeyPair string
    string → The name of the key pair assigned to this server.
    Metadata Dictionary<string, string>
    map of string → A set of key/value pairs made available to the server.
    Name string
    string → The name of the network
    PowerState string
    string → VM state
    Region string
    SecurityGroupIds List<string>
    set of string → An array of one or more security group ids to associate with the server.New since v0.7.3.
    SecurityGroups List<string>
    set of string → An array of security group names associated with this server.
    Tags List<string>
    set of string → A set of string tags for the instance.
    UserData string
    Networks List<GetComputeInstanceNetwork>
    → An array of maps, detailed below.
    AccessIpV4 string
    string → The first IPv4 address assigned to this server.
    AvailabilityZone string
    string → The availability zone of this server.
    FlavorId string
    string → The flavor ID used to create the server.
    FlavorName string
    string → The flavor name used to create the server.
    Id string
    ImageId string
    string → The image ID used to create the server.
    ImageName string
    string → The image name used to create the server.
    KeyPair string
    string → The name of the key pair assigned to this server.
    Metadata map[string]string
    map of string → A set of key/value pairs made available to the server.
    Name string
    string → The name of the network
    PowerState string
    string → VM state
    Region string
    SecurityGroupIds []string
    set of string → An array of one or more security group ids to associate with the server.New since v0.7.3.
    SecurityGroups []string
    set of string → An array of security group names associated with this server.
    Tags []string
    set of string → A set of string tags for the instance.
    UserData string
    Networks []GetComputeInstanceNetwork
    → An array of maps, detailed below.
    accessIpV4 String
    string → The first IPv4 address assigned to this server.
    availabilityZone String
    string → The availability zone of this server.
    flavorId String
    string → The flavor ID used to create the server.
    flavorName String
    string → The flavor name used to create the server.
    id String
    imageId String
    string → The image ID used to create the server.
    imageName String
    string → The image name used to create the server.
    keyPair String
    string → The name of the key pair assigned to this server.
    metadata Map<String,String>
    map of string → A set of key/value pairs made available to the server.
    name String
    string → The name of the network
    powerState String
    string → VM state
    region String
    securityGroupIds List<String>
    set of string → An array of one or more security group ids to associate with the server.New since v0.7.3.
    securityGroups List<String>
    set of string → An array of security group names associated with this server.
    tags List<String>
    set of string → A set of string tags for the instance.
    userData String
    networks List<GetComputeInstanceNetwork>
    → An array of maps, detailed below.
    accessIpV4 string
    string → The first IPv4 address assigned to this server.
    availabilityZone string
    string → The availability zone of this server.
    flavorId string
    string → The flavor ID used to create the server.
    flavorName string
    string → The flavor name used to create the server.
    id string
    imageId string
    string → The image ID used to create the server.
    imageName string
    string → The image name used to create the server.
    keyPair string
    string → The name of the key pair assigned to this server.
    metadata {[key: string]: string}
    map of string → A set of key/value pairs made available to the server.
    name string
    string → The name of the network
    powerState string
    string → VM state
    region string
    securityGroupIds string[]
    set of string → An array of one or more security group ids to associate with the server.New since v0.7.3.
    securityGroups string[]
    set of string → An array of security group names associated with this server.
    tags string[]
    set of string → A set of string tags for the instance.
    userData string
    networks GetComputeInstanceNetwork[]
    → An array of maps, detailed below.
    access_ip_v4 str
    string → The first IPv4 address assigned to this server.
    availability_zone str
    string → The availability zone of this server.
    flavor_id str
    string → The flavor ID used to create the server.
    flavor_name str
    string → The flavor name used to create the server.
    id str
    image_id str
    string → The image ID used to create the server.
    image_name str
    string → The image name used to create the server.
    key_pair str
    string → The name of the key pair assigned to this server.
    metadata Mapping[str, str]
    map of string → A set of key/value pairs made available to the server.
    name str
    string → The name of the network
    power_state str
    string → VM state
    region str
    security_group_ids Sequence[str]
    set of string → An array of one or more security group ids to associate with the server.New since v0.7.3.
    security_groups Sequence[str]
    set of string → An array of security group names associated with this server.
    tags Sequence[str]
    set of string → A set of string tags for the instance.
    user_data str
    networks Sequence[GetComputeInstanceNetwork]
    → An array of maps, detailed below.
    accessIpV4 String
    string → The first IPv4 address assigned to this server.
    availabilityZone String
    string → The availability zone of this server.
    flavorId String
    string → The flavor ID used to create the server.
    flavorName String
    string → The flavor name used to create the server.
    id String
    imageId String
    string → The image ID used to create the server.
    imageName String
    string → The image name used to create the server.
    keyPair String
    string → The name of the key pair assigned to this server.
    metadata Map<String>
    map of string → A set of key/value pairs made available to the server.
    name String
    string → The name of the network
    powerState String
    string → VM state
    region String
    securityGroupIds List<String>
    set of string → An array of one or more security group ids to associate with the server.New since v0.7.3.
    securityGroups List<String>
    set of string → An array of security group names associated with this server.
    tags List<String>
    set of string → A set of string tags for the instance.
    userData String
    networks List<Property Map>
    → An array of maps, detailed below.

    Supporting Types

    GetComputeInstanceNetwork

    FixedIpV4 string
    string → The IPv4 address assigned to this network port.
    Mac string
    string → The MAC address assigned to this network interface.
    Name string
    string → The name of the network
    Port string
    string → The port UUID for this network
    Uuid string
    string → The UUID of the network
    FixedIpV4 string
    string → The IPv4 address assigned to this network port.
    Mac string
    string → The MAC address assigned to this network interface.
    Name string
    string → The name of the network
    Port string
    string → The port UUID for this network
    Uuid string
    string → The UUID of the network
    fixedIpV4 String
    string → The IPv4 address assigned to this network port.
    mac String
    string → The MAC address assigned to this network interface.
    name String
    string → The name of the network
    port String
    string → The port UUID for this network
    uuid String
    string → The UUID of the network
    fixedIpV4 string
    string → The IPv4 address assigned to this network port.
    mac string
    string → The MAC address assigned to this network interface.
    name string
    string → The name of the network
    port string
    string → The port UUID for this network
    uuid string
    string → The UUID of the network
    fixed_ip_v4 str
    string → The IPv4 address assigned to this network port.
    mac str
    string → The MAC address assigned to this network interface.
    name str
    string → The name of the network
    port str
    string → The port UUID for this network
    uuid str
    string → The UUID of the network
    fixedIpV4 String
    string → The IPv4 address assigned to this network port.
    mac String
    string → The MAC address assigned to this network interface.
    name String
    string → The name of the network
    port String
    string → The port UUID for this network
    uuid String
    string → The UUID of the network

    Package Details

    Repository
    vkcs vk-cs/terraform-provider-vkcs
    License
    Notes
    This Pulumi package is based on the vkcs Terraform Provider.
    vkcs logo
    vkcs 0.9.3 published on Tuesday, Apr 15, 2025 by vk-cs