# danubedata.VpsSnapshot
Manages a VPS snapshot for backup and recovery.
Example Usage
Basic Snapshot
import * as pulumi from "@pulumi/pulumi";
import * as danubedata from "@danubedata/pulumi";
const server = new danubedata.Vps("server", {
image: "ubuntu-22.04",
datacenter: "fsn1",
authMethod: "ssh_key",
sshKeyId: danubedata_ssh_key.main.id,
});
const backup = new danubedata.VpsSnapshot("backup", {vpsInstanceId: server.id});
import pulumi
import pulumi_danubedata as danubedata
server = danubedata.Vps("server",
image="ubuntu-22.04",
datacenter="fsn1",
auth_method="ssh_key",
ssh_key_id=danubedata_ssh_key["main"]["id"])
backup = danubedata.VpsSnapshot("backup", vps_instance_id=server.id)
package main
import (
"github.com/AdrianSilaghi/pulumi-danubedata/sdk/go/danubedata"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
server, err := danubedata.NewVps(ctx, "server", &danubedata.VpsArgs{
Image: pulumi.String("ubuntu-22.04"),
Datacenter: pulumi.String("fsn1"),
AuthMethod: pulumi.String("ssh_key"),
SshKeyId: pulumi.Any(danubedata_ssh_key.Main.Id),
})
if err != nil {
return err
}
_, err = danubedata.NewVpsSnapshot(ctx, "backup", &danubedata.VpsSnapshotArgs{
VpsInstanceId: server.ID(),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using DanubeData = DanubeData.DanubeData;
return await Deployment.RunAsync(() =>
{
var server = new DanubeData.Vps("server", new()
{
Image = "ubuntu-22.04",
Datacenter = "fsn1",
AuthMethod = "ssh_key",
SshKeyId = danubedata_ssh_key.Main.Id,
});
var backup = new DanubeData.VpsSnapshot("backup", new()
{
VpsInstanceId = server.Id,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.danubedata.Vps;
import com.pulumi.danubedata.VpsArgs;
import com.pulumi.danubedata.VpsSnapshot;
import com.pulumi.danubedata.VpsSnapshotArgs;
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 server = new Vps("server", VpsArgs.builder()
.image("ubuntu-22.04")
.datacenter("fsn1")
.authMethod("ssh_key")
.sshKeyId(danubedata_ssh_key.main().id())
.build());
var backup = new VpsSnapshot("backup", VpsSnapshotArgs.builder()
.vpsInstanceId(server.id())
.build());
}
}
resources:
server:
type: danubedata:Vps
properties:
image: ubuntu-22.04
datacenter: fsn1
authMethod: ssh_key
sshKeyId: ${danubedata_ssh_key.main.id}
backup:
type: danubedata:VpsSnapshot
properties:
vpsInstanceId: ${server.id}
Snapshot with Description
import * as pulumi from "@pulumi/pulumi";
import * as danubedata from "@danubedata/pulumi";
const release = new danubedata.VpsSnapshot("release", {
description: "Snapshot before v1.0 release deployment",
vpsInstanceId: danubedata_vps.server.id,
});
import pulumi
import pulumi_danubedata as danubedata
release = danubedata.VpsSnapshot("release",
description="Snapshot before v1.0 release deployment",
vps_instance_id=danubedata_vps["server"]["id"])
package main
import (
"github.com/AdrianSilaghi/pulumi-danubedata/sdk/go/danubedata"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := danubedata.NewVpsSnapshot(ctx, "release", &danubedata.VpsSnapshotArgs{
Description: pulumi.String("Snapshot before v1.0 release deployment"),
VpsInstanceId: pulumi.Any(danubedata_vps.Server.Id),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using DanubeData = DanubeData.DanubeData;
return await Deployment.RunAsync(() =>
{
var release = new DanubeData.VpsSnapshot("release", new()
{
Description = "Snapshot before v1.0 release deployment",
VpsInstanceId = danubedata_vps.Server.Id,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.danubedata.VpsSnapshot;
import com.pulumi.danubedata.VpsSnapshotArgs;
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 release = new VpsSnapshot("release", VpsSnapshotArgs.builder()
.description("Snapshot before v1.0 release deployment")
.vpsInstanceId(danubedata_vps.server().id())
.build());
}
}
resources:
release:
type: danubedata:VpsSnapshot
properties:
description: Snapshot before v1.0 release deployment
vpsInstanceId: ${danubedata_vps.server.id}
Create VpsSnapshot Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new VpsSnapshot(name: string, args: VpsSnapshotArgs, opts?: CustomResourceOptions);@overload
def VpsSnapshot(resource_name: str,
args: VpsSnapshotArgs,
opts: Optional[ResourceOptions] = None)
@overload
def VpsSnapshot(resource_name: str,
opts: Optional[ResourceOptions] = None,
vps_instance_id: Optional[str] = None,
description: Optional[str] = None,
name: Optional[str] = None,
timeouts: Optional[VpsSnapshotTimeoutsArgs] = None)func NewVpsSnapshot(ctx *Context, name string, args VpsSnapshotArgs, opts ...ResourceOption) (*VpsSnapshot, error)public VpsSnapshot(string name, VpsSnapshotArgs args, CustomResourceOptions? opts = null)
public VpsSnapshot(String name, VpsSnapshotArgs args)
public VpsSnapshot(String name, VpsSnapshotArgs args, CustomResourceOptions options)
type: danubedata:VpsSnapshot
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 VpsSnapshotArgs
- 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 VpsSnapshotArgs
- 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 VpsSnapshotArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args VpsSnapshotArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args VpsSnapshotArgs
- 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 vpsSnapshotResource = new DanubeData.VpsSnapshot("vpsSnapshotResource", new()
{
VpsInstanceId = "string",
Description = "string",
Name = "string",
Timeouts = new DanubeData.Inputs.VpsSnapshotTimeoutsArgs
{
Create = "string",
Delete = "string",
},
});
example, err := danubedata.NewVpsSnapshot(ctx, "vpsSnapshotResource", &danubedata.VpsSnapshotArgs{
VpsInstanceId: pulumi.String("string"),
Description: pulumi.String("string"),
Name: pulumi.String("string"),
Timeouts: &danubedata.VpsSnapshotTimeoutsArgs{
Create: pulumi.String("string"),
Delete: pulumi.String("string"),
},
})
var vpsSnapshotResource = new VpsSnapshot("vpsSnapshotResource", VpsSnapshotArgs.builder()
.vpsInstanceId("string")
.description("string")
.name("string")
.timeouts(VpsSnapshotTimeoutsArgs.builder()
.create("string")
.delete("string")
.build())
.build());
vps_snapshot_resource = danubedata.VpsSnapshot("vpsSnapshotResource",
vps_instance_id="string",
description="string",
name="string",
timeouts={
"create": "string",
"delete": "string",
})
const vpsSnapshotResource = new danubedata.VpsSnapshot("vpsSnapshotResource", {
vpsInstanceId: "string",
description: "string",
name: "string",
timeouts: {
create: "string",
"delete": "string",
},
});
type: danubedata:VpsSnapshot
properties:
description: string
name: string
timeouts:
create: string
delete: string
vpsInstanceId: string
VpsSnapshot Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The VpsSnapshot resource accepts the following input properties:
- Vps
Instance stringId - ID of the VPS instance to snapshot.
- Description string
- Description of the snapshot.
- Name string
- Name of the snapshot.
- Timeouts
Danube
Data. Danube Data. Inputs. Vps Snapshot Timeouts
- Vps
Instance stringId - ID of the VPS instance to snapshot.
- Description string
- Description of the snapshot.
- Name string
- Name of the snapshot.
- Timeouts
Vps
Snapshot Timeouts Args
- vps
Instance StringId - ID of the VPS instance to snapshot.
- description String
- Description of the snapshot.
- name String
- Name of the snapshot.
- timeouts
Vps
Snapshot Timeouts
- vps
Instance stringId - ID of the VPS instance to snapshot.
- description string
- Description of the snapshot.
- name string
- Name of the snapshot.
- timeouts
Vps
Snapshot Timeouts
- vps_
instance_ strid - ID of the VPS instance to snapshot.
- description str
- Description of the snapshot.
- name str
- Name of the snapshot.
- timeouts
Vps
Snapshot Timeouts Args
- vps
Instance StringId - ID of the VPS instance to snapshot.
- description String
- Description of the snapshot.
- name String
- Name of the snapshot.
- timeouts Property Map
Outputs
All input properties are implicitly available as output properties. Additionally, the VpsSnapshot resource produces the following output properties:
- created_
at str - Creation timestamp.
- id str
- The provider-assigned unique ID for this managed resource.
- size_
gb float - Size of the snapshot in GB.
- status str
- Current status (
creating,ready,error). - updated_
at str - Timestamp when the snapshot was last updated.
Look up Existing VpsSnapshot Resource
Get an existing VpsSnapshot 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?: VpsSnapshotState, opts?: CustomResourceOptions): VpsSnapshot@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
created_at: Optional[str] = None,
description: Optional[str] = None,
name: Optional[str] = None,
size_gb: Optional[float] = None,
status: Optional[str] = None,
timeouts: Optional[VpsSnapshotTimeoutsArgs] = None,
updated_at: Optional[str] = None,
vps_instance_id: Optional[str] = None) -> VpsSnapshotfunc GetVpsSnapshot(ctx *Context, name string, id IDInput, state *VpsSnapshotState, opts ...ResourceOption) (*VpsSnapshot, error)public static VpsSnapshot Get(string name, Input<string> id, VpsSnapshotState? state, CustomResourceOptions? opts = null)public static VpsSnapshot get(String name, Output<String> id, VpsSnapshotState state, CustomResourceOptions options)resources: _: type: danubedata:VpsSnapshot get: id: ${id}- 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 - Creation timestamp.
- Description string
- Description of the snapshot.
- Name string
- Name of the snapshot.
- Size
Gb double - Size of the snapshot in GB.
- Status string
- Current status (
creating,ready,error). - Timeouts
Danube
Data. Danube Data. Inputs. Vps Snapshot Timeouts - Updated
At string - Timestamp when the snapshot was last updated.
- Vps
Instance stringId - ID of the VPS instance to snapshot.
- Created
At string - Creation timestamp.
- Description string
- Description of the snapshot.
- Name string
- Name of the snapshot.
- Size
Gb float64 - Size of the snapshot in GB.
- Status string
- Current status (
creating,ready,error). - Timeouts
Vps
Snapshot Timeouts Args - Updated
At string - Timestamp when the snapshot was last updated.
- Vps
Instance stringId - ID of the VPS instance to snapshot.
- created
At String - Creation timestamp.
- description String
- Description of the snapshot.
- name String
- Name of the snapshot.
- size
Gb Double - Size of the snapshot in GB.
- status String
- Current status (
creating,ready,error). - timeouts
Vps
Snapshot Timeouts - updated
At String - Timestamp when the snapshot was last updated.
- vps
Instance StringId - ID of the VPS instance to snapshot.
- created
At string - Creation timestamp.
- description string
- Description of the snapshot.
- name string
- Name of the snapshot.
- size
Gb number - Size of the snapshot in GB.
- status string
- Current status (
creating,ready,error). - timeouts
Vps
Snapshot Timeouts - updated
At string - Timestamp when the snapshot was last updated.
- vps
Instance stringId - ID of the VPS instance to snapshot.
- created_
at str - Creation timestamp.
- description str
- Description of the snapshot.
- name str
- Name of the snapshot.
- size_
gb float - Size of the snapshot in GB.
- status str
- Current status (
creating,ready,error). - timeouts
Vps
Snapshot Timeouts Args - updated_
at str - Timestamp when the snapshot was last updated.
- vps_
instance_ strid - ID of the VPS instance to snapshot.
- created
At String - Creation timestamp.
- description String
- Description of the snapshot.
- name String
- Name of the snapshot.
- size
Gb Number - Size of the snapshot in GB.
- status String
- Current status (
creating,ready,error). - timeouts Property Map
- updated
At String - Timestamp when the snapshot was last updated.
- vps
Instance StringId - ID of the VPS instance to snapshot.
Supporting Types
VpsSnapshotTimeouts, VpsSnapshotTimeoutsArgs
Import
VPS snapshots can be imported using their ID:
bash
$ pulumi import danubedata:index/vpsSnapshot:VpsSnapshot example snap-abc123
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- danubedata AdrianSilaghi/pulumi-danubedata
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
danubedataTerraform Provider.
