1. Packages
  2. Exoscale
  3. API Docs
  4. getComputeInstance
Exoscale v0.59.2 published on Monday, Jul 22, 2024 by Pulumiverse

exoscale.getComputeInstance

Explore with Pulumi AI

exoscale logo
Exoscale v0.59.2 published on Monday, Jul 22, 2024 by Pulumiverse

    Fetch Exoscale Compute Instances data.

    Corresponding resource: exoscale_compute_instance.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as exoscale from "@pulumi/exoscale";
    
    const myInstance = exoscale.getComputeInstance({
        zone: "ch-gva-2",
        name: "my-instance",
    });
    export const myInstanceId = myInstance.then(myInstance => myInstance.id);
    
    import pulumi
    import pulumi_exoscale as exoscale
    
    my_instance = exoscale.get_compute_instance(zone="ch-gva-2",
        name="my-instance")
    pulumi.export("myInstanceId", my_instance.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-exoscale/sdk/go/exoscale"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		myInstance, err := exoscale.LookupComputeInstance(ctx, &exoscale.LookupComputeInstanceArgs{
    			Zone: "ch-gva-2",
    			Name: pulumi.StringRef("my-instance"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("myInstanceId", myInstance.Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Exoscale = Pulumi.Exoscale;
    
    return await Deployment.RunAsync(() => 
    {
        var myInstance = Exoscale.GetComputeInstance.Invoke(new()
        {
            Zone = "ch-gva-2",
            Name = "my-instance",
        });
    
        return new Dictionary<string, object?>
        {
            ["myInstanceId"] = myInstance.Apply(getComputeInstanceResult => getComputeInstanceResult.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.exoscale.ExoscaleFunctions;
    import com.pulumi.exoscale.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 myInstance = ExoscaleFunctions.getComputeInstance(GetComputeInstanceArgs.builder()
                .zone("ch-gva-2")
                .name("my-instance")
                .build());
    
            ctx.export("myInstanceId", myInstance.applyValue(getComputeInstanceResult -> getComputeInstanceResult.id()));
        }
    }
    
    variables:
      myInstance:
        fn::invoke:
          Function: exoscale:getComputeInstance
          Arguments:
            zone: ch-gva-2
            name: my-instance
    outputs:
      myInstanceId: ${myInstance.id}
    

    Please refer to the examples directory for complete configuration examples.

    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,
                             name: Optional[str] = None,
                             zone: Optional[str] = None,
                             opts: Optional[InvokeOptions] = None) -> GetComputeInstanceResult
    def get_compute_instance_output(id: Optional[pulumi.Input[str]] = None,
                             name: Optional[pulumi.Input[str]] = None,
                             zone: 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)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: exoscale:index/getComputeInstance:getComputeInstance
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Zone string
    The Exoscale Zone name.
    Id string
    The compute instance ID to match (conflicts with name).
    Name string
    The instance name to match (conflicts with id).
    Zone string
    The Exoscale Zone name.
    Id string
    The compute instance ID to match (conflicts with name).
    Name string
    The instance name to match (conflicts with id).
    zone String
    The Exoscale Zone name.
    id String
    The compute instance ID to match (conflicts with name).
    name String
    The instance name to match (conflicts with id).
    zone string
    The Exoscale Zone name.
    id string
    The compute instance ID to match (conflicts with name).
    name string
    The instance name to match (conflicts with id).
    zone str
    The Exoscale Zone name.
    id str
    The compute instance ID to match (conflicts with name).
    name str
    The instance name to match (conflicts with id).
    zone String
    The Exoscale Zone name.
    id String
    The compute instance ID to match (conflicts with name).
    name String
    The instance name to match (conflicts with id).

    getComputeInstance Result

    The following output properties are available:

    AntiAffinityGroupIds List<string>
    The list of attached exoscaleantiaffinity_group (IDs).
    CreatedAt string
    The compute instance creation date.
    DeployTargetId string
    A deploy target ID.
    DiskSize int
    The instance disk size (GiB).
    ElasticIpIds List<string>
    The list of attached exoscaleelasticip (IDs).
    Ipv6 bool
    Whether IPv6 is enabled on the instance.
    Ipv6Address string
    The instance (main network interface) IPv6 address (if enabled).
    Labels Dictionary<string, string>
    A map of key/value labels.
    ManagerId string
    The instance manager ID, if any.
    ManagerType string
    The instance manager type (instance pool, SKS node pool, etc.), if any.
    PrivateNetworkIds List<string>
    The list of attached exoscaleprivatenetwork (IDs).
    PublicIpAddress string
    The instance (main network interface) IPv4 address.
    ReverseDns string
    Domain name for reverse DNS record.
    SecurityGroupIds List<string>
    The list of attached exoscalesecuritygroup (IDs).
    SshKey string
    The exoscalesshkey (name) authorized on the instance.
    State string
    The instance state.
    TemplateId string
    The instance exoscale.getTemplate ID.
    Type string
    The instance type.
    UserData string
    The instance cloud-init configuration.
    Zone string
    The Exoscale Zone name.
    Id string
    The compute instance ID to match (conflicts with name).
    Name string
    The instance name to match (conflicts with id).
    AntiAffinityGroupIds []string
    The list of attached exoscaleantiaffinity_group (IDs).
    CreatedAt string
    The compute instance creation date.
    DeployTargetId string
    A deploy target ID.
    DiskSize int
    The instance disk size (GiB).
    ElasticIpIds []string
    The list of attached exoscaleelasticip (IDs).
    Ipv6 bool
    Whether IPv6 is enabled on the instance.
    Ipv6Address string
    The instance (main network interface) IPv6 address (if enabled).
    Labels map[string]string
    A map of key/value labels.
    ManagerId string
    The instance manager ID, if any.
    ManagerType string
    The instance manager type (instance pool, SKS node pool, etc.), if any.
    PrivateNetworkIds []string
    The list of attached exoscaleprivatenetwork (IDs).
    PublicIpAddress string
    The instance (main network interface) IPv4 address.
    ReverseDns string
    Domain name for reverse DNS record.
    SecurityGroupIds []string
    The list of attached exoscalesecuritygroup (IDs).
    SshKey string
    The exoscalesshkey (name) authorized on the instance.
    State string
    The instance state.
    TemplateId string
    The instance exoscale.getTemplate ID.
    Type string
    The instance type.
    UserData string
    The instance cloud-init configuration.
    Zone string
    The Exoscale Zone name.
    Id string
    The compute instance ID to match (conflicts with name).
    Name string
    The instance name to match (conflicts with id).
    antiAffinityGroupIds List<String>
    The list of attached exoscaleantiaffinity_group (IDs).
    createdAt String
    The compute instance creation date.
    deployTargetId String
    A deploy target ID.
    diskSize Integer
    The instance disk size (GiB).
    elasticIpIds List<String>
    The list of attached exoscaleelasticip (IDs).
    ipv6 Boolean
    Whether IPv6 is enabled on the instance.
    ipv6Address String
    The instance (main network interface) IPv6 address (if enabled).
    labels Map<String,String>
    A map of key/value labels.
    managerId String
    The instance manager ID, if any.
    managerType String
    The instance manager type (instance pool, SKS node pool, etc.), if any.
    privateNetworkIds List<String>
    The list of attached exoscaleprivatenetwork (IDs).
    publicIpAddress String
    The instance (main network interface) IPv4 address.
    reverseDns String
    Domain name for reverse DNS record.
    securityGroupIds List<String>
    The list of attached exoscalesecuritygroup (IDs).
    sshKey String
    The exoscalesshkey (name) authorized on the instance.
    state String
    The instance state.
    templateId String
    The instance exoscale.getTemplate ID.
    type String
    The instance type.
    userData String
    The instance cloud-init configuration.
    zone String
    The Exoscale Zone name.
    id String
    The compute instance ID to match (conflicts with name).
    name String
    The instance name to match (conflicts with id).
    antiAffinityGroupIds string[]
    The list of attached exoscaleantiaffinity_group (IDs).
    createdAt string
    The compute instance creation date.
    deployTargetId string
    A deploy target ID.
    diskSize number
    The instance disk size (GiB).
    elasticIpIds string[]
    The list of attached exoscaleelasticip (IDs).
    ipv6 boolean
    Whether IPv6 is enabled on the instance.
    ipv6Address string
    The instance (main network interface) IPv6 address (if enabled).
    labels {[key: string]: string}
    A map of key/value labels.
    managerId string
    The instance manager ID, if any.
    managerType string
    The instance manager type (instance pool, SKS node pool, etc.), if any.
    privateNetworkIds string[]
    The list of attached exoscaleprivatenetwork (IDs).
    publicIpAddress string
    The instance (main network interface) IPv4 address.
    reverseDns string
    Domain name for reverse DNS record.
    securityGroupIds string[]
    The list of attached exoscalesecuritygroup (IDs).
    sshKey string
    The exoscalesshkey (name) authorized on the instance.
    state string
    The instance state.
    templateId string
    The instance exoscale.getTemplate ID.
    type string
    The instance type.
    userData string
    The instance cloud-init configuration.
    zone string
    The Exoscale Zone name.
    id string
    The compute instance ID to match (conflicts with name).
    name string
    The instance name to match (conflicts with id).
    anti_affinity_group_ids Sequence[str]
    The list of attached exoscaleantiaffinity_group (IDs).
    created_at str
    The compute instance creation date.
    deploy_target_id str
    A deploy target ID.
    disk_size int
    The instance disk size (GiB).
    elastic_ip_ids Sequence[str]
    The list of attached exoscaleelasticip (IDs).
    ipv6 bool
    Whether IPv6 is enabled on the instance.
    ipv6_address str
    The instance (main network interface) IPv6 address (if enabled).
    labels Mapping[str, str]
    A map of key/value labels.
    manager_id str
    The instance manager ID, if any.
    manager_type str
    The instance manager type (instance pool, SKS node pool, etc.), if any.
    private_network_ids Sequence[str]
    The list of attached exoscaleprivatenetwork (IDs).
    public_ip_address str
    The instance (main network interface) IPv4 address.
    reverse_dns str
    Domain name for reverse DNS record.
    security_group_ids Sequence[str]
    The list of attached exoscalesecuritygroup (IDs).
    ssh_key str
    The exoscalesshkey (name) authorized on the instance.
    state str
    The instance state.
    template_id str
    The instance exoscale.getTemplate ID.
    type str
    The instance type.
    user_data str
    The instance cloud-init configuration.
    zone str
    The Exoscale Zone name.
    id str
    The compute instance ID to match (conflicts with name).
    name str
    The instance name to match (conflicts with id).
    antiAffinityGroupIds List<String>
    The list of attached exoscaleantiaffinity_group (IDs).
    createdAt String
    The compute instance creation date.
    deployTargetId String
    A deploy target ID.
    diskSize Number
    The instance disk size (GiB).
    elasticIpIds List<String>
    The list of attached exoscaleelasticip (IDs).
    ipv6 Boolean
    Whether IPv6 is enabled on the instance.
    ipv6Address String
    The instance (main network interface) IPv6 address (if enabled).
    labels Map<String>
    A map of key/value labels.
    managerId String
    The instance manager ID, if any.
    managerType String
    The instance manager type (instance pool, SKS node pool, etc.), if any.
    privateNetworkIds List<String>
    The list of attached exoscaleprivatenetwork (IDs).
    publicIpAddress String
    The instance (main network interface) IPv4 address.
    reverseDns String
    Domain name for reverse DNS record.
    securityGroupIds List<String>
    The list of attached exoscalesecuritygroup (IDs).
    sshKey String
    The exoscalesshkey (name) authorized on the instance.
    state String
    The instance state.
    templateId String
    The instance exoscale.getTemplate ID.
    type String
    The instance type.
    userData String
    The instance cloud-init configuration.
    zone String
    The Exoscale Zone name.
    id String
    The compute instance ID to match (conflicts with name).
    name String
    The instance name to match (conflicts with id).

    Package Details

    Repository
    exoscale pulumiverse/pulumi-exoscale
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the exoscale Terraform Provider.
    exoscale logo
    Exoscale v0.59.2 published on Monday, Jul 22, 2024 by Pulumiverse