published on Monday, Jun 29, 2026 by terraform-lxd
published on Monday, Jun 29, 2026 by terraform-lxd
# lxd.InstanceSnapshot
Manages a snapshot of an LXD instance.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as lxd from "@pulumi/lxd";
const instance = new lxd.Instance("instance", {
name: "my-instance",
image: "ubuntu",
ephemeral: false,
});
const snap1 = new lxd.InstanceSnapshot("snap1", {
name: "my-snapshot-1",
instance: instance.name,
});
import pulumi
import pulumi_lxd as lxd
instance = lxd.Instance("instance",
name="my-instance",
image="ubuntu",
ephemeral=False)
snap1 = lxd.InstanceSnapshot("snap1",
name="my-snapshot-1",
instance=instance.name)
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/lxd/v3/lxd"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
instance, err := lxd.NewInstance(ctx, "instance", &lxd.InstanceArgs{
Name: pulumi.String("my-instance"),
Image: pulumi.String("ubuntu"),
Ephemeral: pulumi.Bool(false),
})
if err != nil {
return err
}
_, err = lxd.NewInstanceSnapshot(ctx, "snap1", &lxd.InstanceSnapshotArgs{
Name: pulumi.String("my-snapshot-1"),
Instance: instance.Name,
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Lxd = Pulumi.Lxd;
return await Deployment.RunAsync(() =>
{
var instance = new Lxd.Instance("instance", new()
{
Name = "my-instance",
Image = "ubuntu",
Ephemeral = false,
});
var snap1 = new Lxd.InstanceSnapshot("snap1", new()
{
Name = "my-snapshot-1",
Instance = instance.Name,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.lxd.Instance;
import com.pulumi.lxd.InstanceArgs;
import com.pulumi.lxd.InstanceSnapshot;
import com.pulumi.lxd.InstanceSnapshotArgs;
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 instance = new Instance("instance", InstanceArgs.builder()
.name("my-instance")
.image("ubuntu")
.ephemeral(false)
.build());
var snap1 = new InstanceSnapshot("snap1", InstanceSnapshotArgs.builder()
.name("my-snapshot-1")
.instance(instance.name())
.build());
}
}
resources:
instance:
type: lxd:Instance
properties:
name: my-instance
image: ubuntu
ephemeral: false
snap1:
type: lxd:InstanceSnapshot
properties:
name: my-snapshot-1
instance: ${instance.name}
Example coming soon!
Create InstanceSnapshot Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new InstanceSnapshot(name: string, args: InstanceSnapshotArgs, opts?: CustomResourceOptions);@overload
def InstanceSnapshot(resource_name: str,
args: InstanceSnapshotArgs,
opts: Optional[ResourceOptions] = None)
@overload
def InstanceSnapshot(resource_name: str,
opts: Optional[ResourceOptions] = None,
instance: Optional[str] = None,
name: Optional[str] = None,
project: Optional[str] = None,
remote: Optional[str] = None,
stateful: Optional[bool] = None)func NewInstanceSnapshot(ctx *Context, name string, args InstanceSnapshotArgs, opts ...ResourceOption) (*InstanceSnapshot, error)public InstanceSnapshot(string name, InstanceSnapshotArgs args, CustomResourceOptions? opts = null)
public InstanceSnapshot(String name, InstanceSnapshotArgs args)
public InstanceSnapshot(String name, InstanceSnapshotArgs args, CustomResourceOptions options)
type: lxd:InstanceSnapshot
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "lxd_instancesnapshot" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args InstanceSnapshotArgs
- 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 InstanceSnapshotArgs
- 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 InstanceSnapshotArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args InstanceSnapshotArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args InstanceSnapshotArgs
- 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 instanceSnapshotResource = new Lxd.InstanceSnapshot("instanceSnapshotResource", new()
{
Instance = "string",
Name = "string",
Project = "string",
Remote = "string",
Stateful = false,
});
example, err := lxd.NewInstanceSnapshot(ctx, "instanceSnapshotResource", &lxd.InstanceSnapshotArgs{
Instance: pulumi.String("string"),
Name: pulumi.String("string"),
Project: pulumi.String("string"),
Remote: pulumi.String("string"),
Stateful: pulumi.Bool(false),
})
resource "lxd_instancesnapshot" "instanceSnapshotResource" {
instance = "string"
name = "string"
project = "string"
remote = "string"
stateful = false
}
var instanceSnapshotResource = new InstanceSnapshot("instanceSnapshotResource", InstanceSnapshotArgs.builder()
.instance("string")
.name("string")
.project("string")
.remote("string")
.stateful(false)
.build());
instance_snapshot_resource = lxd.InstanceSnapshot("instanceSnapshotResource",
instance="string",
name="string",
project="string",
remote="string",
stateful=False)
const instanceSnapshotResource = new lxd.InstanceSnapshot("instanceSnapshotResource", {
instance: "string",
name: "string",
project: "string",
remote: "string",
stateful: false,
});
type: lxd:InstanceSnapshot
properties:
instance: string
name: string
project: string
remote: string
stateful: false
InstanceSnapshot 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 InstanceSnapshot resource accepts the following input properties:
- Instance string
- Required - The name of the instance to snapshot.
- Name string
- Required - Name of the snapshot.
- Project string
- Optional - Name of the project where the snapshot will be stored.
- Remote string
- Optional - The remote in which the resource will be created. If not provided, the provider's default remote will be used.
- Stateful bool
- Optional - Set to
trueto create a stateful snapshot,falsefor stateless. Stateful snapshots include runtime state. Defaults tofalse.
- Instance string
- Required - The name of the instance to snapshot.
- Name string
- Required - Name of the snapshot.
- Project string
- Optional - Name of the project where the snapshot will be stored.
- Remote string
- Optional - The remote in which the resource will be created. If not provided, the provider's default remote will be used.
- Stateful bool
- Optional - Set to
trueto create a stateful snapshot,falsefor stateless. Stateful snapshots include runtime state. Defaults tofalse.
- instance string
- Required - The name of the instance to snapshot.
- name string
- Required - Name of the snapshot.
- project string
- Optional - Name of the project where the snapshot will be stored.
- remote string
- Optional - The remote in which the resource will be created. If not provided, the provider's default remote will be used.
- stateful bool
- Optional - Set to
trueto create a stateful snapshot,falsefor stateless. Stateful snapshots include runtime state. Defaults tofalse.
- instance String
- Required - The name of the instance to snapshot.
- name String
- Required - Name of the snapshot.
- project String
- Optional - Name of the project where the snapshot will be stored.
- remote String
- Optional - The remote in which the resource will be created. If not provided, the provider's default remote will be used.
- stateful Boolean
- Optional - Set to
trueto create a stateful snapshot,falsefor stateless. Stateful snapshots include runtime state. Defaults tofalse.
- instance string
- Required - The name of the instance to snapshot.
- name string
- Required - Name of the snapshot.
- project string
- Optional - Name of the project where the snapshot will be stored.
- remote string
- Optional - The remote in which the resource will be created. If not provided, the provider's default remote will be used.
- stateful boolean
- Optional - Set to
trueto create a stateful snapshot,falsefor stateless. Stateful snapshots include runtime state. Defaults tofalse.
- instance str
- Required - The name of the instance to snapshot.
- name str
- Required - Name of the snapshot.
- project str
- Optional - Name of the project where the snapshot will be stored.
- remote str
- Optional - The remote in which the resource will be created. If not provided, the provider's default remote will be used.
- stateful bool
- Optional - Set to
trueto create a stateful snapshot,falsefor stateless. Stateful snapshots include runtime state. Defaults tofalse.
- instance String
- Required - The name of the instance to snapshot.
- name String
- Required - Name of the snapshot.
- project String
- Optional - Name of the project where the snapshot will be stored.
- remote String
- Optional - The remote in which the resource will be created. If not provided, the provider's default remote will be used.
- stateful Boolean
- Optional - Set to
trueto create a stateful snapshot,falsefor stateless. Stateful snapshots include runtime state. Defaults tofalse.
Outputs
All input properties are implicitly available as output properties. Additionally, the InstanceSnapshot resource produces the following output properties:
- created_
at number - The time LXD reported the snapshot was successfully created, in UTC.
- id string
- The provider-assigned unique ID for this managed resource.
- created_
at float - The time LXD reported the snapshot was successfully created, in UTC.
- id str
- The provider-assigned unique ID for this managed resource.
Look up Existing InstanceSnapshot Resource
Get an existing InstanceSnapshot 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?: InstanceSnapshotState, opts?: CustomResourceOptions): InstanceSnapshot@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
created_at: Optional[float] = None,
instance: Optional[str] = None,
name: Optional[str] = None,
project: Optional[str] = None,
remote: Optional[str] = None,
stateful: Optional[bool] = None) -> InstanceSnapshotfunc GetInstanceSnapshot(ctx *Context, name string, id IDInput, state *InstanceSnapshotState, opts ...ResourceOption) (*InstanceSnapshot, error)public static InstanceSnapshot Get(string name, Input<string> id, InstanceSnapshotState? state, CustomResourceOptions? opts = null)public static InstanceSnapshot get(String name, Output<String> id, InstanceSnapshotState state, CustomResourceOptions options)resources: _: type: lxd:InstanceSnapshot get: id: ${id}import {
to = lxd_instancesnapshot.example
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 double - The time LXD reported the snapshot was successfully created, in UTC.
- Instance string
- Required - The name of the instance to snapshot.
- Name string
- Required - Name of the snapshot.
- Project string
- Optional - Name of the project where the snapshot will be stored.
- Remote string
- Optional - The remote in which the resource will be created. If not provided, the provider's default remote will be used.
- Stateful bool
- Optional - Set to
trueto create a stateful snapshot,falsefor stateless. Stateful snapshots include runtime state. Defaults tofalse.
- Created
At float64 - The time LXD reported the snapshot was successfully created, in UTC.
- Instance string
- Required - The name of the instance to snapshot.
- Name string
- Required - Name of the snapshot.
- Project string
- Optional - Name of the project where the snapshot will be stored.
- Remote string
- Optional - The remote in which the resource will be created. If not provided, the provider's default remote will be used.
- Stateful bool
- Optional - Set to
trueto create a stateful snapshot,falsefor stateless. Stateful snapshots include runtime state. Defaults tofalse.
- created_
at number - The time LXD reported the snapshot was successfully created, in UTC.
- instance string
- Required - The name of the instance to snapshot.
- name string
- Required - Name of the snapshot.
- project string
- Optional - Name of the project where the snapshot will be stored.
- remote string
- Optional - The remote in which the resource will be created. If not provided, the provider's default remote will be used.
- stateful bool
- Optional - Set to
trueto create a stateful snapshot,falsefor stateless. Stateful snapshots include runtime state. Defaults tofalse.
- created
At Double - The time LXD reported the snapshot was successfully created, in UTC.
- instance String
- Required - The name of the instance to snapshot.
- name String
- Required - Name of the snapshot.
- project String
- Optional - Name of the project where the snapshot will be stored.
- remote String
- Optional - The remote in which the resource will be created. If not provided, the provider's default remote will be used.
- stateful Boolean
- Optional - Set to
trueto create a stateful snapshot,falsefor stateless. Stateful snapshots include runtime state. Defaults tofalse.
- created
At number - The time LXD reported the snapshot was successfully created, in UTC.
- instance string
- Required - The name of the instance to snapshot.
- name string
- Required - Name of the snapshot.
- project string
- Optional - Name of the project where the snapshot will be stored.
- remote string
- Optional - The remote in which the resource will be created. If not provided, the provider's default remote will be used.
- stateful boolean
- Optional - Set to
trueto create a stateful snapshot,falsefor stateless. Stateful snapshots include runtime state. Defaults tofalse.
- created_
at float - The time LXD reported the snapshot was successfully created, in UTC.
- instance str
- Required - The name of the instance to snapshot.
- name str
- Required - Name of the snapshot.
- project str
- Optional - Name of the project where the snapshot will be stored.
- remote str
- Optional - The remote in which the resource will be created. If not provided, the provider's default remote will be used.
- stateful bool
- Optional - Set to
trueto create a stateful snapshot,falsefor stateless. Stateful snapshots include runtime state. Defaults tofalse.
- created
At Number - The time LXD reported the snapshot was successfully created, in UTC.
- instance String
- Required - The name of the instance to snapshot.
- name String
- Required - Name of the snapshot.
- project String
- Optional - Name of the project where the snapshot will be stored.
- remote String
- Optional - The remote in which the resource will be created. If not provided, the provider's default remote will be used.
- stateful Boolean
- Optional - Set to
trueto create a stateful snapshot,falsefor stateless. Stateful snapshots include runtime state. Defaults tofalse.
Package Details
- Repository
- lxd terraform-lxd/terraform-provider-lxd
- License
- Notes
- This Pulumi package is based on the
lxdTerraform Provider.
published on Monday, Jun 29, 2026 by terraform-lxd