The Automation API is now available. No CLI. No human-in-the-loop. Just your code. Learn More

Snapshot

Provides a resource which can be used to create a snapshot from an existing Civo Instance.

Example Usage

using Pulumi;
using Civo = Pulumi.Civo;

class MyStack : Stack
{
    public MyStack()
    {
        var myinstance_backup = new Civo.Snapshot("myinstance-backup", new Civo.SnapshotArgs
        {
            InstanceId = civo_instance.Myinstance.Id,
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-civo/sdk/go/civo"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        _, err := civo.NewSnapshot(ctx, "myinstance_backup", &civo.SnapshotArgs{
            InstanceId: pulumi.Any(civo_instance.Myinstance.Id),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_civo as civo

myinstance_backup = civo.Snapshot("myinstance-backup", instance_id=civo_instance["myinstance"]["id"])
import * as pulumi from "@pulumi/pulumi";
import * as civo from "@pulumi/civo";

const myinstance_backup = new civo.Snapshot("myinstance-backup", {instanceId: civo_instance.myinstance.id});

Create a Snapshot Resource

def Snapshot(resource_name: str, opts: Optional[ResourceOptions] = None, cron_timing: Optional[str] = None, instance_id: Optional[str] = None, name: Optional[str] = None, safe: Optional[bool] = None)
func NewSnapshot(ctx *Context, name string, args SnapshotArgs, opts ...ResourceOption) (*Snapshot, error)
public Snapshot(string name, SnapshotArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args SnapshotArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args SnapshotArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args SnapshotArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Snapshot Resource Properties

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

Inputs

The Snapshot resource accepts the following input properties:

InstanceId string

The ID of the Instance from which the snapshot will be taken.

CronTiming string

If a valid cron string is passed, the snapshot will be saved as an automated snapshot continuing to automatically update based on the schedule of the cron sequence provided The default is nil meaning the snapshot will be saved as a one-off snapshot.

Name string

A name for the instance snapshot.

Safe bool

If true the instance will be shut down during the snapshot to ensure all files are in a consistent state (e.g. database tables aren’t in the middle of being optimised and hence risking corruption). The default is false so you experience no interruption of service, but a small risk of corruption.

InstanceId string

The ID of the Instance from which the snapshot will be taken.

CronTiming string

If a valid cron string is passed, the snapshot will be saved as an automated snapshot continuing to automatically update based on the schedule of the cron sequence provided The default is nil meaning the snapshot will be saved as a one-off snapshot.

Name string

A name for the instance snapshot.

Safe bool

If true the instance will be shut down during the snapshot to ensure all files are in a consistent state (e.g. database tables aren’t in the middle of being optimised and hence risking corruption). The default is false so you experience no interruption of service, but a small risk of corruption.

instanceId string

The ID of the Instance from which the snapshot will be taken.

cronTiming string

If a valid cron string is passed, the snapshot will be saved as an automated snapshot continuing to automatically update based on the schedule of the cron sequence provided The default is nil meaning the snapshot will be saved as a one-off snapshot.

name string

A name for the instance snapshot.

safe boolean

If true the instance will be shut down during the snapshot to ensure all files are in a consistent state (e.g. database tables aren’t in the middle of being optimised and hence risking corruption). The default is false so you experience no interruption of service, but a small risk of corruption.

instance_id str

The ID of the Instance from which the snapshot will be taken.

cron_timing str

If a valid cron string is passed, the snapshot will be saved as an automated snapshot continuing to automatically update based on the schedule of the cron sequence provided The default is nil meaning the snapshot will be saved as a one-off snapshot.

name str

A name for the instance snapshot.

safe bool

If true the instance will be shut down during the snapshot to ensure all files are in a consistent state (e.g. database tables aren’t in the middle of being optimised and hence risking corruption). The default is false so you experience no interruption of service, but a small risk of corruption.

Outputs

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

CompletedAt string

The date where the snapshot was completed.

Hostname string

The hostname of the instance.

Id string
The provider-assigned unique ID for this managed resource.
NextExecution string

if cron was define this date will be the next execution date.

Region string

The region where the snapshot was take.

RequestedAt string

The date where the snapshot was requested.

SizeGb int

The size of the snapshot in GB.

State string

The status of the snapshot.

TemplateId string

The template id.

CompletedAt string

The date where the snapshot was completed.

Hostname string

The hostname of the instance.

Id string
The provider-assigned unique ID for this managed resource.
NextExecution string

if cron was define this date will be the next execution date.

Region string

The region where the snapshot was take.

RequestedAt string

The date where the snapshot was requested.

SizeGb int

The size of the snapshot in GB.

State string

The status of the snapshot.

TemplateId string

The template id.

completedAt string

The date where the snapshot was completed.

hostname string

The hostname of the instance.

id string
The provider-assigned unique ID for this managed resource.
nextExecution string

if cron was define this date will be the next execution date.

region string

The region where the snapshot was take.

requestedAt string

The date where the snapshot was requested.

sizeGb number

The size of the snapshot in GB.

state string

The status of the snapshot.

templateId string

The template id.

completed_at str

The date where the snapshot was completed.

hostname str

The hostname of the instance.

id str
The provider-assigned unique ID for this managed resource.
next_execution str

if cron was define this date will be the next execution date.

region str

The region where the snapshot was take.

requested_at str

The date where the snapshot was requested.

size_gb int

The size of the snapshot in GB.

state str

The status of the snapshot.

template_id str

The template id.

Look up an Existing Snapshot Resource

Get an existing Snapshot 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?: SnapshotState, opts?: CustomResourceOptions): Snapshot
@staticmethod
def get(resource_name: str, id: str, opts: Optional[ResourceOptions] = None, completed_at: Optional[str] = None, cron_timing: Optional[str] = None, hostname: Optional[str] = None, instance_id: Optional[str] = None, name: Optional[str] = None, next_execution: Optional[str] = None, region: Optional[str] = None, requested_at: Optional[str] = None, safe: Optional[bool] = None, size_gb: Optional[int] = None, state: Optional[str] = None, template_id: Optional[str] = None) -> Snapshot
func GetSnapshot(ctx *Context, name string, id IDInput, state *SnapshotState, opts ...ResourceOption) (*Snapshot, error)
public static Snapshot Get(string name, Input<string> id, SnapshotState? state, CustomResourceOptions? opts = null)
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.

The following state arguments are supported:

CompletedAt string

The date where the snapshot was completed.

CronTiming string

If a valid cron string is passed, the snapshot will be saved as an automated snapshot continuing to automatically update based on the schedule of the cron sequence provided The default is nil meaning the snapshot will be saved as a one-off snapshot.

Hostname string

The hostname of the instance.

InstanceId string

The ID of the Instance from which the snapshot will be taken.

Name string

A name for the instance snapshot.

NextExecution string

if cron was define this date will be the next execution date.

Region string

The region where the snapshot was take.

RequestedAt string

The date where the snapshot was requested.

Safe bool

If true the instance will be shut down during the snapshot to ensure all files are in a consistent state (e.g. database tables aren’t in the middle of being optimised and hence risking corruption). The default is false so you experience no interruption of service, but a small risk of corruption.

SizeGb int

The size of the snapshot in GB.

State string

The status of the snapshot.

TemplateId string

The template id.

CompletedAt string

The date where the snapshot was completed.

CronTiming string

If a valid cron string is passed, the snapshot will be saved as an automated snapshot continuing to automatically update based on the schedule of the cron sequence provided The default is nil meaning the snapshot will be saved as a one-off snapshot.

Hostname string

The hostname of the instance.

InstanceId string

The ID of the Instance from which the snapshot will be taken.

Name string

A name for the instance snapshot.

NextExecution string

if cron was define this date will be the next execution date.

Region string

The region where the snapshot was take.

RequestedAt string

The date where the snapshot was requested.

Safe bool

If true the instance will be shut down during the snapshot to ensure all files are in a consistent state (e.g. database tables aren’t in the middle of being optimised and hence risking corruption). The default is false so you experience no interruption of service, but a small risk of corruption.

SizeGb int

The size of the snapshot in GB.

State string

The status of the snapshot.

TemplateId string

The template id.

completedAt string

The date where the snapshot was completed.

cronTiming string

If a valid cron string is passed, the snapshot will be saved as an automated snapshot continuing to automatically update based on the schedule of the cron sequence provided The default is nil meaning the snapshot will be saved as a one-off snapshot.

hostname string

The hostname of the instance.

instanceId string

The ID of the Instance from which the snapshot will be taken.

name string

A name for the instance snapshot.

nextExecution string

if cron was define this date will be the next execution date.

region string

The region where the snapshot was take.

requestedAt string

The date where the snapshot was requested.

safe boolean

If true the instance will be shut down during the snapshot to ensure all files are in a consistent state (e.g. database tables aren’t in the middle of being optimised and hence risking corruption). The default is false so you experience no interruption of service, but a small risk of corruption.

sizeGb number

The size of the snapshot in GB.

state string

The status of the snapshot.

templateId string

The template id.

completed_at str

The date where the snapshot was completed.

cron_timing str

If a valid cron string is passed, the snapshot will be saved as an automated snapshot continuing to automatically update based on the schedule of the cron sequence provided The default is nil meaning the snapshot will be saved as a one-off snapshot.

hostname str

The hostname of the instance.

instance_id str

The ID of the Instance from which the snapshot will be taken.

name str

A name for the instance snapshot.

next_execution str

if cron was define this date will be the next execution date.

region str

The region where the snapshot was take.

requested_at str

The date where the snapshot was requested.

safe bool

If true the instance will be shut down during the snapshot to ensure all files are in a consistent state (e.g. database tables aren’t in the middle of being optimised and hence risking corruption). The default is false so you experience no interruption of service, but a small risk of corruption.

size_gb int

The size of the snapshot in GB.

state str

The status of the snapshot.

template_id str

The template id.

Package Details

Repository
https://github.com/pulumi/pulumi-civo
License
Apache-2.0
Notes
This Pulumi package is based on the civo Terraform Provider.