1. Packages
  2. Civo
  3. API Docs
  4. Instance
Civo v2.4.1 published on Thursday, Aug 22, 2024 by Pulumi

civo.Instance

Explore with Pulumi AI

civo logo
Civo v2.4.1 published on Thursday, Aug 22, 2024 by Pulumi

    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
    
    • View instances after creation on the Dashboard
    • View node sizes on CLI:
    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:

    DiskImage string
    The ID for the disk image to use to build the instance
    FirewallId 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
    InitialUser 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)
    NetworkId 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
    PrivateIpv4 string
    The private IPv4 address for the instance (optional)
    PublicIpRequired string
    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
    ReservedIpv4 string
    Can be either the UUID, name, or the IP address of the reserved IP
    ReverseDns 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
    SshkeyId 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)
    Tags List<string>
    An optional list of tags, represented as a key, value pair
    WritePassword bool
    DiskImage string
    The ID for the disk image to use to build the instance
    FirewallId 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
    InitialUser 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)
    NetworkId 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
    PrivateIpv4 string
    The private IPv4 address for the instance (optional)
    PublicIpRequired string
    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
    ReservedIpv4 string
    Can be either the UUID, name, or the IP address of the reserved IP
    ReverseDns 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
    SshkeyId 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)
    Tags []string
    An optional list of tags, represented as a key, value pair
    WritePassword bool
    diskImage String
    The ID for the disk image to use to build the instance
    firewallId 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
    initialUser 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)
    networkId 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
    privateIpv4 String
    The private IPv4 address for the instance (optional)
    publicIpRequired String
    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
    reservedIpv4 String
    Can be either the UUID, name, or the IP address of the reserved IP
    reverseDns 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
    sshkeyId 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)
    tags List<String>
    An optional list of tags, represented as a key, value pair
    writePassword Boolean
    diskImage string
    The ID for the disk image to use to build the instance
    firewallId 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
    initialUser 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)
    networkId 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
    privateIpv4 string
    The private IPv4 address for the instance (optional)
    publicIpRequired string
    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
    reservedIpv4 string
    Can be either the UUID, name, or the IP address of the reserved IP
    reverseDns 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
    sshkeyId 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)
    tags string[]
    An optional list of tags, represented as a key, value pair
    writePassword 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_required str
    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)
    tags Sequence[str]
    An optional list of tags, represented as a key, value pair
    write_password bool
    diskImage String
    The ID for the disk image to use to build the instance
    firewallId 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
    initialUser 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)
    networkId 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
    privateIpv4 String
    The private IPv4 address for the instance (optional)
    publicIpRequired String
    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
    reservedIpv4 String
    Can be either the UUID, name, or the IP address of the reserved IP
    reverseDns 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
    sshkeyId 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)
    tags List<String>
    An optional list of tags, represented as a key, value pair
    writePassword Boolean

    Outputs

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

    CpuCores int
    (Number) Instance's CPU cores
    CreatedAt string
    (String) Timestamp when the instance was created
    DiskGb int
    (Number) Instance's disk (GB)
    Id string
    The provider-assigned unique ID for this managed resource.
    InitialPassword string
    (String, Sensitive) Initial password for login
    PrivateIp string
    (String) Instance's private IP address
    PublicIp string
    (String) Instance's public IP address
    RamMb int
    (Number) Instance's RAM (MB)
    SourceId string
    (String) Instance's source ID
    SourceType string
    (String) Instance's source type
    Status string
    (String) Instance's status
    CpuCores int
    (Number) Instance's CPU cores
    CreatedAt string
    (String) Timestamp when the instance was created
    DiskGb int
    (Number) Instance's disk (GB)
    Id string
    The provider-assigned unique ID for this managed resource.
    InitialPassword string
    (String, Sensitive) Initial password for login
    PrivateIp string
    (String) Instance's private IP address
    PublicIp string
    (String) Instance's public IP address
    RamMb int
    (Number) Instance's RAM (MB)
    SourceId string
    (String) Instance's source ID
    SourceType string
    (String) Instance's source type
    Status string
    (String) Instance's status
    cpuCores Integer
    (Number) Instance's CPU cores
    createdAt String
    (String) Timestamp when the instance was created
    diskGb Integer
    (Number) Instance's disk (GB)
    id String
    The provider-assigned unique ID for this managed resource.
    initialPassword String
    (String, Sensitive) Initial password for login
    privateIp String
    (String) Instance's private IP address
    publicIp String
    (String) Instance's public IP address
    ramMb Integer
    (Number) Instance's RAM (MB)
    sourceId String
    (String) Instance's source ID
    sourceType String
    (String) Instance's source type
    status String
    (String) Instance's status
    cpuCores number
    (Number) Instance's CPU cores
    createdAt string
    (String) Timestamp when the instance was created
    diskGb number
    (Number) Instance's disk (GB)
    id string
    The provider-assigned unique ID for this managed resource.
    initialPassword string
    (String, Sensitive) Initial password for login
    privateIp string
    (String) Instance's private IP address
    publicIp string
    (String) Instance's public IP address
    ramMb number
    (Number) Instance's RAM (MB)
    sourceId string
    (String) Instance's source ID
    sourceType 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
    cpuCores Number
    (Number) Instance's CPU cores
    createdAt String
    (String) Timestamp when the instance was created
    diskGb Number
    (Number) Instance's disk (GB)
    id String
    The provider-assigned unique ID for this managed resource.
    initialPassword String
    (String, Sensitive) Initial password for login
    privateIp String
    (String) Instance's private IP address
    publicIp String
    (String) Instance's public IP address
    ramMb Number
    (Number) Instance's RAM (MB)
    sourceId String
    (String) Instance's source ID
    sourceType 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.
    The following state arguments are supported:
    CpuCores int
    (Number) Instance's CPU cores
    CreatedAt string
    (String) Timestamp when the instance was created
    DiskGb int
    (Number) Instance's disk (GB)
    DiskImage string
    The ID for the disk image to use to build the instance
    FirewallId 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
    InitialPassword string
    (String, Sensitive) Initial password for login
    InitialUser 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)
    NetworkId 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
    PrivateIp string
    (String) Instance's private IP address
    PrivateIpv4 string
    The private IPv4 address for the instance (optional)
    PublicIp string
    (String) Instance's public IP address
    PublicIpRequired string
    This should be either 'none' or 'create' (default: 'create')
    RamMb 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
    ReservedIpv4 string
    Can be either the UUID, name, or the IP address of the reserved IP
    ReverseDns 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
    SourceId string
    (String) Instance's source ID
    SourceType string
    (String) Instance's source type
    SshkeyId 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
    Tags List<string>
    An optional list of tags, represented as a key, value pair
    WritePassword bool
    CpuCores int
    (Number) Instance's CPU cores
    CreatedAt string
    (String) Timestamp when the instance was created
    DiskGb int
    (Number) Instance's disk (GB)
    DiskImage string
    The ID for the disk image to use to build the instance
    FirewallId 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
    InitialPassword string
    (String, Sensitive) Initial password for login
    InitialUser 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)
    NetworkId 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
    PrivateIp string
    (String) Instance's private IP address
    PrivateIpv4 string
    The private IPv4 address for the instance (optional)
    PublicIp string
    (String) Instance's public IP address
    PublicIpRequired string
    This should be either 'none' or 'create' (default: 'create')
    RamMb 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
    ReservedIpv4 string
    Can be either the UUID, name, or the IP address of the reserved IP
    ReverseDns 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
    SourceId string
    (String) Instance's source ID
    SourceType string
    (String) Instance's source type
    SshkeyId 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
    Tags []string
    An optional list of tags, represented as a key, value pair
    WritePassword bool
    cpuCores Integer
    (Number) Instance's CPU cores
    createdAt String
    (String) Timestamp when the instance was created
    diskGb Integer
    (Number) Instance's disk (GB)
    diskImage String
    The ID for the disk image to use to build the instance
    firewallId 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
    initialPassword String
    (String, Sensitive) Initial password for login
    initialUser 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)
    networkId 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
    privateIp String
    (String) Instance's private IP address
    privateIpv4 String
    The private IPv4 address for the instance (optional)
    publicIp String
    (String) Instance's public IP address
    publicIpRequired String
    This should be either 'none' or 'create' (default: 'create')
    ramMb 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
    reservedIpv4 String
    Can be either the UUID, name, or the IP address of the reserved IP
    reverseDns 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
    sourceId String
    (String) Instance's source ID
    sourceType String
    (String) Instance's source type
    sshkeyId 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
    tags List<String>
    An optional list of tags, represented as a key, value pair
    writePassword Boolean
    cpuCores number
    (Number) Instance's CPU cores
    createdAt string
    (String) Timestamp when the instance was created
    diskGb number
    (Number) Instance's disk (GB)
    diskImage string
    The ID for the disk image to use to build the instance
    firewallId 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
    initialPassword string
    (String, Sensitive) Initial password for login
    initialUser 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)
    networkId 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
    privateIp string
    (String) Instance's private IP address
    privateIpv4 string
    The private IPv4 address for the instance (optional)
    publicIp string
    (String) Instance's public IP address
    publicIpRequired string
    This should be either 'none' or 'create' (default: 'create')
    ramMb 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
    reservedIpv4 string
    Can be either the UUID, name, or the IP address of the reserved IP
    reverseDns 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
    sourceId string
    (String) Instance's source ID
    sourceType string
    (String) Instance's source type
    sshkeyId 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
    tags string[]
    An optional list of tags, represented as a key, value pair
    writePassword 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_required str
    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
    tags Sequence[str]
    An optional list of tags, represented as a key, value pair
    write_password bool
    cpuCores Number
    (Number) Instance's CPU cores
    createdAt String
    (String) Timestamp when the instance was created
    diskGb Number
    (Number) Instance's disk (GB)
    diskImage String
    The ID for the disk image to use to build the instance
    firewallId 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
    initialPassword String
    (String, Sensitive) Initial password for login
    initialUser 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)
    networkId 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
    privateIp String
    (String) Instance's private IP address
    privateIpv4 String
    The private IPv4 address for the instance (optional)
    publicIp String
    (String) Instance's public IP address
    publicIpRequired String
    This should be either 'none' or 'create' (default: 'create')
    ramMb 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
    reservedIpv4 String
    Can be either the UUID, name, or the IP address of the reserved IP
    reverseDns 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
    sourceId String
    (String) Instance's source ID
    sourceType String
    (String) Instance's source type
    sshkeyId 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
    tags List<String>
    An optional list of tags, represented as a key, value pair
    writePassword 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.
    civo logo
    Civo v2.4.1 published on Thursday, Aug 22, 2024 by Pulumi