genesiscloud.Snapshot
Explore with Pulumi AI
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:
- Instance
Id 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.
- Retain
On boolDelete - Flag to retain the snapshot when the resource is deleted. - Sets the default value "false" if the attribute is not set.
- Timeouts
Genesis
Cloud. Pulumi Package. Genesiscloud. Inputs. Snapshot Timeouts
- Instance
Id 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.
- Retain
On boolDelete - Flag to retain the snapshot when the resource is deleted. - Sets the default value "false" if the attribute is not set.
- Timeouts
Snapshot
Timeouts Args
- instance
Id 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.
- retain
On BooleanDelete - Flag to retain the snapshot when the resource is deleted. - Sets the default value "false" if the attribute is not set.
- timeouts
Snapshot
Timeouts
- instance
Id 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.
- retain
On booleanDelete - Flag to retain the snapshot when the resource is deleted. - Sets the default value "false" if the attribute is not set.
- timeouts
Snapshot
Timeouts
- 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_ booldelete - Flag to retain the snapshot when the resource is deleted. - Sets the default value "false" if the attribute is not set.
- timeouts
Snapshot
Timeouts Args
- instance
Id 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.
- retain
On BooleanDelete - 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:
- 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.
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.
- Created
At string - The timestamp when this snapshot was created in RFC 3339.
- Instance
Id 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.
- Retain
On boolDelete - 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
Genesis
Cloud. Pulumi Package. Genesiscloud. Inputs. Snapshot Timeouts
- Created
At string - The timestamp when this snapshot was created in RFC 3339.
- Instance
Id 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.
- Retain
On boolDelete - 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
Snapshot
Timeouts Args
- created
At String - The timestamp when this snapshot was created in RFC 3339.
- instance
Id 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.
- retain
On BooleanDelete - 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
Snapshot
Timeouts
- created
At string - The timestamp when this snapshot was created in RFC 3339.
- instance
Id 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.
- retain
On booleanDelete - 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
Snapshot
Timeouts
- 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_ booldelete - 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
Snapshot
Timeouts Args
- created
At String - The timestamp when this snapshot was created in RFC 3339.
- instance
Id 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.
- retain
On BooleanDelete - 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.