civo.Instance
Explore with Pulumi AI
Provides a Civo instance resource. This can be used to create, modify, and delete instances.
Example Usage
- View instances after creation on the CLI:
civo instances ls
civo instances size
Simple and smallest instance with its own network
import * as pulumi from "@pulumi/pulumi";
import * as civo from "@pulumi/civo";
const exampleNetwork = new civo.Network("example", {label: "example-network"});
const example = new civo.Firewall("example", {
name: "example-firewall",
createDefaultRules: true,
networkId: exampleNetwork.id,
});
// Query instance disk image
const debian = civo.getDiskImage({
filters: [{
key: "name",
values: ["debian-10"],
}],
});
// Create a new instance
const exampleInstance = new civo.Instance("example", {
hostname: "example",
tags: [
"example",
"documentation",
],
notes: "This is an example instance",
firewallId: example.id,
networkId: exampleNetwork.id,
size: "g3.xsmall",
diskImage: debian.then(debian => debian.diskimages?.[0]?.id),
});
import pulumi
import pulumi_civo as civo
example_network = civo.Network("example", label="example-network")
example = civo.Firewall("example",
name="example-firewall",
create_default_rules=True,
network_id=example_network.id)
# Query instance disk image
debian = civo.get_disk_image(filters=[{
"key": "name",
"values": ["debian-10"],
}])
# Create a new instance
example_instance = civo.Instance("example",
hostname="example",
tags=[
"example",
"documentation",
],
notes="This is an example instance",
firewall_id=example.id,
network_id=example_network.id,
size="g3.xsmall",
disk_image=debian.diskimages[0].id)
package main
import (
"github.com/pulumi/pulumi-civo/sdk/v2/go/civo"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
exampleNetwork, err := civo.NewNetwork(ctx, "example", &civo.NetworkArgs{
Label: pulumi.String("example-network"),
})
if err != nil {
return err
}
example, err := civo.NewFirewall(ctx, "example", &civo.FirewallArgs{
Name: pulumi.String("example-firewall"),
CreateDefaultRules: pulumi.Bool(true),
NetworkId: exampleNetwork.ID(),
})
if err != nil {
return err
}
// Query instance disk image
debian, err := civo.GetDiskImage(ctx, &civo.GetDiskImageArgs{
Filters: []civo.GetDiskImageFilter{
{
Key: "name",
Values: []string{
"debian-10",
},
},
},
}, nil)
if err != nil {
return err
}
// Create a new instance
_, err = civo.NewInstance(ctx, "example", &civo.InstanceArgs{
Hostname: pulumi.String("example"),
Tags: pulumi.StringArray{
pulumi.String("example"),
pulumi.String("documentation"),
},
Notes: pulumi.String("This is an example instance"),
FirewallId: example.ID(),
NetworkId: exampleNetwork.ID(),
Size: pulumi.String("g3.xsmall"),
DiskImage: pulumi.String(debian.Diskimages[0].Id),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Civo = Pulumi.Civo;
return await Deployment.RunAsync(() =>
{
var exampleNetwork = new Civo.Network("example", new()
{
Label = "example-network",
});
var example = new Civo.Firewall("example", new()
{
Name = "example-firewall",
CreateDefaultRules = true,
NetworkId = exampleNetwork.Id,
});
// Query instance disk image
var debian = Civo.GetDiskImage.Invoke(new()
{
Filters = new[]
{
new Civo.Inputs.GetDiskImageFilterInputArgs
{
Key = "name",
Values = new[]
{
"debian-10",
},
},
},
});
// Create a new instance
var exampleInstance = new Civo.Instance("example", new()
{
Hostname = "example",
Tags = new[]
{
"example",
"documentation",
},
Notes = "This is an example instance",
FirewallId = example.Id,
NetworkId = exampleNetwork.Id,
Size = "g3.xsmall",
DiskImage = debian.Apply(getDiskImageResult => getDiskImageResult.Diskimages[0]?.Id),
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.civo.Network;
import com.pulumi.civo.NetworkArgs;
import com.pulumi.civo.Firewall;
import com.pulumi.civo.FirewallArgs;
import com.pulumi.civo.CivoFunctions;
import com.pulumi.civo.inputs.GetDiskImageArgs;
import com.pulumi.civo.Instance;
import com.pulumi.civo.InstanceArgs;
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) {
var exampleNetwork = new Network("exampleNetwork", NetworkArgs.builder()
.label("example-network")
.build());
var example = new Firewall("example", FirewallArgs.builder()
.name("example-firewall")
.createDefaultRules(true)
.networkId(exampleNetwork.id())
.build());
// Query instance disk image
final var debian = CivoFunctions.getDiskImage(GetDiskImageArgs.builder()
.filters(GetDiskImageFilterArgs.builder()
.key("name")
.values("debian-10")
.build())
.build());
// Create a new instance
var exampleInstance = new Instance("exampleInstance", InstanceArgs.builder()
.hostname("example")
.tags(
"example",
"documentation")
.notes("This is an example instance")
.firewallId(example.id())
.networkId(exampleNetwork.id())
.size("g3.xsmall")
.diskImage(debian.applyValue(getDiskImageResult -> getDiskImageResult.diskimages()[0].id()))
.build());
}
}
resources:
example:
type: civo:Firewall
properties:
name: example-firewall
createDefaultRules: true
networkId: ${exampleNetwork.id}
exampleNetwork:
type: civo:Network
name: example
properties:
label: example-network
# Create a new instance
exampleInstance:
type: civo:Instance
name: example
properties:
hostname: example
tags:
- example
- documentation
notes: This is an example instance
firewallId: ${example.id}
networkId: ${exampleNetwork.id}
size: g3.xsmall
diskImage: ${debian.diskimages[0].id}
variables:
# Query instance disk image
debian:
fn::invoke:
Function: civo:getDiskImage
Arguments:
filters:
- key: name
values:
- debian-10
With this configuration, an initial password for the instance gets written to the state on output initial_password
which you can use to access the instance.
Alternative you can get the password with the CLI:
civo instances show example
Instance with ssh login
import * as pulumi from "@pulumi/pulumi";
import * as civo from "@pulumi/civo";
import * as std from "@pulumi/std";
const exampleNetwork = new civo.Network("example", {label: "example-network"});
const example = new civo.Firewall("example", {
name: "example-firewall",
createDefaultRules: true,
networkId: exampleNetwork.id,
});
// Query instance disk image
const debian = civo.getDiskImage({
filters: [{
key: "name",
values: ["debian-10"],
}],
});
// To create the example key, run this command:
// ssh-keygen -f ~/.ssh/example-tf -C "terraform-example@localmachine"
const exampleSshKey = new civo.SshKey("example", {
name: "example",
publicKey: std.file({
input: "~/.ssh/example-tf.pub",
}).then(invoke => invoke.result),
});
// Create a new instance
const exampleInstance = new civo.Instance("example", {
hostname: "example",
tags: [
"example",
"documentation",
],
notes: "This is an example instance",
sshkeyId: exampleSshKey.id,
firewallId: example.id,
networkId: exampleNetwork.id,
size: "g3.xsmall",
diskImage: debian.then(debian => debian.diskimages?.[0]?.id),
});
import pulumi
import pulumi_civo as civo
import pulumi_std as std
example_network = civo.Network("example", label="example-network")
example = civo.Firewall("example",
name="example-firewall",
create_default_rules=True,
network_id=example_network.id)
# Query instance disk image
debian = civo.get_disk_image(filters=[{
"key": "name",
"values": ["debian-10"],
}])
# To create the example key, run this command:
# ssh-keygen -f ~/.ssh/example-tf -C "terraform-example@localmachine"
example_ssh_key = civo.SshKey("example",
name="example",
public_key=std.file(input="~/.ssh/example-tf.pub").result)
# Create a new instance
example_instance = civo.Instance("example",
hostname="example",
tags=[
"example",
"documentation",
],
notes="This is an example instance",
sshkey_id=example_ssh_key.id,
firewall_id=example.id,
network_id=example_network.id,
size="g3.xsmall",
disk_image=debian.diskimages[0].id)
package main
import (
"github.com/pulumi/pulumi-civo/sdk/v2/go/civo"
"github.com/pulumi/pulumi-std/sdk/go/std"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
exampleNetwork, err := civo.NewNetwork(ctx, "example", &civo.NetworkArgs{
Label: pulumi.String("example-network"),
})
if err != nil {
return err
}
example, err := civo.NewFirewall(ctx, "example", &civo.FirewallArgs{
Name: pulumi.String("example-firewall"),
CreateDefaultRules: pulumi.Bool(true),
NetworkId: exampleNetwork.ID(),
})
if err != nil {
return err
}
// Query instance disk image
debian, err := civo.GetDiskImage(ctx, &civo.GetDiskImageArgs{
Filters: []civo.GetDiskImageFilter{
{
Key: "name",
Values: []string{
"debian-10",
},
},
},
}, nil)
if err != nil {
return err
}
invokeFile, err := std.File(ctx, &std.FileArgs{
Input: "~/.ssh/example-tf.pub",
}, nil)
if err != nil {
return err
}
// To create the example key, run this command:
// ssh-keygen -f ~/.ssh/example-tf -C "terraform-example@localmachine"
exampleSshKey, err := civo.NewSshKey(ctx, "example", &civo.SshKeyArgs{
Name: pulumi.String("example"),
PublicKey: pulumi.String(invokeFile.Result),
})
if err != nil {
return err
}
// Create a new instance
_, err = civo.NewInstance(ctx, "example", &civo.InstanceArgs{
Hostname: pulumi.String("example"),
Tags: pulumi.StringArray{
pulumi.String("example"),
pulumi.String("documentation"),
},
Notes: pulumi.String("This is an example instance"),
SshkeyId: exampleSshKey.ID(),
FirewallId: example.ID(),
NetworkId: exampleNetwork.ID(),
Size: pulumi.String("g3.xsmall"),
DiskImage: pulumi.String(debian.Diskimages[0].Id),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Civo = Pulumi.Civo;
using Std = Pulumi.Std;
return await Deployment.RunAsync(() =>
{
var exampleNetwork = new Civo.Network("example", new()
{
Label = "example-network",
});
var example = new Civo.Firewall("example", new()
{
Name = "example-firewall",
CreateDefaultRules = true,
NetworkId = exampleNetwork.Id,
});
// Query instance disk image
var debian = Civo.GetDiskImage.Invoke(new()
{
Filters = new[]
{
new Civo.Inputs.GetDiskImageFilterInputArgs
{
Key = "name",
Values = new[]
{
"debian-10",
},
},
},
});
// To create the example key, run this command:
// ssh-keygen -f ~/.ssh/example-tf -C "terraform-example@localmachine"
var exampleSshKey = new Civo.SshKey("example", new()
{
Name = "example",
PublicKey = Std.File.Invoke(new()
{
Input = "~/.ssh/example-tf.pub",
}).Apply(invoke => invoke.Result),
});
// Create a new instance
var exampleInstance = new Civo.Instance("example", new()
{
Hostname = "example",
Tags = new[]
{
"example",
"documentation",
},
Notes = "This is an example instance",
SshkeyId = exampleSshKey.Id,
FirewallId = example.Id,
NetworkId = exampleNetwork.Id,
Size = "g3.xsmall",
DiskImage = debian.Apply(getDiskImageResult => getDiskImageResult.Diskimages[0]?.Id),
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.civo.Network;
import com.pulumi.civo.NetworkArgs;
import com.pulumi.civo.Firewall;
import com.pulumi.civo.FirewallArgs;
import com.pulumi.civo.CivoFunctions;
import com.pulumi.civo.inputs.GetDiskImageArgs;
import com.pulumi.civo.SshKey;
import com.pulumi.civo.SshKeyArgs;
import com.pulumi.civo.Instance;
import com.pulumi.civo.InstanceArgs;
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) {
var exampleNetwork = new Network("exampleNetwork", NetworkArgs.builder()
.label("example-network")
.build());
var example = new Firewall("example", FirewallArgs.builder()
.name("example-firewall")
.createDefaultRules(true)
.networkId(exampleNetwork.id())
.build());
// Query instance disk image
final var debian = CivoFunctions.getDiskImage(GetDiskImageArgs.builder()
.filters(GetDiskImageFilterArgs.builder()
.key("name")
.values("debian-10")
.build())
.build());
// To create the example key, run this command:
// ssh-keygen -f ~/.ssh/example-tf -C "terraform-example@localmachine"
var exampleSshKey = new SshKey("exampleSshKey", SshKeyArgs.builder()
.name("example")
.publicKey(StdFunctions.file(FileArgs.builder()
.input("~/.ssh/example-tf.pub")
.build()).result())
.build());
// Create a new instance
var exampleInstance = new Instance("exampleInstance", InstanceArgs.builder()
.hostname("example")
.tags(
"example",
"documentation")
.notes("This is an example instance")
.sshkeyId(exampleSshKey.id())
.firewallId(example.id())
.networkId(exampleNetwork.id())
.size("g3.xsmall")
.diskImage(debian.applyValue(getDiskImageResult -> getDiskImageResult.diskimages()[0].id()))
.build());
}
}
resources:
example:
type: civo:Firewall
properties:
name: example-firewall
createDefaultRules: true
networkId: ${exampleNetwork.id}
exampleNetwork:
type: civo:Network
name: example
properties:
label: example-network
# To create the example key, run this command:
# ssh-keygen -f ~/.ssh/example-tf -C "terraform-example@localmachine"
exampleSshKey:
type: civo:SshKey
name: example
properties:
name: example
publicKey:
fn::invoke:
Function: std:file
Arguments:
input: ~/.ssh/example-tf.pub
Return: result
# Create a new instance
exampleInstance:
type: civo:Instance
name: example
properties:
hostname: example
tags:
- example
- documentation
notes: This is an example instance
sshkeyId: ${exampleSshKey.id}
firewallId: ${example.id}
networkId: ${exampleNetwork.id}
size: g3.xsmall
diskImage: ${debian.diskimages[0].id}
variables:
# Query instance disk image
debian:
fn::invoke:
Function: civo:getDiskImage
Arguments:
filters:
- key: name
values:
- debian-10
Create Instance Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Instance(name: string, args: InstanceArgs, opts?: CustomResourceOptions);
@overload
def Instance(resource_name: str,
args: InstanceArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Instance(resource_name: str,
opts: Optional[ResourceOptions] = None,
disk_image: Optional[str] = None,
firewall_id: Optional[str] = None,
hostname: Optional[str] = None,
initial_user: Optional[str] = None,
network_id: Optional[str] = None,
notes: Optional[str] = None,
private_ipv4: Optional[str] = None,
public_ip_required: Optional[str] = None,
region: Optional[str] = None,
reserved_ipv4: Optional[str] = None,
reverse_dns: Optional[str] = None,
script: Optional[str] = None,
size: Optional[str] = None,
sshkey_id: Optional[str] = None,
tags: Optional[Sequence[str]] = None,
write_password: Optional[bool] = None)
func NewInstance(ctx *Context, name string, args InstanceArgs, opts ...ResourceOption) (*Instance, error)
public Instance(string name, InstanceArgs args, CustomResourceOptions? opts = null)
public Instance(String name, InstanceArgs args)
public Instance(String name, InstanceArgs args, CustomResourceOptions options)
type: civo:Instance
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 InstanceArgs
- 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 InstanceArgs
- 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 InstanceArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args InstanceArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args InstanceArgs
- 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 instanceResource = new Civo.Instance("instanceResource", new()
{
DiskImage = "string",
FirewallId = "string",
Hostname = "string",
InitialUser = "string",
NetworkId = "string",
Notes = "string",
PrivateIpv4 = "string",
PublicIpRequired = "string",
Region = "string",
ReservedIpv4 = "string",
ReverseDns = "string",
Script = "string",
Size = "string",
SshkeyId = "string",
Tags = new[]
{
"string",
},
WritePassword = false,
});
example, err := civo.NewInstance(ctx, "instanceResource", &civo.InstanceArgs{
DiskImage: pulumi.String("string"),
FirewallId: pulumi.String("string"),
Hostname: pulumi.String("string"),
InitialUser: pulumi.String("string"),
NetworkId: pulumi.String("string"),
Notes: pulumi.String("string"),
PrivateIpv4: pulumi.String("string"),
PublicIpRequired: pulumi.String("string"),
Region: pulumi.String("string"),
ReservedIpv4: pulumi.String("string"),
ReverseDns: pulumi.String("string"),
Script: pulumi.String("string"),
Size: pulumi.String("string"),
SshkeyId: pulumi.String("string"),
Tags: pulumi.StringArray{
pulumi.String("string"),
},
WritePassword: pulumi.Bool(false),
})
var instanceResource = new Instance("instanceResource", InstanceArgs.builder()
.diskImage("string")
.firewallId("string")
.hostname("string")
.initialUser("string")
.networkId("string")
.notes("string")
.privateIpv4("string")
.publicIpRequired("string")
.region("string")
.reservedIpv4("string")
.reverseDns("string")
.script("string")
.size("string")
.sshkeyId("string")
.tags("string")
.writePassword(false)
.build());
instance_resource = civo.Instance("instanceResource",
disk_image="string",
firewall_id="string",
hostname="string",
initial_user="string",
network_id="string",
notes="string",
private_ipv4="string",
public_ip_required="string",
region="string",
reserved_ipv4="string",
reverse_dns="string",
script="string",
size="string",
sshkey_id="string",
tags=["string"],
write_password=False)
const instanceResource = new civo.Instance("instanceResource", {
diskImage: "string",
firewallId: "string",
hostname: "string",
initialUser: "string",
networkId: "string",
notes: "string",
privateIpv4: "string",
publicIpRequired: "string",
region: "string",
reservedIpv4: "string",
reverseDns: "string",
script: "string",
size: "string",
sshkeyId: "string",
tags: ["string"],
writePassword: false,
});
type: civo:Instance
properties:
diskImage: string
firewallId: string
hostname: string
initialUser: string
networkId: string
notes: string
privateIpv4: string
publicIpRequired: string
region: string
reservedIpv4: string
reverseDns: string
script: string
size: string
sshkeyId: string
tags:
- string
writePassword: false
Instance 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 Instance resource accepts the following input properties:
- Disk
Image string - The ID for the disk image to use to build the instance
- Firewall
Id string - The ID of the firewall to use, from the current list. If left blank or not sent, the default firewall will be used (open to all)
- Hostname string
- A fully qualified domain name that should be set as the instance's hostname
- Initial
User string - The name of the initial user created on the server (optional; this will default to the template's default_username and fallback to civo)
- Network
Id string - This must be the ID of the network from the network listing (optional; default network used when not specified)
- Notes string
- Add some notes to the instance
- Private
Ipv4 string - The private IPv4 address for the instance (optional)
- Public
Ip stringRequired - This should be either 'none' or 'create' (default: 'create')
- Region string
- The region for the instance, if not declare we use the region in declared in the provider
- Reserved
Ipv4 string - Can be either the UUID, name, or the IP address of the reserved IP
- Reverse
Dns string - A fully qualified domain name that should be used as the instance's IP's reverse DNS (optional, uses the hostname if unspecified)
- Script string
- The contents of a script that will be uploaded to /usr/local/bin/civo-user-init-script on your instance, read/write/executable only by root and then will be executed at the end of the cloud initialization
- Size string
- The name of the size, from the current list, e.g. g3.xsmall
- Sshkey
Id string - The ID of an already uploaded SSH public key to use for login to the default user (optional; if one isn't provided a random password will be set and returned in the initial_password field)
- List<string>
- An optional list of tags, represented as a key, value pair
- Write
Password bool
- Disk
Image string - The ID for the disk image to use to build the instance
- Firewall
Id string - The ID of the firewall to use, from the current list. If left blank or not sent, the default firewall will be used (open to all)
- Hostname string
- A fully qualified domain name that should be set as the instance's hostname
- Initial
User string - The name of the initial user created on the server (optional; this will default to the template's default_username and fallback to civo)
- Network
Id string - This must be the ID of the network from the network listing (optional; default network used when not specified)
- Notes string
- Add some notes to the instance
- Private
Ipv4 string - The private IPv4 address for the instance (optional)
- Public
Ip stringRequired - This should be either 'none' or 'create' (default: 'create')
- Region string
- The region for the instance, if not declare we use the region in declared in the provider
- Reserved
Ipv4 string - Can be either the UUID, name, or the IP address of the reserved IP
- Reverse
Dns string - A fully qualified domain name that should be used as the instance's IP's reverse DNS (optional, uses the hostname if unspecified)
- Script string
- The contents of a script that will be uploaded to /usr/local/bin/civo-user-init-script on your instance, read/write/executable only by root and then will be executed at the end of the cloud initialization
- Size string
- The name of the size, from the current list, e.g. g3.xsmall
- Sshkey
Id string - The ID of an already uploaded SSH public key to use for login to the default user (optional; if one isn't provided a random password will be set and returned in the initial_password field)
- []string
- An optional list of tags, represented as a key, value pair
- Write
Password bool
- disk
Image String - The ID for the disk image to use to build the instance
- firewall
Id String - The ID of the firewall to use, from the current list. If left blank or not sent, the default firewall will be used (open to all)
- hostname String
- A fully qualified domain name that should be set as the instance's hostname
- initial
User String - The name of the initial user created on the server (optional; this will default to the template's default_username and fallback to civo)
- network
Id String - This must be the ID of the network from the network listing (optional; default network used when not specified)
- notes String
- Add some notes to the instance
- private
Ipv4 String - The private IPv4 address for the instance (optional)
- public
Ip StringRequired - This should be either 'none' or 'create' (default: 'create')
- region String
- The region for the instance, if not declare we use the region in declared in the provider
- reserved
Ipv4 String - Can be either the UUID, name, or the IP address of the reserved IP
- reverse
Dns String - A fully qualified domain name that should be used as the instance's IP's reverse DNS (optional, uses the hostname if unspecified)
- script String
- The contents of a script that will be uploaded to /usr/local/bin/civo-user-init-script on your instance, read/write/executable only by root and then will be executed at the end of the cloud initialization
- size String
- The name of the size, from the current list, e.g. g3.xsmall
- sshkey
Id String - The ID of an already uploaded SSH public key to use for login to the default user (optional; if one isn't provided a random password will be set and returned in the initial_password field)
- List<String>
- An optional list of tags, represented as a key, value pair
- write
Password Boolean
- disk
Image string - The ID for the disk image to use to build the instance
- firewall
Id string - The ID of the firewall to use, from the current list. If left blank or not sent, the default firewall will be used (open to all)
- hostname string
- A fully qualified domain name that should be set as the instance's hostname
- initial
User string - The name of the initial user created on the server (optional; this will default to the template's default_username and fallback to civo)
- network
Id string - This must be the ID of the network from the network listing (optional; default network used when not specified)
- notes string
- Add some notes to the instance
- private
Ipv4 string - The private IPv4 address for the instance (optional)
- public
Ip stringRequired - This should be either 'none' or 'create' (default: 'create')
- region string
- The region for the instance, if not declare we use the region in declared in the provider
- reserved
Ipv4 string - Can be either the UUID, name, or the IP address of the reserved IP
- reverse
Dns string - A fully qualified domain name that should be used as the instance's IP's reverse DNS (optional, uses the hostname if unspecified)
- script string
- The contents of a script that will be uploaded to /usr/local/bin/civo-user-init-script on your instance, read/write/executable only by root and then will be executed at the end of the cloud initialization
- size string
- The name of the size, from the current list, e.g. g3.xsmall
- sshkey
Id string - The ID of an already uploaded SSH public key to use for login to the default user (optional; if one isn't provided a random password will be set and returned in the initial_password field)
- string[]
- An optional list of tags, represented as a key, value pair
- write
Password boolean
- disk_
image str - The ID for the disk image to use to build the instance
- firewall_
id str - The ID of the firewall to use, from the current list. If left blank or not sent, the default firewall will be used (open to all)
- hostname str
- A fully qualified domain name that should be set as the instance's hostname
- initial_
user str - The name of the initial user created on the server (optional; this will default to the template's default_username and fallback to civo)
- network_
id str - This must be the ID of the network from the network listing (optional; default network used when not specified)
- notes str
- Add some notes to the instance
- private_
ipv4 str - The private IPv4 address for the instance (optional)
- public_
ip_ strrequired - This should be either 'none' or 'create' (default: 'create')
- region str
- The region for the instance, if not declare we use the region in declared in the provider
- reserved_
ipv4 str - Can be either the UUID, name, or the IP address of the reserved IP
- reverse_
dns str - A fully qualified domain name that should be used as the instance's IP's reverse DNS (optional, uses the hostname if unspecified)
- script str
- The contents of a script that will be uploaded to /usr/local/bin/civo-user-init-script on your instance, read/write/executable only by root and then will be executed at the end of the cloud initialization
- size str
- The name of the size, from the current list, e.g. g3.xsmall
- sshkey_
id str - The ID of an already uploaded SSH public key to use for login to the default user (optional; if one isn't provided a random password will be set and returned in the initial_password field)
- Sequence[str]
- An optional list of tags, represented as a key, value pair
- write_
password bool
- disk
Image String - The ID for the disk image to use to build the instance
- firewall
Id String - The ID of the firewall to use, from the current list. If left blank or not sent, the default firewall will be used (open to all)
- hostname String
- A fully qualified domain name that should be set as the instance's hostname
- initial
User String - The name of the initial user created on the server (optional; this will default to the template's default_username and fallback to civo)
- network
Id String - This must be the ID of the network from the network listing (optional; default network used when not specified)
- notes String
- Add some notes to the instance
- private
Ipv4 String - The private IPv4 address for the instance (optional)
- public
Ip StringRequired - This should be either 'none' or 'create' (default: 'create')
- region String
- The region for the instance, if not declare we use the region in declared in the provider
- reserved
Ipv4 String - Can be either the UUID, name, or the IP address of the reserved IP
- reverse
Dns String - A fully qualified domain name that should be used as the instance's IP's reverse DNS (optional, uses the hostname if unspecified)
- script String
- The contents of a script that will be uploaded to /usr/local/bin/civo-user-init-script on your instance, read/write/executable only by root and then will be executed at the end of the cloud initialization
- size String
- The name of the size, from the current list, e.g. g3.xsmall
- sshkey
Id String - The ID of an already uploaded SSH public key to use for login to the default user (optional; if one isn't provided a random password will be set and returned in the initial_password field)
- List<String>
- An optional list of tags, represented as a key, value pair
- write
Password Boolean
Outputs
All input properties are implicitly available as output properties. Additionally, the Instance resource produces the following output properties:
- Cpu
Cores int - (Number) Instance's CPU cores
- Created
At string - (String) Timestamp when the instance was created
- Disk
Gb int - (Number) Instance's disk (GB)
- Id string
- The provider-assigned unique ID for this managed resource.
- Initial
Password string - (String, Sensitive) Initial password for login
- Private
Ip string - (String) Instance's private IP address
- Public
Ip string - (String) Instance's public IP address
- Ram
Mb int - (Number) Instance's RAM (MB)
- Source
Id string - (String) Instance's source ID
- Source
Type string - (String) Instance's source type
- Status string
- (String) Instance's status
- Cpu
Cores int - (Number) Instance's CPU cores
- Created
At string - (String) Timestamp when the instance was created
- Disk
Gb int - (Number) Instance's disk (GB)
- Id string
- The provider-assigned unique ID for this managed resource.
- Initial
Password string - (String, Sensitive) Initial password for login
- Private
Ip string - (String) Instance's private IP address
- Public
Ip string - (String) Instance's public IP address
- Ram
Mb int - (Number) Instance's RAM (MB)
- Source
Id string - (String) Instance's source ID
- Source
Type string - (String) Instance's source type
- Status string
- (String) Instance's status
- cpu
Cores Integer - (Number) Instance's CPU cores
- created
At String - (String) Timestamp when the instance was created
- disk
Gb Integer - (Number) Instance's disk (GB)
- id String
- The provider-assigned unique ID for this managed resource.
- initial
Password String - (String, Sensitive) Initial password for login
- private
Ip String - (String) Instance's private IP address
- public
Ip String - (String) Instance's public IP address
- ram
Mb Integer - (Number) Instance's RAM (MB)
- source
Id String - (String) Instance's source ID
- source
Type String - (String) Instance's source type
- status String
- (String) Instance's status
- cpu
Cores number - (Number) Instance's CPU cores
- created
At string - (String) Timestamp when the instance was created
- disk
Gb number - (Number) Instance's disk (GB)
- id string
- The provider-assigned unique ID for this managed resource.
- initial
Password string - (String, Sensitive) Initial password for login
- private
Ip string - (String) Instance's private IP address
- public
Ip string - (String) Instance's public IP address
- ram
Mb number - (Number) Instance's RAM (MB)
- source
Id string - (String) Instance's source ID
- source
Type string - (String) Instance's source type
- status string
- (String) Instance's status
- cpu_
cores int - (Number) Instance's CPU cores
- created_
at str - (String) Timestamp when the instance was created
- disk_
gb int - (Number) Instance's disk (GB)
- id str
- The provider-assigned unique ID for this managed resource.
- initial_
password str - (String, Sensitive) Initial password for login
- private_
ip str - (String) Instance's private IP address
- public_
ip str - (String) Instance's public IP address
- ram_
mb int - (Number) Instance's RAM (MB)
- source_
id str - (String) Instance's source ID
- source_
type str - (String) Instance's source type
- status str
- (String) Instance's status
- cpu
Cores Number - (Number) Instance's CPU cores
- created
At String - (String) Timestamp when the instance was created
- disk
Gb Number - (Number) Instance's disk (GB)
- id String
- The provider-assigned unique ID for this managed resource.
- initial
Password String - (String, Sensitive) Initial password for login
- private
Ip String - (String) Instance's private IP address
- public
Ip String - (String) Instance's public IP address
- ram
Mb Number - (Number) Instance's RAM (MB)
- source
Id String - (String) Instance's source ID
- source
Type String - (String) Instance's source type
- status String
- (String) Instance's status
Look up Existing Instance Resource
Get an existing Instance 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?: InstanceState, opts?: CustomResourceOptions): Instance
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
cpu_cores: Optional[int] = None,
created_at: Optional[str] = None,
disk_gb: Optional[int] = None,
disk_image: Optional[str] = None,
firewall_id: Optional[str] = None,
hostname: Optional[str] = None,
initial_password: Optional[str] = None,
initial_user: Optional[str] = None,
network_id: Optional[str] = None,
notes: Optional[str] = None,
private_ip: Optional[str] = None,
private_ipv4: Optional[str] = None,
public_ip: Optional[str] = None,
public_ip_required: Optional[str] = None,
ram_mb: Optional[int] = None,
region: Optional[str] = None,
reserved_ipv4: Optional[str] = None,
reverse_dns: Optional[str] = None,
script: Optional[str] = None,
size: Optional[str] = None,
source_id: Optional[str] = None,
source_type: Optional[str] = None,
sshkey_id: Optional[str] = None,
status: Optional[str] = None,
tags: Optional[Sequence[str]] = None,
write_password: Optional[bool] = None) -> Instance
func GetInstance(ctx *Context, name string, id IDInput, state *InstanceState, opts ...ResourceOption) (*Instance, error)
public static Instance Get(string name, Input<string> id, InstanceState? state, CustomResourceOptions? opts = null)
public static Instance get(String name, Output<String> id, InstanceState 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.
- Cpu
Cores int - (Number) Instance's CPU cores
- Created
At string - (String) Timestamp when the instance was created
- Disk
Gb int - (Number) Instance's disk (GB)
- Disk
Image string - The ID for the disk image to use to build the instance
- Firewall
Id string - The ID of the firewall to use, from the current list. If left blank or not sent, the default firewall will be used (open to all)
- Hostname string
- A fully qualified domain name that should be set as the instance's hostname
- Initial
Password string - (String, Sensitive) Initial password for login
- Initial
User string - The name of the initial user created on the server (optional; this will default to the template's default_username and fallback to civo)
- Network
Id string - This must be the ID of the network from the network listing (optional; default network used when not specified)
- Notes string
- Add some notes to the instance
- Private
Ip string - (String) Instance's private IP address
- Private
Ipv4 string - The private IPv4 address for the instance (optional)
- Public
Ip string - (String) Instance's public IP address
- Public
Ip stringRequired - This should be either 'none' or 'create' (default: 'create')
- Ram
Mb int - (Number) Instance's RAM (MB)
- Region string
- The region for the instance, if not declare we use the region in declared in the provider
- Reserved
Ipv4 string - Can be either the UUID, name, or the IP address of the reserved IP
- Reverse
Dns string - A fully qualified domain name that should be used as the instance's IP's reverse DNS (optional, uses the hostname if unspecified)
- Script string
- The contents of a script that will be uploaded to /usr/local/bin/civo-user-init-script on your instance, read/write/executable only by root and then will be executed at the end of the cloud initialization
- Size string
- The name of the size, from the current list, e.g. g3.xsmall
- Source
Id string - (String) Instance's source ID
- Source
Type string - (String) Instance's source type
- Sshkey
Id string - The ID of an already uploaded SSH public key to use for login to the default user (optional; if one isn't provided a random password will be set and returned in the initial_password field)
- Status string
- (String) Instance's status
- List<string>
- An optional list of tags, represented as a key, value pair
- Write
Password bool
- Cpu
Cores int - (Number) Instance's CPU cores
- Created
At string - (String) Timestamp when the instance was created
- Disk
Gb int - (Number) Instance's disk (GB)
- Disk
Image string - The ID for the disk image to use to build the instance
- Firewall
Id string - The ID of the firewall to use, from the current list. If left blank or not sent, the default firewall will be used (open to all)
- Hostname string
- A fully qualified domain name that should be set as the instance's hostname
- Initial
Password string - (String, Sensitive) Initial password for login
- Initial
User string - The name of the initial user created on the server (optional; this will default to the template's default_username and fallback to civo)
- Network
Id string - This must be the ID of the network from the network listing (optional; default network used when not specified)
- Notes string
- Add some notes to the instance
- Private
Ip string - (String) Instance's private IP address
- Private
Ipv4 string - The private IPv4 address for the instance (optional)
- Public
Ip string - (String) Instance's public IP address
- Public
Ip stringRequired - This should be either 'none' or 'create' (default: 'create')
- Ram
Mb int - (Number) Instance's RAM (MB)
- Region string
- The region for the instance, if not declare we use the region in declared in the provider
- Reserved
Ipv4 string - Can be either the UUID, name, or the IP address of the reserved IP
- Reverse
Dns string - A fully qualified domain name that should be used as the instance's IP's reverse DNS (optional, uses the hostname if unspecified)
- Script string
- The contents of a script that will be uploaded to /usr/local/bin/civo-user-init-script on your instance, read/write/executable only by root and then will be executed at the end of the cloud initialization
- Size string
- The name of the size, from the current list, e.g. g3.xsmall
- Source
Id string - (String) Instance's source ID
- Source
Type string - (String) Instance's source type
- Sshkey
Id string - The ID of an already uploaded SSH public key to use for login to the default user (optional; if one isn't provided a random password will be set and returned in the initial_password field)
- Status string
- (String) Instance's status
- []string
- An optional list of tags, represented as a key, value pair
- Write
Password bool
- cpu
Cores Integer - (Number) Instance's CPU cores
- created
At String - (String) Timestamp when the instance was created
- disk
Gb Integer - (Number) Instance's disk (GB)
- disk
Image String - The ID for the disk image to use to build the instance
- firewall
Id String - The ID of the firewall to use, from the current list. If left blank or not sent, the default firewall will be used (open to all)
- hostname String
- A fully qualified domain name that should be set as the instance's hostname
- initial
Password String - (String, Sensitive) Initial password for login
- initial
User String - The name of the initial user created on the server (optional; this will default to the template's default_username and fallback to civo)
- network
Id String - This must be the ID of the network from the network listing (optional; default network used when not specified)
- notes String
- Add some notes to the instance
- private
Ip String - (String) Instance's private IP address
- private
Ipv4 String - The private IPv4 address for the instance (optional)
- public
Ip String - (String) Instance's public IP address
- public
Ip StringRequired - This should be either 'none' or 'create' (default: 'create')
- ram
Mb Integer - (Number) Instance's RAM (MB)
- region String
- The region for the instance, if not declare we use the region in declared in the provider
- reserved
Ipv4 String - Can be either the UUID, name, or the IP address of the reserved IP
- reverse
Dns String - A fully qualified domain name that should be used as the instance's IP's reverse DNS (optional, uses the hostname if unspecified)
- script String
- The contents of a script that will be uploaded to /usr/local/bin/civo-user-init-script on your instance, read/write/executable only by root and then will be executed at the end of the cloud initialization
- size String
- The name of the size, from the current list, e.g. g3.xsmall
- source
Id String - (String) Instance's source ID
- source
Type String - (String) Instance's source type
- sshkey
Id String - The ID of an already uploaded SSH public key to use for login to the default user (optional; if one isn't provided a random password will be set and returned in the initial_password field)
- status String
- (String) Instance's status
- List<String>
- An optional list of tags, represented as a key, value pair
- write
Password Boolean
- cpu
Cores number - (Number) Instance's CPU cores
- created
At string - (String) Timestamp when the instance was created
- disk
Gb number - (Number) Instance's disk (GB)
- disk
Image string - The ID for the disk image to use to build the instance
- firewall
Id string - The ID of the firewall to use, from the current list. If left blank or not sent, the default firewall will be used (open to all)
- hostname string
- A fully qualified domain name that should be set as the instance's hostname
- initial
Password string - (String, Sensitive) Initial password for login
- initial
User string - The name of the initial user created on the server (optional; this will default to the template's default_username and fallback to civo)
- network
Id string - This must be the ID of the network from the network listing (optional; default network used when not specified)
- notes string
- Add some notes to the instance
- private
Ip string - (String) Instance's private IP address
- private
Ipv4 string - The private IPv4 address for the instance (optional)
- public
Ip string - (String) Instance's public IP address
- public
Ip stringRequired - This should be either 'none' or 'create' (default: 'create')
- ram
Mb number - (Number) Instance's RAM (MB)
- region string
- The region for the instance, if not declare we use the region in declared in the provider
- reserved
Ipv4 string - Can be either the UUID, name, or the IP address of the reserved IP
- reverse
Dns string - A fully qualified domain name that should be used as the instance's IP's reverse DNS (optional, uses the hostname if unspecified)
- script string
- The contents of a script that will be uploaded to /usr/local/bin/civo-user-init-script on your instance, read/write/executable only by root and then will be executed at the end of the cloud initialization
- size string
- The name of the size, from the current list, e.g. g3.xsmall
- source
Id string - (String) Instance's source ID
- source
Type string - (String) Instance's source type
- sshkey
Id string - The ID of an already uploaded SSH public key to use for login to the default user (optional; if one isn't provided a random password will be set and returned in the initial_password field)
- status string
- (String) Instance's status
- string[]
- An optional list of tags, represented as a key, value pair
- write
Password boolean
- cpu_
cores int - (Number) Instance's CPU cores
- created_
at str - (String) Timestamp when the instance was created
- disk_
gb int - (Number) Instance's disk (GB)
- disk_
image str - The ID for the disk image to use to build the instance
- firewall_
id str - The ID of the firewall to use, from the current list. If left blank or not sent, the default firewall will be used (open to all)
- hostname str
- A fully qualified domain name that should be set as the instance's hostname
- initial_
password str - (String, Sensitive) Initial password for login
- initial_
user str - The name of the initial user created on the server (optional; this will default to the template's default_username and fallback to civo)
- network_
id str - This must be the ID of the network from the network listing (optional; default network used when not specified)
- notes str
- Add some notes to the instance
- private_
ip str - (String) Instance's private IP address
- private_
ipv4 str - The private IPv4 address for the instance (optional)
- public_
ip str - (String) Instance's public IP address
- public_
ip_ strrequired - This should be either 'none' or 'create' (default: 'create')
- ram_
mb int - (Number) Instance's RAM (MB)
- region str
- The region for the instance, if not declare we use the region in declared in the provider
- reserved_
ipv4 str - Can be either the UUID, name, or the IP address of the reserved IP
- reverse_
dns str - A fully qualified domain name that should be used as the instance's IP's reverse DNS (optional, uses the hostname if unspecified)
- script str
- The contents of a script that will be uploaded to /usr/local/bin/civo-user-init-script on your instance, read/write/executable only by root and then will be executed at the end of the cloud initialization
- size str
- The name of the size, from the current list, e.g. g3.xsmall
- source_
id str - (String) Instance's source ID
- source_
type str - (String) Instance's source type
- sshkey_
id str - The ID of an already uploaded SSH public key to use for login to the default user (optional; if one isn't provided a random password will be set and returned in the initial_password field)
- status str
- (String) Instance's status
- Sequence[str]
- An optional list of tags, represented as a key, value pair
- write_
password bool
- cpu
Cores Number - (Number) Instance's CPU cores
- created
At String - (String) Timestamp when the instance was created
- disk
Gb Number - (Number) Instance's disk (GB)
- disk
Image String - The ID for the disk image to use to build the instance
- firewall
Id String - The ID of the firewall to use, from the current list. If left blank or not sent, the default firewall will be used (open to all)
- hostname String
- A fully qualified domain name that should be set as the instance's hostname
- initial
Password String - (String, Sensitive) Initial password for login
- initial
User String - The name of the initial user created on the server (optional; this will default to the template's default_username and fallback to civo)
- network
Id String - This must be the ID of the network from the network listing (optional; default network used when not specified)
- notes String
- Add some notes to the instance
- private
Ip String - (String) Instance's private IP address
- private
Ipv4 String - The private IPv4 address for the instance (optional)
- public
Ip String - (String) Instance's public IP address
- public
Ip StringRequired - This should be either 'none' or 'create' (default: 'create')
- ram
Mb Number - (Number) Instance's RAM (MB)
- region String
- The region for the instance, if not declare we use the region in declared in the provider
- reserved
Ipv4 String - Can be either the UUID, name, or the IP address of the reserved IP
- reverse
Dns String - A fully qualified domain name that should be used as the instance's IP's reverse DNS (optional, uses the hostname if unspecified)
- script String
- The contents of a script that will be uploaded to /usr/local/bin/civo-user-init-script on your instance, read/write/executable only by root and then will be executed at the end of the cloud initialization
- size String
- The name of the size, from the current list, e.g. g3.xsmall
- source
Id String - (String) Instance's source ID
- source
Type String - (String) Instance's source type
- sshkey
Id String - The ID of an already uploaded SSH public key to use for login to the default user (optional; if one isn't provided a random password will be set and returned in the initial_password field)
- status String
- (String) Instance's status
- List<String>
- An optional list of tags, represented as a key, value pair
- write
Password Boolean
Import
using ID
$ pulumi import civo:index/instance:Instance example 18bd98ad-1b6e-4f87-b48f-e690b4fd7413
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Civo pulumi/pulumi-civo
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
civo
Terraform Provider.