exoscale.ComputeInstance
Explore with Pulumi AI
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:
- Template
Id 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.
- Anti
Affinity List<string>Group Ids - ❗ A list of exoscaleantiaffinity_group (IDs) to attach to the instance (may only be set at creation time).
- Block
Storage List<string>Volume Ids - A list of exoscaleblockstorage_volume (ID) to attach to the instance.
- Deploy
Target stringId - ❗ 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 List<string>Ids - 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.
- Network
Interfaces List<Pulumiverse.Exoscale. Inputs. Compute Instance Network Interface> - 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 string - Domain name for reverse DNS record.
- Security
Group List<string>Ids - A list of exoscalesecuritygroup (IDs) to attach to the instance.
- Ssh
Key string - The exoscalesshkey (name) to authorize in the instance (may only be set at creation time).
- State string
- The instance state (
running
orstopped
; default:running
). - User
Data string - cloud-init configuration.
- Template
Id 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.
- Anti
Affinity []stringGroup Ids - ❗ A list of exoscaleantiaffinity_group (IDs) to attach to the instance (may only be set at creation time).
- Block
Storage []stringVolume Ids - A list of exoscaleblockstorage_volume (ID) to attach to the instance.
- Deploy
Target stringId - ❗ 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 []stringIds - 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.
- Network
Interfaces []ComputeInstance Network Interface Args - 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 string - Domain name for reverse DNS record.
- Security
Group []stringIds - A list of exoscalesecuritygroup (IDs) to attach to the instance.
- Ssh
Key string - The exoscalesshkey (name) to authorize in the instance (may only be set at creation time).
- State string
- The instance state (
running
orstopped
; default:running
). - User
Data string - cloud-init configuration.
- template
Id 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.
- anti
Affinity List<String>Group Ids - ❗ A list of exoscaleantiaffinity_group (IDs) to attach to the instance (may only be set at creation time).
- block
Storage List<String>Volume Ids - A list of exoscaleblockstorage_volume (ID) to attach to the instance.
- deploy
Target StringId - ❗ A deploy target ID.
- destroy
Protected Boolean - Mark the instance as protected, the Exoscale API will refuse to delete the instance until the protection is removed (boolean; default:
false
). - disk
Size Integer - The instance disk size (GiB; at least
10
). Can not be decreased after creation. WARNING: updating this attribute stops/restarts the instance. - elastic
Ip List<String>Ids - 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.
- network
Interfaces List<ComputeInstance Network Interface> - 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)
- reverse
Dns String - Domain name for reverse DNS record.
- security
Group List<String>Ids - A list of exoscalesecuritygroup (IDs) to attach to the instance.
- ssh
Key String - The exoscalesshkey (name) to authorize in the instance (may only be set at creation time).
- state String
- The instance state (
running
orstopped
; default:running
). - user
Data String - cloud-init configuration.
- template
Id 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.
- anti
Affinity string[]Group Ids - ❗ A list of exoscaleantiaffinity_group (IDs) to attach to the instance (may only be set at creation time).
- block
Storage string[]Volume Ids - A list of exoscaleblockstorage_volume (ID) to attach to the instance.
- deploy
Target stringId - ❗ A deploy target ID.
- destroy
Protected boolean - Mark the instance as protected, the Exoscale API will refuse to delete the instance until the protection is removed (boolean; default:
false
). - disk
Size number - The instance disk size (GiB; at least
10
). Can not be decreased after creation. WARNING: updating this attribute stops/restarts the instance. - elastic
Ip string[]Ids - 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.
- network
Interfaces ComputeInstance Network Interface[] - 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)
- reverse
Dns string - Domain name for reverse DNS record.
- security
Group string[]Ids - A list of exoscalesecuritygroup (IDs) to attach to the instance.
- ssh
Key string - The exoscalesshkey (name) to authorize in the instance (may only be set at creation time).
- state string
- The instance state (
running
orstopped
; default:running
). - user
Data 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_ Sequence[str]group_ ids - ❗ A list of exoscaleantiaffinity_group (IDs) to attach to the instance (may only be set at creation time).
- block_
storage_ Sequence[str]volume_ ids - A list of exoscaleblockstorage_volume (ID) to attach to the instance.
- deploy_
target_ strid - ❗ 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_ Sequence[str]ids - 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[ComputeInstance Network Interface Args] - 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_ Sequence[str]ids - 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
orstopped
; default:running
). - user_
data str - cloud-init configuration.
- template
Id 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.
- anti
Affinity List<String>Group Ids - ❗ A list of exoscaleantiaffinity_group (IDs) to attach to the instance (may only be set at creation time).
- block
Storage List<String>Volume Ids - A list of exoscaleblockstorage_volume (ID) to attach to the instance.
- deploy
Target StringId - ❗ A deploy target ID.
- destroy
Protected Boolean - Mark the instance as protected, the Exoscale API will refuse to delete the instance until the protection is removed (boolean; default:
false
). - disk
Size Number - The instance disk size (GiB; at least
10
). Can not be decreased after creation. WARNING: updating this attribute stops/restarts the instance. - elastic
Ip List<String>Ids - 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.
- network
Interfaces 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)
- reverse
Dns String - Domain name for reverse DNS record.
- security
Group List<String>Ids - A list of exoscalesecuritygroup (IDs) to attach to the instance.
- ssh
Key String - The exoscalesshkey (name) to authorize in the instance (may only be set at creation time).
- state String
- The instance state (
running
orstopped
; default:running
). - user
Data String - cloud-init configuration.
Outputs
All input properties are implicitly available as output properties. Additionally, the ComputeInstance resource produces the following output properties:
- Created
At 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).
- Private
Network List<string>Ids - A list of private networks (IDs) attached to the instance. Please use the
network_interface.*.network_id
argument instead. - Public
Ip stringAddress - The instance (main network interface) IPv4 address.
- Created
At 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).
- Private
Network []stringIds - A list of private networks (IDs) attached to the instance. Please use the
network_interface.*.network_id
argument instead. - Public
Ip stringAddress - The instance (main network interface) IPv4 address.
- created
At 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).
- private
Network List<String>Ids - A list of private networks (IDs) attached to the instance. Please use the
network_interface.*.network_id
argument instead. - public
Ip StringAddress - The instance (main network interface) IPv4 address.
- created
At 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).
- private
Network string[]Ids - A list of private networks (IDs) attached to the instance. Please use the
network_interface.*.network_id
argument instead. - public
Ip stringAddress - 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_ Sequence[str]ids - A list of private networks (IDs) attached to the instance. Please use the
network_interface.*.network_id
argument instead. - public_
ip_ straddress - The instance (main network interface) IPv4 address.
- created
At 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).
- private
Network List<String>Ids - A list of private networks (IDs) attached to the instance. Please use the
network_interface.*.network_id
argument instead. - public
Ip StringAddress - 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.
- Anti
Affinity List<string>Group Ids - ❗ A list of exoscaleantiaffinity_group (IDs) to attach to the instance (may only be set at creation time).
- Block
Storage List<string>Volume Ids - A list of exoscaleblockstorage_volume (ID) to attach to the instance.
- Created
At string - The instance creation date.
- Deploy
Target stringId - ❗ 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 List<string>Ids - 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.
- Network
Interfaces List<Pulumiverse.Exoscale. Inputs. Compute Instance Network Interface> - 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 List<string>Ids - A list of private networks (IDs) attached to the instance. Please use the
network_interface.*.network_id
argument instead. - Public
Ip stringAddress - The instance (main network interface) IPv4 address.
- Reverse
Dns string - Domain name for reverse DNS record.
- Security
Group List<string>Ids - A list of exoscalesecuritygroup (IDs) to attach to the instance.
- Ssh
Key string - The exoscalesshkey (name) to authorize in the instance (may only be set at creation time).
- State string
- The instance state (
running
orstopped
; default:running
). - Template
Id 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. - User
Data string - cloud-init configuration.
- Zone string
- ❗ The Exoscale Zone name.
- Anti
Affinity []stringGroup Ids - ❗ A list of exoscaleantiaffinity_group (IDs) to attach to the instance (may only be set at creation time).
- Block
Storage []stringVolume Ids - A list of exoscaleblockstorage_volume (ID) to attach to the instance.
- Created
At string - The instance creation date.
- Deploy
Target stringId - ❗ 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 []stringIds - 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.
- Network
Interfaces []ComputeInstance Network Interface Args - 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 []stringIds - A list of private networks (IDs) attached to the instance. Please use the
network_interface.*.network_id
argument instead. - Public
Ip stringAddress - The instance (main network interface) IPv4 address.
- Reverse
Dns string - Domain name for reverse DNS record.
- Security
Group []stringIds - A list of exoscalesecuritygroup (IDs) to attach to the instance.
- Ssh
Key string - The exoscalesshkey (name) to authorize in the instance (may only be set at creation time).
- State string
- The instance state (
running
orstopped
; default:running
). - Template
Id 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. - User
Data string - cloud-init configuration.
- Zone string
- ❗ The Exoscale Zone name.
- anti
Affinity List<String>Group Ids - ❗ A list of exoscaleantiaffinity_group (IDs) to attach to the instance (may only be set at creation time).
- block
Storage List<String>Volume Ids - A list of exoscaleblockstorage_volume (ID) to attach to the instance.
- created
At String - The instance creation date.
- deploy
Target StringId - ❗ A deploy target ID.
- destroy
Protected Boolean - Mark the instance as protected, the Exoscale API will refuse to delete the instance until the protection is removed (boolean; default:
false
). - disk
Size Integer - The instance disk size (GiB; at least
10
). Can not be decreased after creation. WARNING: updating this attribute stops/restarts the instance. - elastic
Ip List<String>Ids - 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.
- network
Interfaces List<ComputeInstance Network Interface> - Private network interfaces (may be specified multiple times). Structure is documented below.
- private
Network List<String>Ids - A list of private networks (IDs) attached to the instance. Please use the
network_interface.*.network_id
argument instead. - private_ Boolean
- Whether the instance is private (no public IP addresses; default: false)
- public
Ip StringAddress - The instance (main network interface) IPv4 address.
- reverse
Dns String - Domain name for reverse DNS record.
- security
Group List<String>Ids - A list of exoscalesecuritygroup (IDs) to attach to the instance.
- ssh
Key String - The exoscalesshkey (name) to authorize in the instance (may only be set at creation time).
- state String
- The instance state (
running
orstopped
; default:running
). - template
Id 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. - user
Data String - cloud-init configuration.
- zone String
- ❗ The Exoscale Zone name.
- anti
Affinity string[]Group Ids - ❗ A list of exoscaleantiaffinity_group (IDs) to attach to the instance (may only be set at creation time).
- block
Storage string[]Volume Ids - A list of exoscaleblockstorage_volume (ID) to attach to the instance.
- created
At string - The instance creation date.
- deploy
Target stringId - ❗ A deploy target ID.
- destroy
Protected boolean - Mark the instance as protected, the Exoscale API will refuse to delete the instance until the protection is removed (boolean; default:
false
). - disk
Size number - The instance disk size (GiB; at least
10
). Can not be decreased after creation. WARNING: updating this attribute stops/restarts the instance. - elastic
Ip string[]Ids - 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.
- network
Interfaces ComputeInstance Network Interface[] - 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)
- private
Network string[]Ids - A list of private networks (IDs) attached to the instance. Please use the
network_interface.*.network_id
argument instead. - public
Ip stringAddress - The instance (main network interface) IPv4 address.
- reverse
Dns string - Domain name for reverse DNS record.
- security
Group string[]Ids - A list of exoscalesecuritygroup (IDs) to attach to the instance.
- ssh
Key string - The exoscalesshkey (name) to authorize in the instance (may only be set at creation time).
- state string
- The instance state (
running
orstopped
; default:running
). - template
Id 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. - user
Data string - cloud-init configuration.
- zone string
- ❗ The Exoscale Zone name.
- anti_
affinity_ Sequence[str]group_ ids - ❗ A list of exoscaleantiaffinity_group (IDs) to attach to the instance (may only be set at creation time).
- block_
storage_ Sequence[str]volume_ ids - A list of exoscaleblockstorage_volume (ID) to attach to the instance.
- created_
at str - The instance creation date.
- deploy_
target_ strid - ❗ 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_ Sequence[str]ids - 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[ComputeInstance Network Interface Args] - 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_ Sequence[str]ids - A list of private networks (IDs) attached to the instance. Please use the
network_interface.*.network_id
argument instead. - public_
ip_ straddress - The instance (main network interface) IPv4 address.
- reverse_
dns str - Domain name for reverse DNS record.
- security_
group_ Sequence[str]ids - 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
orstopped
; 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.
- anti
Affinity List<String>Group Ids - ❗ A list of exoscaleantiaffinity_group (IDs) to attach to the instance (may only be set at creation time).
- block
Storage List<String>Volume Ids - A list of exoscaleblockstorage_volume (ID) to attach to the instance.
- created
At String - The instance creation date.
- deploy
Target StringId - ❗ A deploy target ID.
- destroy
Protected Boolean - Mark the instance as protected, the Exoscale API will refuse to delete the instance until the protection is removed (boolean; default:
false
). - disk
Size Number - The instance disk size (GiB; at least
10
). Can not be decreased after creation. WARNING: updating this attribute stops/restarts the instance. - elastic
Ip List<String>Ids - 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.
- network
Interfaces 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)
- private
Network List<String>Ids - A list of private networks (IDs) attached to the instance. Please use the
network_interface.*.network_id
argument instead. - public
Ip StringAddress - The instance (main network interface) IPv4 address.
- reverse
Dns String - Domain name for reverse DNS record.
- security
Group List<String>Ids - A list of exoscalesecuritygroup (IDs) to attach to the instance.
- ssh
Key String - The exoscalesshkey (name) to authorize in the instance (may only be set at creation time).
- state String
- The instance state (
running
orstopped
; default:running
). - template
Id 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. - user
Data String - cloud-init configuration.
- zone String
- ❗ The Exoscale Zone name.
Supporting Types
ComputeInstanceNetworkInterface, ComputeInstanceNetworkInterfaceArgs
- 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.
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.