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

exoscale.ComputeInstance

Explore with Pulumi AI

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

    Manage Exoscale Compute Instances.

    Corresponding data sources: exoscale_compute_instance, exoscale_compute_instance_list.

    After the creation, you can retrieve the password of an instance with Exoscale CLI: exo compute instance reveal-password NAME.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as exoscale from "@pulumi/exoscale";
    import * as exoscale from "@pulumiverse/exoscale";
    
    const myTemplate = exoscale.getTemplate({
        zone: "ch-gva-2",
        name: "Linux Ubuntu 22.04 LTS 64-bit",
    });
    const myInstance = new exoscale.ComputeInstance("myInstance", {
        zone: "ch-gva-2",
        templateId: myTemplate.then(myTemplate => myTemplate.id),
        type: "standard.medium",
        diskSize: 10,
    });
    
    import pulumi
    import pulumi_exoscale as exoscale
    import pulumiverse_exoscale as exoscale
    
    my_template = exoscale.get_template(zone="ch-gva-2",
        name="Linux Ubuntu 22.04 LTS 64-bit")
    my_instance = exoscale.ComputeInstance("myInstance",
        zone="ch-gva-2",
        template_id=my_template.id,
        type="standard.medium",
        disk_size=10)
    
    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 {
    		myTemplate, err := exoscale.GetTemplate(ctx, &exoscale.GetTemplateArgs{
    			Zone: "ch-gva-2",
    			Name: pulumi.StringRef("Linux Ubuntu 22.04 LTS 64-bit"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = exoscale.NewComputeInstance(ctx, "myInstance", &exoscale.ComputeInstanceArgs{
    			Zone:       pulumi.String("ch-gva-2"),
    			TemplateId: pulumi.String(myTemplate.Id),
    			Type:       pulumi.String("standard.medium"),
    			DiskSize:   pulumi.Int(10),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Exoscale = Pulumi.Exoscale;
    using Exoscale = Pulumiverse.Exoscale;
    
    return await Deployment.RunAsync(() => 
    {
        var myTemplate = Exoscale.GetTemplate.Invoke(new()
        {
            Zone = "ch-gva-2",
            Name = "Linux Ubuntu 22.04 LTS 64-bit",
        });
    
        var myInstance = new Exoscale.ComputeInstance("myInstance", new()
        {
            Zone = "ch-gva-2",
            TemplateId = myTemplate.Apply(getTemplateResult => getTemplateResult.Id),
            Type = "standard.medium",
            DiskSize = 10,
        });
    
    });
    
    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.GetTemplateArgs;
    import com.pulumi.exoscale.ComputeInstance;
    import com.pulumi.exoscale.ComputeInstanceArgs;
    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 myTemplate = ExoscaleFunctions.getTemplate(GetTemplateArgs.builder()
                .zone("ch-gva-2")
                .name("Linux Ubuntu 22.04 LTS 64-bit")
                .build());
    
            var myInstance = new ComputeInstance("myInstance", ComputeInstanceArgs.builder()
                .zone("ch-gva-2")
                .templateId(myTemplate.applyValue(getTemplateResult -> getTemplateResult.id()))
                .type("standard.medium")
                .diskSize(10)
                .build());
    
        }
    }
    
    resources:
      myInstance:
        type: exoscale:ComputeInstance
        properties:
          zone: ch-gva-2
          templateId: ${myTemplate.id}
          type: standard.medium
          diskSize: 10
    variables:
      myTemplate:
        fn::invoke:
          Function: exoscale:getTemplate
          Arguments:
            zone: ch-gva-2
            name: Linux Ubuntu 22.04 LTS 64-bit
    

    Please refer to the examples directory for complete configuration examples.

    Create ComputeInstance Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new ComputeInstance(name: string, args: ComputeInstanceArgs, opts?: CustomResourceOptions);
    @overload
    def ComputeInstance(resource_name: str,
                        args: ComputeInstanceArgs,
                        opts: Optional[ResourceOptions] = None)
    
    @overload
    def ComputeInstance(resource_name: str,
                        opts: Optional[ResourceOptions] = None,
                        template_id: Optional[str] = None,
                        zone: Optional[str] = None,
                        type: Optional[str] = None,
                        name: Optional[str] = None,
                        private: Optional[bool] = None,
                        elastic_ip_ids: Optional[Sequence[str]] = None,
                        ipv6: Optional[bool] = None,
                        labels: Optional[Mapping[str, str]] = None,
                        anti_affinity_group_ids: Optional[Sequence[str]] = None,
                        network_interfaces: Optional[Sequence[ComputeInstanceNetworkInterfaceArgs]] = None,
                        disk_size: Optional[int] = None,
                        reverse_dns: Optional[str] = None,
                        security_group_ids: Optional[Sequence[str]] = None,
                        ssh_key: Optional[str] = None,
                        state: Optional[str] = None,
                        destroy_protected: Optional[bool] = None,
                        deploy_target_id: Optional[str] = None,
                        user_data: Optional[str] = None,
                        block_storage_volume_ids: Optional[Sequence[str]] = None)
    func NewComputeInstance(ctx *Context, name string, args ComputeInstanceArgs, opts ...ResourceOption) (*ComputeInstance, error)
    public ComputeInstance(string name, ComputeInstanceArgs args, CustomResourceOptions? opts = null)
    public ComputeInstance(String name, ComputeInstanceArgs args)
    public ComputeInstance(String name, ComputeInstanceArgs args, CustomResourceOptions options)
    
    type: exoscale:ComputeInstance
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args ComputeInstanceArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args ComputeInstanceArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args ComputeInstanceArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ComputeInstanceArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ComputeInstanceArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var computeInstanceResource = new Exoscale.ComputeInstance("computeInstanceResource", new()
    {
        TemplateId = "string",
        Zone = "string",
        Type = "string",
        Name = "string",
        Private = false,
        ElasticIpIds = new[]
        {
            "string",
        },
        Ipv6 = false,
        Labels = 
        {
            { "string", "string" },
        },
        AntiAffinityGroupIds = new[]
        {
            "string",
        },
        NetworkInterfaces = new[]
        {
            new Exoscale.Inputs.ComputeInstanceNetworkInterfaceArgs
            {
                NetworkId = "string",
                IpAddress = "string",
            },
        },
        DiskSize = 0,
        ReverseDns = "string",
        SecurityGroupIds = new[]
        {
            "string",
        },
        SshKey = "string",
        State = "string",
        DestroyProtected = false,
        DeployTargetId = "string",
        UserData = "string",
        BlockStorageVolumeIds = new[]
        {
            "string",
        },
    });
    
    example, err := exoscale.NewComputeInstance(ctx, "computeInstanceResource", &exoscale.ComputeInstanceArgs{
    	TemplateId: pulumi.String("string"),
    	Zone:       pulumi.String("string"),
    	Type:       pulumi.String("string"),
    	Name:       pulumi.String("string"),
    	Private:    pulumi.Bool(false),
    	ElasticIpIds: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Ipv6: pulumi.Bool(false),
    	Labels: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	AntiAffinityGroupIds: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	NetworkInterfaces: exoscale.ComputeInstanceNetworkInterfaceArray{
    		&exoscale.ComputeInstanceNetworkInterfaceArgs{
    			NetworkId: pulumi.String("string"),
    			IpAddress: pulumi.String("string"),
    		},
    	},
    	DiskSize:   pulumi.Int(0),
    	ReverseDns: pulumi.String("string"),
    	SecurityGroupIds: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	SshKey:           pulumi.String("string"),
    	State:            pulumi.String("string"),
    	DestroyProtected: pulumi.Bool(false),
    	DeployTargetId:   pulumi.String("string"),
    	UserData:         pulumi.String("string"),
    	BlockStorageVolumeIds: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    })
    
    var computeInstanceResource = new ComputeInstance("computeInstanceResource", ComputeInstanceArgs.builder()
        .templateId("string")
        .zone("string")
        .type("string")
        .name("string")
        .private_(false)
        .elasticIpIds("string")
        .ipv6(false)
        .labels(Map.of("string", "string"))
        .antiAffinityGroupIds("string")
        .networkInterfaces(ComputeInstanceNetworkInterfaceArgs.builder()
            .networkId("string")
            .ipAddress("string")
            .build())
        .diskSize(0)
        .reverseDns("string")
        .securityGroupIds("string")
        .sshKey("string")
        .state("string")
        .destroyProtected(false)
        .deployTargetId("string")
        .userData("string")
        .blockStorageVolumeIds("string")
        .build());
    
    compute_instance_resource = exoscale.ComputeInstance("computeInstanceResource",
        template_id="string",
        zone="string",
        type="string",
        name="string",
        private=False,
        elastic_ip_ids=["string"],
        ipv6=False,
        labels={
            "string": "string",
        },
        anti_affinity_group_ids=["string"],
        network_interfaces=[exoscale.ComputeInstanceNetworkInterfaceArgs(
            network_id="string",
            ip_address="string",
        )],
        disk_size=0,
        reverse_dns="string",
        security_group_ids=["string"],
        ssh_key="string",
        state="string",
        destroy_protected=False,
        deploy_target_id="string",
        user_data="string",
        block_storage_volume_ids=["string"])
    
    const computeInstanceResource = new exoscale.ComputeInstance("computeInstanceResource", {
        templateId: "string",
        zone: "string",
        type: "string",
        name: "string",
        "private": false,
        elasticIpIds: ["string"],
        ipv6: false,
        labels: {
            string: "string",
        },
        antiAffinityGroupIds: ["string"],
        networkInterfaces: [{
            networkId: "string",
            ipAddress: "string",
        }],
        diskSize: 0,
        reverseDns: "string",
        securityGroupIds: ["string"],
        sshKey: "string",
        state: "string",
        destroyProtected: false,
        deployTargetId: "string",
        userData: "string",
        blockStorageVolumeIds: ["string"],
    });
    
    type: exoscale:ComputeInstance
    properties:
        antiAffinityGroupIds:
            - string
        blockStorageVolumeIds:
            - string
        deployTargetId: string
        destroyProtected: false
        diskSize: 0
        elasticIpIds:
            - string
        ipv6: false
        labels:
            string: string
        name: string
        networkInterfaces:
            - ipAddress: string
              networkId: string
        private: false
        reverseDns: string
        securityGroupIds:
            - string
        sshKey: string
        state: string
        templateId: string
        type: string
        userData: string
        zone: string
    

    ComputeInstance Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The ComputeInstance resource accepts the following input properties:

    TemplateId string
    ❗ The exoscale.getTemplate (ID) to use when creating the instance.
    Type string
    The instance type (<family>.<size>, e.g. standard.medium; use the Exoscale CLI - exo compute instance-type list - for the list of available types). WARNING: updating this attribute stops/restarts the instance.
    Zone string
    ❗ The Exoscale Zone name.
    AntiAffinityGroupIds List<string>
    ❗ A list of exoscaleantiaffinity_group (IDs) to attach to the instance (may only be set at creation time).
    BlockStorageVolumeIds List<string>
    A list of exoscaleblockstorage_volume (ID) to attach to the instance.
    DeployTargetId string
    ❗ A deploy target ID.
    DestroyProtected bool
    Mark the instance as protected, the Exoscale API will refuse to delete the instance until the protection is removed (boolean; default: false).
    DiskSize int
    The instance disk size (GiB; at least 10). Can not be decreased after creation. WARNING: updating this attribute stops/restarts the instance.
    ElasticIpIds List<string>
    A list of exoscaleelasticip (IDs) to attach to the instance.
    Ipv6 bool
    Enable IPv6 on the instance (boolean; default: false).
    Labels Dictionary<string, string>
    A map of key/value labels.
    Name string
    The compute instance name.
    NetworkInterfaces List<Pulumiverse.Exoscale.Inputs.ComputeInstanceNetworkInterface>
    Private network interfaces (may be specified multiple times). Structure is documented below.
    Private bool
    Whether the instance is private (no public IP addresses; default: false)
    ReverseDns string
    Domain name for reverse DNS record.
    SecurityGroupIds List<string>
    A list of exoscalesecuritygroup (IDs) to attach to the instance.
    SshKey string
    The exoscalesshkey (name) to authorize in the instance (may only be set at creation time).
    State string
    The instance state (running or stopped; default: running).
    UserData string
    cloud-init configuration.
    TemplateId string
    ❗ The exoscale.getTemplate (ID) to use when creating the instance.
    Type string
    The instance type (<family>.<size>, e.g. standard.medium; use the Exoscale CLI - exo compute instance-type list - for the list of available types). WARNING: updating this attribute stops/restarts the instance.
    Zone string
    ❗ The Exoscale Zone name.
    AntiAffinityGroupIds []string
    ❗ A list of exoscaleantiaffinity_group (IDs) to attach to the instance (may only be set at creation time).
    BlockStorageVolumeIds []string
    A list of exoscaleblockstorage_volume (ID) to attach to the instance.
    DeployTargetId string
    ❗ A deploy target ID.
    DestroyProtected bool
    Mark the instance as protected, the Exoscale API will refuse to delete the instance until the protection is removed (boolean; default: false).
    DiskSize int
    The instance disk size (GiB; at least 10). Can not be decreased after creation. WARNING: updating this attribute stops/restarts the instance.
    ElasticIpIds []string
    A list of exoscaleelasticip (IDs) to attach to the instance.
    Ipv6 bool
    Enable IPv6 on the instance (boolean; default: false).
    Labels map[string]string
    A map of key/value labels.
    Name string
    The compute instance name.
    NetworkInterfaces []ComputeInstanceNetworkInterfaceArgs
    Private network interfaces (may be specified multiple times). Structure is documented below.
    Private bool
    Whether the instance is private (no public IP addresses; default: false)
    ReverseDns string
    Domain name for reverse DNS record.
    SecurityGroupIds []string
    A list of exoscalesecuritygroup (IDs) to attach to the instance.
    SshKey string
    The exoscalesshkey (name) to authorize in the instance (may only be set at creation time).
    State string
    The instance state (running or stopped; default: running).
    UserData string
    cloud-init configuration.
    templateId String
    ❗ The exoscale.getTemplate (ID) to use when creating the instance.
    type String
    The instance type (<family>.<size>, e.g. standard.medium; use the Exoscale CLI - exo compute instance-type list - for the list of available types). WARNING: updating this attribute stops/restarts the instance.
    zone String
    ❗ The Exoscale Zone name.
    antiAffinityGroupIds List<String>
    ❗ A list of exoscaleantiaffinity_group (IDs) to attach to the instance (may only be set at creation time).
    blockStorageVolumeIds List<String>
    A list of exoscaleblockstorage_volume (ID) to attach to the instance.
    deployTargetId String
    ❗ A deploy target ID.
    destroyProtected Boolean
    Mark the instance as protected, the Exoscale API will refuse to delete the instance until the protection is removed (boolean; default: false).
    diskSize Integer
    The instance disk size (GiB; at least 10). Can not be decreased after creation. WARNING: updating this attribute stops/restarts the instance.
    elasticIpIds List<String>
    A list of exoscaleelasticip (IDs) to attach to the instance.
    ipv6 Boolean
    Enable IPv6 on the instance (boolean; default: false).
    labels Map<String,String>
    A map of key/value labels.
    name String
    The compute instance name.
    networkInterfaces List<ComputeInstanceNetworkInterface>
    Private network interfaces (may be specified multiple times). Structure is documented below.
    private_ Boolean
    Whether the instance is private (no public IP addresses; default: false)
    reverseDns String
    Domain name for reverse DNS record.
    securityGroupIds List<String>
    A list of exoscalesecuritygroup (IDs) to attach to the instance.
    sshKey String
    The exoscalesshkey (name) to authorize in the instance (may only be set at creation time).
    state String
    The instance state (running or stopped; default: running).
    userData String
    cloud-init configuration.
    templateId string
    ❗ The exoscale.getTemplate (ID) to use when creating the instance.
    type string
    The instance type (<family>.<size>, e.g. standard.medium; use the Exoscale CLI - exo compute instance-type list - for the list of available types). WARNING: updating this attribute stops/restarts the instance.
    zone string
    ❗ The Exoscale Zone name.
    antiAffinityGroupIds string[]
    ❗ A list of exoscaleantiaffinity_group (IDs) to attach to the instance (may only be set at creation time).
    blockStorageVolumeIds string[]
    A list of exoscaleblockstorage_volume (ID) to attach to the instance.
    deployTargetId string
    ❗ A deploy target ID.
    destroyProtected boolean
    Mark the instance as protected, the Exoscale API will refuse to delete the instance until the protection is removed (boolean; default: false).
    diskSize number
    The instance disk size (GiB; at least 10). Can not be decreased after creation. WARNING: updating this attribute stops/restarts the instance.
    elasticIpIds string[]
    A list of exoscaleelasticip (IDs) to attach to the instance.
    ipv6 boolean
    Enable IPv6 on the instance (boolean; default: false).
    labels {[key: string]: string}
    A map of key/value labels.
    name string
    The compute instance name.
    networkInterfaces ComputeInstanceNetworkInterface[]
    Private network interfaces (may be specified multiple times). Structure is documented below.
    private boolean
    Whether the instance is private (no public IP addresses; default: false)
    reverseDns string
    Domain name for reverse DNS record.
    securityGroupIds string[]
    A list of exoscalesecuritygroup (IDs) to attach to the instance.
    sshKey string
    The exoscalesshkey (name) to authorize in the instance (may only be set at creation time).
    state string
    The instance state (running or stopped; default: running).
    userData string
    cloud-init configuration.
    template_id str
    ❗ The exoscale.getTemplate (ID) to use when creating the instance.
    type str
    The instance type (<family>.<size>, e.g. standard.medium; use the Exoscale CLI - exo compute instance-type list - for the list of available types). WARNING: updating this attribute stops/restarts the instance.
    zone str
    ❗ The Exoscale Zone name.
    anti_affinity_group_ids Sequence[str]
    ❗ A list of exoscaleantiaffinity_group (IDs) to attach to the instance (may only be set at creation time).
    block_storage_volume_ids Sequence[str]
    A list of exoscaleblockstorage_volume (ID) to attach to the instance.
    deploy_target_id str
    ❗ A deploy target ID.
    destroy_protected bool
    Mark the instance as protected, the Exoscale API will refuse to delete the instance until the protection is removed (boolean; default: false).
    disk_size int
    The instance disk size (GiB; at least 10). Can not be decreased after creation. WARNING: updating this attribute stops/restarts the instance.
    elastic_ip_ids Sequence[str]
    A list of exoscaleelasticip (IDs) to attach to the instance.
    ipv6 bool
    Enable IPv6 on the instance (boolean; default: false).
    labels Mapping[str, str]
    A map of key/value labels.
    name str
    The compute instance name.
    network_interfaces Sequence[ComputeInstanceNetworkInterfaceArgs]
    Private network interfaces (may be specified multiple times). Structure is documented below.
    private bool
    Whether the instance is private (no public IP addresses; default: false)
    reverse_dns str
    Domain name for reverse DNS record.
    security_group_ids Sequence[str]
    A list of exoscalesecuritygroup (IDs) to attach to the instance.
    ssh_key str
    The exoscalesshkey (name) to authorize in the instance (may only be set at creation time).
    state str
    The instance state (running or stopped; default: running).
    user_data str
    cloud-init configuration.
    templateId String
    ❗ The exoscale.getTemplate (ID) to use when creating the instance.
    type String
    The instance type (<family>.<size>, e.g. standard.medium; use the Exoscale CLI - exo compute instance-type list - for the list of available types). WARNING: updating this attribute stops/restarts the instance.
    zone String
    ❗ The Exoscale Zone name.
    antiAffinityGroupIds List<String>
    ❗ A list of exoscaleantiaffinity_group (IDs) to attach to the instance (may only be set at creation time).
    blockStorageVolumeIds List<String>
    A list of exoscaleblockstorage_volume (ID) to attach to the instance.
    deployTargetId String
    ❗ A deploy target ID.
    destroyProtected Boolean
    Mark the instance as protected, the Exoscale API will refuse to delete the instance until the protection is removed (boolean; default: false).
    diskSize Number
    The instance disk size (GiB; at least 10). Can not be decreased after creation. WARNING: updating this attribute stops/restarts the instance.
    elasticIpIds List<String>
    A list of exoscaleelasticip (IDs) to attach to the instance.
    ipv6 Boolean
    Enable IPv6 on the instance (boolean; default: false).
    labels Map<String>
    A map of key/value labels.
    name String
    The compute instance name.
    networkInterfaces List<Property Map>
    Private network interfaces (may be specified multiple times). Structure is documented below.
    private Boolean
    Whether the instance is private (no public IP addresses; default: false)
    reverseDns String
    Domain name for reverse DNS record.
    securityGroupIds List<String>
    A list of exoscalesecuritygroup (IDs) to attach to the instance.
    sshKey String
    The exoscalesshkey (name) to authorize in the instance (may only be set at creation time).
    state String
    The instance state (running or stopped; default: running).
    userData String
    cloud-init configuration.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ComputeInstance resource produces the following output properties:

    CreatedAt string
    The instance creation date.
    Id string
    The provider-assigned unique ID for this managed resource.
    Ipv6Address string
    The instance (main network interface) IPv6 address (if enabled).
    PrivateNetworkIds List<string>
    A list of private networks (IDs) attached to the instance. Please use the network_interface.*.network_id argument instead.

    Deprecated: Use the network_interface block instead.

    PublicIpAddress string
    The instance (main network interface) IPv4 address.
    CreatedAt string
    The instance creation date.
    Id string
    The provider-assigned unique ID for this managed resource.
    Ipv6Address string
    The instance (main network interface) IPv6 address (if enabled).
    PrivateNetworkIds []string
    A list of private networks (IDs) attached to the instance. Please use the network_interface.*.network_id argument instead.

    Deprecated: Use the network_interface block instead.

    PublicIpAddress string
    The instance (main network interface) IPv4 address.
    createdAt String
    The instance creation date.
    id String
    The provider-assigned unique ID for this managed resource.
    ipv6Address String
    The instance (main network interface) IPv6 address (if enabled).
    privateNetworkIds List<String>
    A list of private networks (IDs) attached to the instance. Please use the network_interface.*.network_id argument instead.

    Deprecated: Use the network_interface block instead.

    publicIpAddress String
    The instance (main network interface) IPv4 address.
    createdAt string
    The instance creation date.
    id string
    The provider-assigned unique ID for this managed resource.
    ipv6Address string
    The instance (main network interface) IPv6 address (if enabled).
    privateNetworkIds string[]
    A list of private networks (IDs) attached to the instance. Please use the network_interface.*.network_id argument instead.

    Deprecated: Use the network_interface block instead.

    publicIpAddress string
    The instance (main network interface) IPv4 address.
    created_at str
    The instance creation date.
    id str
    The provider-assigned unique ID for this managed resource.
    ipv6_address str
    The instance (main network interface) IPv6 address (if enabled).
    private_network_ids Sequence[str]
    A list of private networks (IDs) attached to the instance. Please use the network_interface.*.network_id argument instead.

    Deprecated: Use the network_interface block instead.

    public_ip_address str
    The instance (main network interface) IPv4 address.
    createdAt String
    The instance creation date.
    id String
    The provider-assigned unique ID for this managed resource.
    ipv6Address String
    The instance (main network interface) IPv6 address (if enabled).
    privateNetworkIds List<String>
    A list of private networks (IDs) attached to the instance. Please use the network_interface.*.network_id argument instead.

    Deprecated: Use the network_interface block instead.

    publicIpAddress String
    The instance (main network interface) IPv4 address.

    Look up Existing ComputeInstance Resource

    Get an existing ComputeInstance resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: ComputeInstanceState, opts?: CustomResourceOptions): ComputeInstance
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            anti_affinity_group_ids: Optional[Sequence[str]] = None,
            block_storage_volume_ids: Optional[Sequence[str]] = None,
            created_at: Optional[str] = None,
            deploy_target_id: Optional[str] = None,
            destroy_protected: Optional[bool] = None,
            disk_size: Optional[int] = None,
            elastic_ip_ids: Optional[Sequence[str]] = None,
            ipv6: Optional[bool] = None,
            ipv6_address: Optional[str] = None,
            labels: Optional[Mapping[str, str]] = None,
            name: Optional[str] = None,
            network_interfaces: Optional[Sequence[ComputeInstanceNetworkInterfaceArgs]] = None,
            private: Optional[bool] = None,
            private_network_ids: Optional[Sequence[str]] = None,
            public_ip_address: Optional[str] = None,
            reverse_dns: Optional[str] = None,
            security_group_ids: Optional[Sequence[str]] = None,
            ssh_key: Optional[str] = None,
            state: Optional[str] = None,
            template_id: Optional[str] = None,
            type: Optional[str] = None,
            user_data: Optional[str] = None,
            zone: Optional[str] = None) -> ComputeInstance
    func GetComputeInstance(ctx *Context, name string, id IDInput, state *ComputeInstanceState, opts ...ResourceOption) (*ComputeInstance, error)
    public static ComputeInstance Get(string name, Input<string> id, ComputeInstanceState? state, CustomResourceOptions? opts = null)
    public static ComputeInstance get(String name, Output<String> id, ComputeInstanceState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    AntiAffinityGroupIds List<string>
    ❗ A list of exoscaleantiaffinity_group (IDs) to attach to the instance (may only be set at creation time).
    BlockStorageVolumeIds List<string>
    A list of exoscaleblockstorage_volume (ID) to attach to the instance.
    CreatedAt string
    The instance creation date.
    DeployTargetId string
    ❗ A deploy target ID.
    DestroyProtected bool
    Mark the instance as protected, the Exoscale API will refuse to delete the instance until the protection is removed (boolean; default: false).
    DiskSize int
    The instance disk size (GiB; at least 10). Can not be decreased after creation. WARNING: updating this attribute stops/restarts the instance.
    ElasticIpIds List<string>
    A list of exoscaleelasticip (IDs) to attach to the instance.
    Ipv6 bool
    Enable IPv6 on the instance (boolean; default: false).
    Ipv6Address string
    The instance (main network interface) IPv6 address (if enabled).
    Labels Dictionary<string, string>
    A map of key/value labels.
    Name string
    The compute instance name.
    NetworkInterfaces List<Pulumiverse.Exoscale.Inputs.ComputeInstanceNetworkInterface>
    Private network interfaces (may be specified multiple times). Structure is documented below.
    Private bool
    Whether the instance is private (no public IP addresses; default: false)
    PrivateNetworkIds List<string>
    A list of private networks (IDs) attached to the instance. Please use the network_interface.*.network_id argument instead.

    Deprecated: Use the network_interface block instead.

    PublicIpAddress string
    The instance (main network interface) IPv4 address.
    ReverseDns string
    Domain name for reverse DNS record.
    SecurityGroupIds List<string>
    A list of exoscalesecuritygroup (IDs) to attach to the instance.
    SshKey string
    The exoscalesshkey (name) to authorize in the instance (may only be set at creation time).
    State string
    The instance state (running or stopped; default: running).
    TemplateId string
    ❗ The exoscale.getTemplate (ID) to use when creating the instance.
    Type string
    The instance type (<family>.<size>, e.g. standard.medium; use the Exoscale CLI - exo compute instance-type list - for the list of available types). WARNING: updating this attribute stops/restarts the instance.
    UserData string
    cloud-init configuration.
    Zone string
    ❗ The Exoscale Zone name.
    AntiAffinityGroupIds []string
    ❗ A list of exoscaleantiaffinity_group (IDs) to attach to the instance (may only be set at creation time).
    BlockStorageVolumeIds []string
    A list of exoscaleblockstorage_volume (ID) to attach to the instance.
    CreatedAt string
    The instance creation date.
    DeployTargetId string
    ❗ A deploy target ID.
    DestroyProtected bool
    Mark the instance as protected, the Exoscale API will refuse to delete the instance until the protection is removed (boolean; default: false).
    DiskSize int
    The instance disk size (GiB; at least 10). Can not be decreased after creation. WARNING: updating this attribute stops/restarts the instance.
    ElasticIpIds []string
    A list of exoscaleelasticip (IDs) to attach to the instance.
    Ipv6 bool
    Enable IPv6 on the instance (boolean; default: false).
    Ipv6Address string
    The instance (main network interface) IPv6 address (if enabled).
    Labels map[string]string
    A map of key/value labels.
    Name string
    The compute instance name.
    NetworkInterfaces []ComputeInstanceNetworkInterfaceArgs
    Private network interfaces (may be specified multiple times). Structure is documented below.
    Private bool
    Whether the instance is private (no public IP addresses; default: false)
    PrivateNetworkIds []string
    A list of private networks (IDs) attached to the instance. Please use the network_interface.*.network_id argument instead.

    Deprecated: Use the network_interface block instead.

    PublicIpAddress string
    The instance (main network interface) IPv4 address.
    ReverseDns string
    Domain name for reverse DNS record.
    SecurityGroupIds []string
    A list of exoscalesecuritygroup (IDs) to attach to the instance.
    SshKey string
    The exoscalesshkey (name) to authorize in the instance (may only be set at creation time).
    State string
    The instance state (running or stopped; default: running).
    TemplateId string
    ❗ The exoscale.getTemplate (ID) to use when creating the instance.
    Type string
    The instance type (<family>.<size>, e.g. standard.medium; use the Exoscale CLI - exo compute instance-type list - for the list of available types). WARNING: updating this attribute stops/restarts the instance.
    UserData string
    cloud-init configuration.
    Zone string
    ❗ The Exoscale Zone name.
    antiAffinityGroupIds List<String>
    ❗ A list of exoscaleantiaffinity_group (IDs) to attach to the instance (may only be set at creation time).
    blockStorageVolumeIds List<String>
    A list of exoscaleblockstorage_volume (ID) to attach to the instance.
    createdAt String
    The instance creation date.
    deployTargetId String
    ❗ A deploy target ID.
    destroyProtected Boolean
    Mark the instance as protected, the Exoscale API will refuse to delete the instance until the protection is removed (boolean; default: false).
    diskSize Integer
    The instance disk size (GiB; at least 10). Can not be decreased after creation. WARNING: updating this attribute stops/restarts the instance.
    elasticIpIds List<String>
    A list of exoscaleelasticip (IDs) to attach to the instance.
    ipv6 Boolean
    Enable IPv6 on the instance (boolean; default: false).
    ipv6Address String
    The instance (main network interface) IPv6 address (if enabled).
    labels Map<String,String>
    A map of key/value labels.
    name String
    The compute instance name.
    networkInterfaces List<ComputeInstanceNetworkInterface>
    Private network interfaces (may be specified multiple times). Structure is documented below.
    privateNetworkIds List<String>
    A list of private networks (IDs) attached to the instance. Please use the network_interface.*.network_id argument instead.

    Deprecated: Use the network_interface block instead.

    private_ Boolean
    Whether the instance is private (no public IP addresses; default: false)
    publicIpAddress String
    The instance (main network interface) IPv4 address.
    reverseDns String
    Domain name for reverse DNS record.
    securityGroupIds List<String>
    A list of exoscalesecuritygroup (IDs) to attach to the instance.
    sshKey String
    The exoscalesshkey (name) to authorize in the instance (may only be set at creation time).
    state String
    The instance state (running or stopped; default: running).
    templateId String
    ❗ The exoscale.getTemplate (ID) to use when creating the instance.
    type String
    The instance type (<family>.<size>, e.g. standard.medium; use the Exoscale CLI - exo compute instance-type list - for the list of available types). WARNING: updating this attribute stops/restarts the instance.
    userData String
    cloud-init configuration.
    zone String
    ❗ The Exoscale Zone name.
    antiAffinityGroupIds string[]
    ❗ A list of exoscaleantiaffinity_group (IDs) to attach to the instance (may only be set at creation time).
    blockStorageVolumeIds string[]
    A list of exoscaleblockstorage_volume (ID) to attach to the instance.
    createdAt string
    The instance creation date.
    deployTargetId string
    ❗ A deploy target ID.
    destroyProtected boolean
    Mark the instance as protected, the Exoscale API will refuse to delete the instance until the protection is removed (boolean; default: false).
    diskSize number
    The instance disk size (GiB; at least 10). Can not be decreased after creation. WARNING: updating this attribute stops/restarts the instance.
    elasticIpIds string[]
    A list of exoscaleelasticip (IDs) to attach to the instance.
    ipv6 boolean
    Enable IPv6 on the instance (boolean; default: false).
    ipv6Address string
    The instance (main network interface) IPv6 address (if enabled).
    labels {[key: string]: string}
    A map of key/value labels.
    name string
    The compute instance name.
    networkInterfaces ComputeInstanceNetworkInterface[]
    Private network interfaces (may be specified multiple times). Structure is documented below.
    private boolean
    Whether the instance is private (no public IP addresses; default: false)
    privateNetworkIds string[]
    A list of private networks (IDs) attached to the instance. Please use the network_interface.*.network_id argument instead.

    Deprecated: Use the network_interface block instead.

    publicIpAddress string
    The instance (main network interface) IPv4 address.
    reverseDns string
    Domain name for reverse DNS record.
    securityGroupIds string[]
    A list of exoscalesecuritygroup (IDs) to attach to the instance.
    sshKey string
    The exoscalesshkey (name) to authorize in the instance (may only be set at creation time).
    state string
    The instance state (running or stopped; default: running).
    templateId string
    ❗ The exoscale.getTemplate (ID) to use when creating the instance.
    type string
    The instance type (<family>.<size>, e.g. standard.medium; use the Exoscale CLI - exo compute instance-type list - for the list of available types). WARNING: updating this attribute stops/restarts the instance.
    userData string
    cloud-init configuration.
    zone string
    ❗ The Exoscale Zone name.
    anti_affinity_group_ids Sequence[str]
    ❗ A list of exoscaleantiaffinity_group (IDs) to attach to the instance (may only be set at creation time).
    block_storage_volume_ids Sequence[str]
    A list of exoscaleblockstorage_volume (ID) to attach to the instance.
    created_at str
    The instance creation date.
    deploy_target_id str
    ❗ A deploy target ID.
    destroy_protected bool
    Mark the instance as protected, the Exoscale API will refuse to delete the instance until the protection is removed (boolean; default: false).
    disk_size int
    The instance disk size (GiB; at least 10). Can not be decreased after creation. WARNING: updating this attribute stops/restarts the instance.
    elastic_ip_ids Sequence[str]
    A list of exoscaleelasticip (IDs) to attach to the instance.
    ipv6 bool
    Enable IPv6 on the instance (boolean; default: false).
    ipv6_address str
    The instance (main network interface) IPv6 address (if enabled).
    labels Mapping[str, str]
    A map of key/value labels.
    name str
    The compute instance name.
    network_interfaces Sequence[ComputeInstanceNetworkInterfaceArgs]
    Private network interfaces (may be specified multiple times). Structure is documented below.
    private bool
    Whether the instance is private (no public IP addresses; default: false)
    private_network_ids Sequence[str]
    A list of private networks (IDs) attached to the instance. Please use the network_interface.*.network_id argument instead.

    Deprecated: Use the network_interface block instead.

    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]
    A list of exoscalesecuritygroup (IDs) to attach to the instance.
    ssh_key str
    The exoscalesshkey (name) to authorize in the instance (may only be set at creation time).
    state str
    The instance state (running or stopped; default: running).
    template_id str
    ❗ The exoscale.getTemplate (ID) to use when creating the instance.
    type str
    The instance type (<family>.<size>, e.g. standard.medium; use the Exoscale CLI - exo compute instance-type list - for the list of available types). WARNING: updating this attribute stops/restarts the instance.
    user_data str
    cloud-init configuration.
    zone str
    ❗ The Exoscale Zone name.
    antiAffinityGroupIds List<String>
    ❗ A list of exoscaleantiaffinity_group (IDs) to attach to the instance (may only be set at creation time).
    blockStorageVolumeIds List<String>
    A list of exoscaleblockstorage_volume (ID) to attach to the instance.
    createdAt String
    The instance creation date.
    deployTargetId String
    ❗ A deploy target ID.
    destroyProtected Boolean
    Mark the instance as protected, the Exoscale API will refuse to delete the instance until the protection is removed (boolean; default: false).
    diskSize Number
    The instance disk size (GiB; at least 10). Can not be decreased after creation. WARNING: updating this attribute stops/restarts the instance.
    elasticIpIds List<String>
    A list of exoscaleelasticip (IDs) to attach to the instance.
    ipv6 Boolean
    Enable IPv6 on the instance (boolean; default: false).
    ipv6Address String
    The instance (main network interface) IPv6 address (if enabled).
    labels Map<String>
    A map of key/value labels.
    name String
    The compute instance name.
    networkInterfaces List<Property Map>
    Private network interfaces (may be specified multiple times). Structure is documented below.
    private Boolean
    Whether the instance is private (no public IP addresses; default: false)
    privateNetworkIds List<String>
    A list of private networks (IDs) attached to the instance. Please use the network_interface.*.network_id argument instead.

    Deprecated: Use the network_interface block instead.

    publicIpAddress String
    The instance (main network interface) IPv4 address.
    reverseDns String
    Domain name for reverse DNS record.
    securityGroupIds List<String>
    A list of exoscalesecuritygroup (IDs) to attach to the instance.
    sshKey String
    The exoscalesshkey (name) to authorize in the instance (may only be set at creation time).
    state String
    The instance state (running or stopped; default: running).
    templateId String
    ❗ The exoscale.getTemplate (ID) to use when creating the instance.
    type String
    The instance type (<family>.<size>, e.g. standard.medium; use the Exoscale CLI - exo compute instance-type list - for the list of available types). WARNING: updating this attribute stops/restarts the instance.
    userData String
    cloud-init configuration.
    zone String
    ❗ The Exoscale Zone name.

    Supporting Types

    ComputeInstanceNetworkInterface, ComputeInstanceNetworkInterfaceArgs

    NetworkId string
    The exoscaleprivatenetwork (ID) to attach to the instance.
    IpAddress string
    The IPv4 address to request as static DHCP lease if the network interface is attached to a managed private network.
    NetworkId string
    The exoscaleprivatenetwork (ID) to attach to the instance.
    IpAddress string
    The IPv4 address to request as static DHCP lease if the network interface is attached to a managed private network.
    networkId String
    The exoscaleprivatenetwork (ID) to attach to the instance.
    ipAddress String
    The IPv4 address to request as static DHCP lease if the network interface is attached to a managed private network.
    networkId string
    The exoscaleprivatenetwork (ID) to attach to the instance.
    ipAddress string
    The IPv4 address to request as static DHCP lease if the network interface is attached to a managed private network.
    network_id str
    The exoscaleprivatenetwork (ID) to attach to the instance.
    ip_address str
    The IPv4 address to request as static DHCP lease if the network interface is attached to a managed private network.
    networkId String
    The exoscaleprivatenetwork (ID) to attach to the instance.
    ipAddress String
    The IPv4 address to request as static DHCP lease if the network interface is attached to a managed private network.

    Import

    An existing compute instance may be imported by <ID>@<zone>:

    $ pulumi import exoscale:index/computeInstance:ComputeInstance \
    

    exoscale_compute_instance.my_instance \

    f81d4fae-7dec-11d0-a765-00a0c91e6bf6@ch-gva-2

    To learn more about importing existing cloud resources, see Importing resources.

    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