1. Packages
  2. Genesis Cloud
  3. API Docs
  4. Snapshot
Genesis Cloud v0.0.26 published on Thursday, May 23, 2024 by Genesiscloud

genesiscloud.Snapshot

Explore with Pulumi AI

genesiscloud logo
Genesis Cloud v0.0.26 published on Thursday, May 23, 2024 by Genesiscloud

    Snapshot resource

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Genesiscloud = GenesisCloud.PulumiPackage.Genesiscloud;
    
    return await Deployment.RunAsync(() => 
    {
        var target = new Genesiscloud.Instance("target");
    
        // ...
        var example = new Genesiscloud.Snapshot("example", new()
        {
            InstanceId = target.Id,
            RetainOnDelete = true,
        });
    
        // optional
    });
    
    package main
    
    import (
    	"github.com/genesiscloud/pulumi-genesiscloud/sdk/go/genesiscloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		target, err := genesiscloud.NewInstance(ctx, "target", nil)
    		if err != nil {
    			return err
    		}
    		_, err = genesiscloud.NewSnapshot(ctx, "example", &genesiscloud.SnapshotArgs{
    			InstanceId:     target.ID(),
    			RetainOnDelete: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.genesiscloud.Instance;
    import com.pulumi.genesiscloud.Snapshot;
    import com.pulumi.genesiscloud.SnapshotArgs;
    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 target = new Instance("target");
    
            var example = new Snapshot("example", SnapshotArgs.builder()        
                .instanceId(target.id())
                .retainOnDelete(true)
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_genesiscloud as genesiscloud
    
    target = genesiscloud.Instance("target")
    # ...
    example = genesiscloud.Snapshot("example",
        instance_id=target.id,
        retain_on_delete=True)
    # optional
    
    import * as pulumi from "@pulumi/pulumi";
    import * as genesiscloud from "@genesiscloud/pulumi-genesiscloud";
    
    const target = new genesiscloud.Instance("target", {});
    // ...
    const example = new genesiscloud.Snapshot("example", {
        instanceId: target.id,
        retainOnDelete: true,
    });
    // optional
    
    resources:
      target:
        type: genesiscloud:Instance
      example:
        type: genesiscloud:Snapshot
        properties:
          instanceId: ${target.id}
          retainOnDelete: true
    

    Create Snapshot Resource

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

    Constructor syntax

    new Snapshot(name: string, args: SnapshotArgs, opts?: CustomResourceOptions);
    @overload
    def Snapshot(resource_name: str,
                 args: SnapshotArgs,
                 opts: Optional[ResourceOptions] = None)
    
    @overload
    def Snapshot(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 instance_id: Optional[str] = None,
                 name: Optional[str] = None,
                 retain_on_delete: Optional[bool] = None,
                 timeouts: Optional[SnapshotTimeoutsArgs] = None)
    func NewSnapshot(ctx *Context, name string, args SnapshotArgs, opts ...ResourceOption) (*Snapshot, error)
    public Snapshot(string name, SnapshotArgs args, CustomResourceOptions? opts = null)
    public Snapshot(String name, SnapshotArgs args)
    public Snapshot(String name, SnapshotArgs args, CustomResourceOptions options)
    
    type: genesiscloud:Snapshot
    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 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.
    args SnapshotArgs
    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 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.
    name String
    The unique name of the resource.
    args SnapshotArgs
    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 snapshotResource = new Genesiscloud.Snapshot("snapshotResource", new()
    {
        InstanceId = "string",
        Name = "string",
        RetainOnDelete = false,
        Timeouts = new Genesiscloud.Inputs.SnapshotTimeoutsArgs
        {
            Create = "string",
            Delete = "string",
            Read = "string",
            Update = "string",
        },
    });
    
    example, err := genesiscloud.NewSnapshot(ctx, "snapshotResource", &genesiscloud.SnapshotArgs{
    	InstanceId:     pulumi.String("string"),
    	Name:           pulumi.String("string"),
    	RetainOnDelete: pulumi.Bool(false),
    	Timeouts: &genesiscloud.SnapshotTimeoutsArgs{
    		Create: pulumi.String("string"),
    		Delete: pulumi.String("string"),
    		Read:   pulumi.String("string"),
    		Update: pulumi.String("string"),
    	},
    })
    
    var snapshotResource = new Snapshot("snapshotResource", SnapshotArgs.builder()
        .instanceId("string")
        .name("string")
        .retainOnDelete(false)
        .timeouts(SnapshotTimeoutsArgs.builder()
            .create("string")
            .delete("string")
            .read("string")
            .update("string")
            .build())
        .build());
    
    snapshot_resource = genesiscloud.Snapshot("snapshotResource",
        instance_id="string",
        name="string",
        retain_on_delete=False,
        timeouts=genesiscloud.SnapshotTimeoutsArgs(
            create="string",
            delete="string",
            read="string",
            update="string",
        ))
    
    const snapshotResource = new genesiscloud.Snapshot("snapshotResource", {
        instanceId: "string",
        name: "string",
        retainOnDelete: false,
        timeouts: {
            create: "string",
            "delete": "string",
            read: "string",
            update: "string",
        },
    });
    
    type: genesiscloud:Snapshot
    properties:
        instanceId: string
        name: string
        retainOnDelete: false
        timeouts:
            create: string
            delete: string
            read: string
            update: string
    

    Snapshot 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 Snapshot resource accepts the following input properties:

    InstanceId string
    The id of the instance to snapshot. - If the value of this attribute changes, Terraform will destroy and recreate the resource.
    Name string
    The human-readable name for the snapshot.
    RetainOnDelete bool
    Flag to retain the snapshot when the resource is deleted. - Sets the default value "false" if the attribute is not set.
    Timeouts GenesisCloud.PulumiPackage.Genesiscloud.Inputs.SnapshotTimeouts
    InstanceId string
    The id of the instance to snapshot. - If the value of this attribute changes, Terraform will destroy and recreate the resource.
    Name string
    The human-readable name for the snapshot.
    RetainOnDelete bool
    Flag to retain the snapshot when the resource is deleted. - Sets the default value "false" if the attribute is not set.
    Timeouts SnapshotTimeoutsArgs
    instanceId String
    The id of the instance to snapshot. - If the value of this attribute changes, Terraform will destroy and recreate the resource.
    name String
    The human-readable name for the snapshot.
    retainOnDelete Boolean
    Flag to retain the snapshot when the resource is deleted. - Sets the default value "false" if the attribute is not set.
    timeouts SnapshotTimeouts
    instanceId string
    The id of the instance to snapshot. - If the value of this attribute changes, Terraform will destroy and recreate the resource.
    name string
    The human-readable name for the snapshot.
    retainOnDelete boolean
    Flag to retain the snapshot when the resource is deleted. - Sets the default value "false" if the attribute is not set.
    timeouts SnapshotTimeouts
    instance_id str
    The id of the instance to snapshot. - If the value of this attribute changes, Terraform will destroy and recreate the resource.
    name str
    The human-readable name for the snapshot.
    retain_on_delete bool
    Flag to retain the snapshot when the resource is deleted. - Sets the default value "false" if the attribute is not set.
    timeouts SnapshotTimeoutsArgs
    instanceId String
    The id of the instance to snapshot. - If the value of this attribute changes, Terraform will destroy and recreate the resource.
    name String
    The human-readable name for the snapshot.
    retainOnDelete Boolean
    Flag to retain the snapshot when the resource is deleted. - Sets the default value "false" if the attribute is not set.
    timeouts Property Map

    Outputs

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

    CreatedAt string
    The timestamp when this snapshot was created in RFC 3339.
    Id string
    The provider-assigned unique ID for this managed resource.
    Region string
    The region identifier.
    Size int
    The storage size of this snapshot given in bytes.
    Status string
    The snapshot status.
    CreatedAt string
    The timestamp when this snapshot was created in RFC 3339.
    Id string
    The provider-assigned unique ID for this managed resource.
    Region string
    The region identifier.
    Size int
    The storage size of this snapshot given in bytes.
    Status string
    The snapshot status.
    createdAt String
    The timestamp when this snapshot was created in RFC 3339.
    id String
    The provider-assigned unique ID for this managed resource.
    region String
    The region identifier.
    size Integer
    The storage size of this snapshot given in bytes.
    status String
    The snapshot status.
    createdAt string
    The timestamp when this snapshot was created in RFC 3339.
    id string
    The provider-assigned unique ID for this managed resource.
    region string
    The region identifier.
    size number
    The storage size of this snapshot given in bytes.
    status string
    The snapshot status.
    created_at str
    The timestamp when this snapshot was created in RFC 3339.
    id str
    The provider-assigned unique ID for this managed resource.
    region str
    The region identifier.
    size int
    The storage size of this snapshot given in bytes.
    status str
    The snapshot status.
    createdAt String
    The timestamp when this snapshot was created in RFC 3339.
    id String
    The provider-assigned unique ID for this managed resource.
    region String
    The region identifier.
    size Number
    The storage size of this snapshot given in bytes.
    status String
    The snapshot status.

    Look up 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,
            created_at: Optional[str] = None,
            instance_id: Optional[str] = None,
            name: Optional[str] = None,
            region: Optional[str] = None,
            retain_on_delete: Optional[bool] = None,
            size: Optional[int] = None,
            status: Optional[str] = None,
            timeouts: Optional[SnapshotTimeoutsArgs] = 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)
    public static Snapshot get(String name, Output<String> id, SnapshotState 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:
    CreatedAt string
    The timestamp when this snapshot was created in RFC 3339.
    InstanceId string
    The id of the instance to snapshot. - If the value of this attribute changes, Terraform will destroy and recreate the resource.
    Name string
    The human-readable name for the snapshot.
    Region string
    The region identifier.
    RetainOnDelete bool
    Flag to retain the snapshot when the resource is deleted. - Sets the default value "false" if the attribute is not set.
    Size int
    The storage size of this snapshot given in bytes.
    Status string
    The snapshot status.
    Timeouts GenesisCloud.PulumiPackage.Genesiscloud.Inputs.SnapshotTimeouts
    CreatedAt string
    The timestamp when this snapshot was created in RFC 3339.
    InstanceId string
    The id of the instance to snapshot. - If the value of this attribute changes, Terraform will destroy and recreate the resource.
    Name string
    The human-readable name for the snapshot.
    Region string
    The region identifier.
    RetainOnDelete bool
    Flag to retain the snapshot when the resource is deleted. - Sets the default value "false" if the attribute is not set.
    Size int
    The storage size of this snapshot given in bytes.
    Status string
    The snapshot status.
    Timeouts SnapshotTimeoutsArgs
    createdAt String
    The timestamp when this snapshot was created in RFC 3339.
    instanceId String
    The id of the instance to snapshot. - If the value of this attribute changes, Terraform will destroy and recreate the resource.
    name String
    The human-readable name for the snapshot.
    region String
    The region identifier.
    retainOnDelete Boolean
    Flag to retain the snapshot when the resource is deleted. - Sets the default value "false" if the attribute is not set.
    size Integer
    The storage size of this snapshot given in bytes.
    status String
    The snapshot status.
    timeouts SnapshotTimeouts
    createdAt string
    The timestamp when this snapshot was created in RFC 3339.
    instanceId string
    The id of the instance to snapshot. - If the value of this attribute changes, Terraform will destroy and recreate the resource.
    name string
    The human-readable name for the snapshot.
    region string
    The region identifier.
    retainOnDelete boolean
    Flag to retain the snapshot when the resource is deleted. - Sets the default value "false" if the attribute is not set.
    size number
    The storage size of this snapshot given in bytes.
    status string
    The snapshot status.
    timeouts SnapshotTimeouts
    created_at str
    The timestamp when this snapshot was created in RFC 3339.
    instance_id str
    The id of the instance to snapshot. - If the value of this attribute changes, Terraform will destroy and recreate the resource.
    name str
    The human-readable name for the snapshot.
    region str
    The region identifier.
    retain_on_delete bool
    Flag to retain the snapshot when the resource is deleted. - Sets the default value "false" if the attribute is not set.
    size int
    The storage size of this snapshot given in bytes.
    status str
    The snapshot status.
    timeouts SnapshotTimeoutsArgs
    createdAt String
    The timestamp when this snapshot was created in RFC 3339.
    instanceId String
    The id of the instance to snapshot. - If the value of this attribute changes, Terraform will destroy and recreate the resource.
    name String
    The human-readable name for the snapshot.
    region String
    The region identifier.
    retainOnDelete Boolean
    Flag to retain the snapshot when the resource is deleted. - Sets the default value "false" if the attribute is not set.
    size Number
    The storage size of this snapshot given in bytes.
    status String
    The snapshot status.
    timeouts Property Map

    Supporting Types

    SnapshotTimeouts, SnapshotTimeoutsArgs

    Create string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    Delete string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
    Read string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
    Update string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    Create string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    Delete string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
    Read string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
    Update string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    create String
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    delete String
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
    read String
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
    update String
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    create string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    delete string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
    read string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
    update string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    create str
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    delete str
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
    read str
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
    update str
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    create String
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    delete String
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
    read String
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
    update String
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).

    Import

     $ pulumi import genesiscloud:index/snapshot:Snapshot example 18efeec8-94f0-4776-8ff2-5e9b49c74608
    

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

    Package Details

    Repository
    genesiscloud genesiscloud/pulumi-genesiscloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the genesiscloud Terraform Provider.
    genesiscloud logo
    Genesis Cloud v0.0.26 published on Thursday, May 23, 2024 by Genesiscloud