vultr.Snapshot
Explore with Pulumi AI
Provides a Vultr Snapshot resource. This can be used to create, read, modify, and delete Snapshot.
Example Usage
Create a new Snapshot
import * as pulumi from "@pulumi/pulumi";
import * as vultr from "@ediri/vultr";
const myInstance = new vultr.Instance("myInstance", {
label: "my_instance",
osId: 167,
plan: "201",
region: "ewr",
});
const mySnapshot = new vultr.Snapshot("mySnapshot", {
description: "my instances snapshot",
instanceId: myInstance.id,
});
import pulumi
import ediri_vultr as vultr
my_instance = vultr.Instance("myInstance",
label="my_instance",
os_id=167,
plan="201",
region="ewr")
my_snapshot = vultr.Snapshot("mySnapshot",
description="my instances snapshot",
instance_id=my_instance.id)
package main
import (
"github.com/dirien/pulumi-vultr/sdk/v2/go/vultr"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
myInstance, err := vultr.NewInstance(ctx, "myInstance", &vultr.InstanceArgs{
Label: pulumi.String("my_instance"),
OsId: pulumi.Int(167),
Plan: pulumi.String("201"),
Region: pulumi.String("ewr"),
})
if err != nil {
return err
}
_, err = vultr.NewSnapshot(ctx, "mySnapshot", &vultr.SnapshotArgs{
Description: pulumi.String("my instances snapshot"),
InstanceId: myInstance.ID(),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Vultr = ediri.Vultr;
return await Deployment.RunAsync(() =>
{
var myInstance = new Vultr.Instance("myInstance", new()
{
Label = "my_instance",
OsId = 167,
Plan = "201",
Region = "ewr",
});
var mySnapshot = new Vultr.Snapshot("mySnapshot", new()
{
Description = "my instances snapshot",
InstanceId = myInstance.Id,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.vultr.Instance;
import com.pulumi.vultr.InstanceArgs;
import com.pulumi.vultr.Snapshot;
import com.pulumi.vultr.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 myInstance = new Instance("myInstance", InstanceArgs.builder()
.label("my_instance")
.osId(167)
.plan(201)
.region("ewr")
.build());
var mySnapshot = new Snapshot("mySnapshot", SnapshotArgs.builder()
.description("my instances snapshot")
.instanceId(myInstance.id())
.build());
}
}
resources:
myInstance:
type: vultr:Instance
properties:
label: my_instance
osId: 167
plan: 201
region: ewr
mySnapshot:
type: vultr:Snapshot
properties:
description: my instances snapshot
instanceId: ${myInstance.id}
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,
description: Optional[str] = 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: vultr: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 Vultr.Snapshot("snapshotResource", new()
{
InstanceId = "string",
Description = "string",
});
example, err := vultr.NewSnapshot(ctx, "snapshotResource", &vultr.SnapshotArgs{
InstanceId: pulumi.String("string"),
Description: pulumi.String("string"),
})
var snapshotResource = new Snapshot("snapshotResource", SnapshotArgs.builder()
.instanceId("string")
.description("string")
.build());
snapshot_resource = vultr.Snapshot("snapshotResource",
instance_id="string",
description="string")
const snapshotResource = new vultr.Snapshot("snapshotResource", {
instanceId: "string",
description: "string",
});
type: vultr:Snapshot
properties:
description: string
instanceId: 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 - ID of a given instance that you want to create a snapshot from.
- Description string
- The description for the given snapshot.
- Instance
Id string - ID of a given instance that you want to create a snapshot from.
- Description string
- The description for the given snapshot.
- instance
Id String - ID of a given instance that you want to create a snapshot from.
- description String
- The description for the given snapshot.
- instance
Id string - ID of a given instance that you want to create a snapshot from.
- description string
- The description for the given snapshot.
- instance_
id str - ID of a given instance that you want to create a snapshot from.
- description str
- The description for the given snapshot.
- instance
Id String - ID of a given instance that you want to create a snapshot from.
- description String
- The description for the given snapshot.
Outputs
All input properties are implicitly available as output properties. Additionally, the Snapshot resource produces the following output properties:
- App
Id int - The app id which the snapshot is associated with.
- Date
Created string - The date the snapshot was created.
- Id string
- The provider-assigned unique ID for this managed resource.
- Os
Id int - The os id which the snapshot is associated with.
- Size int
- The size of the snapshot in Bytes.
- Status string
- The status for the given snapshot.
- App
Id int - The app id which the snapshot is associated with.
- Date
Created string - The date the snapshot was created.
- Id string
- The provider-assigned unique ID for this managed resource.
- Os
Id int - The os id which the snapshot is associated with.
- Size int
- The size of the snapshot in Bytes.
- Status string
- The status for the given snapshot.
- app
Id Integer - The app id which the snapshot is associated with.
- date
Created String - The date the snapshot was created.
- id String
- The provider-assigned unique ID for this managed resource.
- os
Id Integer - The os id which the snapshot is associated with.
- size Integer
- The size of the snapshot in Bytes.
- status String
- The status for the given snapshot.
- app
Id number - The app id which the snapshot is associated with.
- date
Created string - The date the snapshot was created.
- id string
- The provider-assigned unique ID for this managed resource.
- os
Id number - The os id which the snapshot is associated with.
- size number
- The size of the snapshot in Bytes.
- status string
- The status for the given snapshot.
- app_
id int - The app id which the snapshot is associated with.
- date_
created str - The date the snapshot was created.
- id str
- The provider-assigned unique ID for this managed resource.
- os_
id int - The os id which the snapshot is associated with.
- size int
- The size of the snapshot in Bytes.
- status str
- The status for the given snapshot.
- app
Id Number - The app id which the snapshot is associated with.
- date
Created String - The date the snapshot was created.
- id String
- The provider-assigned unique ID for this managed resource.
- os
Id Number - The os id which the snapshot is associated with.
- size Number
- The size of the snapshot in Bytes.
- status String
- The status for the given snapshot.
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,
app_id: Optional[int] = None,
date_created: Optional[str] = None,
description: Optional[str] = None,
instance_id: Optional[str] = None,
os_id: Optional[int] = None,
size: Optional[int] = None,
status: 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)
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.
- App
Id int - The app id which the snapshot is associated with.
- Date
Created string - The date the snapshot was created.
- Description string
- The description for the given snapshot.
- Instance
Id string - ID of a given instance that you want to create a snapshot from.
- Os
Id int - The os id which the snapshot is associated with.
- Size int
- The size of the snapshot in Bytes.
- Status string
- The status for the given snapshot.
- App
Id int - The app id which the snapshot is associated with.
- Date
Created string - The date the snapshot was created.
- Description string
- The description for the given snapshot.
- Instance
Id string - ID of a given instance that you want to create a snapshot from.
- Os
Id int - The os id which the snapshot is associated with.
- Size int
- The size of the snapshot in Bytes.
- Status string
- The status for the given snapshot.
- app
Id Integer - The app id which the snapshot is associated with.
- date
Created String - The date the snapshot was created.
- description String
- The description for the given snapshot.
- instance
Id String - ID of a given instance that you want to create a snapshot from.
- os
Id Integer - The os id which the snapshot is associated with.
- size Integer
- The size of the snapshot in Bytes.
- status String
- The status for the given snapshot.
- app
Id number - The app id which the snapshot is associated with.
- date
Created string - The date the snapshot was created.
- description string
- The description for the given snapshot.
- instance
Id string - ID of a given instance that you want to create a snapshot from.
- os
Id number - The os id which the snapshot is associated with.
- size number
- The size of the snapshot in Bytes.
- status string
- The status for the given snapshot.
- app_
id int - The app id which the snapshot is associated with.
- date_
created str - The date the snapshot was created.
- description str
- The description for the given snapshot.
- instance_
id str - ID of a given instance that you want to create a snapshot from.
- os_
id int - The os id which the snapshot is associated with.
- size int
- The size of the snapshot in Bytes.
- status str
- The status for the given snapshot.
- app
Id Number - The app id which the snapshot is associated with.
- date
Created String - The date the snapshot was created.
- description String
- The description for the given snapshot.
- instance
Id String - ID of a given instance that you want to create a snapshot from.
- os
Id Number - The os id which the snapshot is associated with.
- size Number
- The size of the snapshot in Bytes.
- status String
- The status for the given snapshot.
Import
Snapshots can be imported using the Snapshot ID
, e.g.
$ pulumi import vultr:index/snapshot:Snapshot my_snapshot 283941e8-0783-410e-9540-71c86b833992
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- vultr dirien/pulumi-vultr
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
vultr
Terraform Provider.