1. Packages
  2. DigitalOcean Provider
  3. API Docs
  4. NfsSnapshot
DigitalOcean v4.56.0 published on Monday, Dec 22, 2025 by Pulumi
digitalocean logo
DigitalOcean v4.56.0 published on Monday, Dec 22, 2025 by Pulumi

    Provides a DigitalOcean NFS snapshot which can be used to create new NFS shares.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as digitalocean from "@pulumi/digitalocean";
    
    const foobar = new digitalocean.Vpc("foobar", {
        name: "example-vpc",
        region: "nyc1",
    });
    const foobarNfs = new digitalocean.Nfs("foobar", {
        region: "nyc1",
        name: "example-nfs",
        size: 50,
        vpcId: foobar.id,
    });
    const foobarNfsSnapshot = new digitalocean.NfsSnapshot("foobar", {
        name: "example-snapshot",
        shareId: foobarNfs.id,
        region: "nyc1",
    });
    
    import pulumi
    import pulumi_digitalocean as digitalocean
    
    foobar = digitalocean.Vpc("foobar",
        name="example-vpc",
        region="nyc1")
    foobar_nfs = digitalocean.Nfs("foobar",
        region="nyc1",
        name="example-nfs",
        size=50,
        vpc_id=foobar.id)
    foobar_nfs_snapshot = digitalocean.NfsSnapshot("foobar",
        name="example-snapshot",
        share_id=foobar_nfs.id,
        region="nyc1")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-digitalocean/sdk/v4/go/digitalocean"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		foobar, err := digitalocean.NewVpc(ctx, "foobar", &digitalocean.VpcArgs{
    			Name:   pulumi.String("example-vpc"),
    			Region: pulumi.String("nyc1"),
    		})
    		if err != nil {
    			return err
    		}
    		foobarNfs, err := digitalocean.NewNfs(ctx, "foobar", &digitalocean.NfsArgs{
    			Region: pulumi.String("nyc1"),
    			Name:   pulumi.String("example-nfs"),
    			Size:   pulumi.Int(50),
    			VpcId:  foobar.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = digitalocean.NewNfsSnapshot(ctx, "foobar", &digitalocean.NfsSnapshotArgs{
    			Name:    pulumi.String("example-snapshot"),
    			ShareId: foobarNfs.ID(),
    			Region:  pulumi.String("nyc1"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using DigitalOcean = Pulumi.DigitalOcean;
    
    return await Deployment.RunAsync(() => 
    {
        var foobar = new DigitalOcean.Vpc("foobar", new()
        {
            Name = "example-vpc",
            Region = "nyc1",
        });
    
        var foobarNfs = new DigitalOcean.Nfs("foobar", new()
        {
            Region = "nyc1",
            Name = "example-nfs",
            Size = 50,
            VpcId = foobar.Id,
        });
    
        var foobarNfsSnapshot = new DigitalOcean.NfsSnapshot("foobar", new()
        {
            Name = "example-snapshot",
            ShareId = foobarNfs.Id,
            Region = "nyc1",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.digitalocean.Vpc;
    import com.pulumi.digitalocean.VpcArgs;
    import com.pulumi.digitalocean.Nfs;
    import com.pulumi.digitalocean.NfsArgs;
    import com.pulumi.digitalocean.NfsSnapshot;
    import com.pulumi.digitalocean.NfsSnapshotArgs;
    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 foobar = new Vpc("foobar", VpcArgs.builder()
                .name("example-vpc")
                .region("nyc1")
                .build());
    
            var foobarNfs = new Nfs("foobarNfs", NfsArgs.builder()
                .region("nyc1")
                .name("example-nfs")
                .size(50)
                .vpcId(foobar.id())
                .build());
    
            var foobarNfsSnapshot = new NfsSnapshot("foobarNfsSnapshot", NfsSnapshotArgs.builder()
                .name("example-snapshot")
                .shareId(foobarNfs.id())
                .region("nyc1")
                .build());
    
        }
    }
    
    resources:
      foobar:
        type: digitalocean:Vpc
        properties:
          name: example-vpc
          region: nyc1
      foobarNfs:
        type: digitalocean:Nfs
        name: foobar
        properties:
          region: nyc1
          name: example-nfs
          size: 50
          vpcId: ${foobar.id}
      foobarNfsSnapshot:
        type: digitalocean:NfsSnapshot
        name: foobar
        properties:
          name: example-snapshot
          shareId: ${foobarNfs.id}
          region: nyc1
    

    Create NfsSnapshot Resource

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

    Constructor syntax

    new NfsSnapshot(name: string, args: NfsSnapshotArgs, opts?: CustomResourceOptions);
    @overload
    def NfsSnapshot(resource_name: str,
                    args: NfsSnapshotArgs,
                    opts: Optional[ResourceOptions] = None)
    
    @overload
    def NfsSnapshot(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    region: Optional[str] = None,
                    share_id: Optional[str] = None,
                    name: Optional[str] = None)
    func NewNfsSnapshot(ctx *Context, name string, args NfsSnapshotArgs, opts ...ResourceOption) (*NfsSnapshot, error)
    public NfsSnapshot(string name, NfsSnapshotArgs args, CustomResourceOptions? opts = null)
    public NfsSnapshot(String name, NfsSnapshotArgs args)
    public NfsSnapshot(String name, NfsSnapshotArgs args, CustomResourceOptions options)
    
    type: digitalocean:NfsSnapshot
    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 NfsSnapshotArgs
    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 NfsSnapshotArgs
    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 NfsSnapshotArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args NfsSnapshotArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args NfsSnapshotArgs
    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 nfsSnapshotResource = new DigitalOcean.NfsSnapshot("nfsSnapshotResource", new()
    {
        Region = "string",
        ShareId = "string",
        Name = "string",
    });
    
    example, err := digitalocean.NewNfsSnapshot(ctx, "nfsSnapshotResource", &digitalocean.NfsSnapshotArgs{
    	Region:  pulumi.String("string"),
    	ShareId: pulumi.String("string"),
    	Name:    pulumi.String("string"),
    })
    
    var nfsSnapshotResource = new NfsSnapshot("nfsSnapshotResource", NfsSnapshotArgs.builder()
        .region("string")
        .shareId("string")
        .name("string")
        .build());
    
    nfs_snapshot_resource = digitalocean.NfsSnapshot("nfsSnapshotResource",
        region="string",
        share_id="string",
        name="string")
    
    const nfsSnapshotResource = new digitalocean.NfsSnapshot("nfsSnapshotResource", {
        region: "string",
        shareId: "string",
        name: "string",
    });
    
    type: digitalocean:NfsSnapshot
    properties:
        name: string
        region: string
        shareId: string
    

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

    Region string
    The region where the NFS snapshot will be created.
    ShareId string
    The ID of the NFS share to snapshot.
    Name string
    A name for the NFS snapshot. Must be lowercase and composed only of numbers, letters, and "-", up to a limit of 64 characters.
    Region string
    The region where the NFS snapshot will be created.
    ShareId string
    The ID of the NFS share to snapshot.
    Name string
    A name for the NFS snapshot. Must be lowercase and composed only of numbers, letters, and "-", up to a limit of 64 characters.
    region String
    The region where the NFS snapshot will be created.
    shareId String
    The ID of the NFS share to snapshot.
    name String
    A name for the NFS snapshot. Must be lowercase and composed only of numbers, letters, and "-", up to a limit of 64 characters.
    region string
    The region where the NFS snapshot will be created.
    shareId string
    The ID of the NFS share to snapshot.
    name string
    A name for the NFS snapshot. Must be lowercase and composed only of numbers, letters, and "-", up to a limit of 64 characters.
    region str
    The region where the NFS snapshot will be created.
    share_id str
    The ID of the NFS share to snapshot.
    name str
    A name for the NFS snapshot. Must be lowercase and composed only of numbers, letters, and "-", up to a limit of 64 characters.
    region String
    The region where the NFS snapshot will be created.
    shareId String
    The ID of the NFS share to snapshot.
    name String
    A name for the NFS snapshot. Must be lowercase and composed only of numbers, letters, and "-", up to a limit of 64 characters.

    Outputs

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

    CreatedAt string
    The date and time when the snapshot was created.
    Id string
    The provider-assigned unique ID for this managed resource.
    Size int
    The size of the snapshot in GiB.
    Status string
    CreatedAt string
    The date and time when the snapshot was created.
    Id string
    The provider-assigned unique ID for this managed resource.
    Size int
    The size of the snapshot in GiB.
    Status string
    createdAt String
    The date and time when the snapshot was created.
    id String
    The provider-assigned unique ID for this managed resource.
    size Integer
    The size of the snapshot in GiB.
    status String
    createdAt string
    The date and time when the snapshot was created.
    id string
    The provider-assigned unique ID for this managed resource.
    size number
    The size of the snapshot in GiB.
    status string
    created_at str
    The date and time when the snapshot was created.
    id str
    The provider-assigned unique ID for this managed resource.
    size int
    The size of the snapshot in GiB.
    status str
    createdAt String
    The date and time when the snapshot was created.
    id String
    The provider-assigned unique ID for this managed resource.
    size Number
    The size of the snapshot in GiB.
    status String

    Look up Existing NfsSnapshot Resource

    Get an existing NfsSnapshot 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?: NfsSnapshotState, opts?: CustomResourceOptions): NfsSnapshot
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            created_at: Optional[str] = None,
            name: Optional[str] = None,
            region: Optional[str] = None,
            share_id: Optional[str] = None,
            size: Optional[int] = None,
            status: Optional[str] = None) -> NfsSnapshot
    func GetNfsSnapshot(ctx *Context, name string, id IDInput, state *NfsSnapshotState, opts ...ResourceOption) (*NfsSnapshot, error)
    public static NfsSnapshot Get(string name, Input<string> id, NfsSnapshotState? state, CustomResourceOptions? opts = null)
    public static NfsSnapshot get(String name, Output<String> id, NfsSnapshotState state, CustomResourceOptions options)
    resources:  _:    type: digitalocean:NfsSnapshot    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.
    The following state arguments are supported:
    CreatedAt string
    The date and time when the snapshot was created.
    Name string
    A name for the NFS snapshot. Must be lowercase and composed only of numbers, letters, and "-", up to a limit of 64 characters.
    Region string
    The region where the NFS snapshot will be created.
    ShareId string
    The ID of the NFS share to snapshot.
    Size int
    The size of the snapshot in GiB.
    Status string
    CreatedAt string
    The date and time when the snapshot was created.
    Name string
    A name for the NFS snapshot. Must be lowercase and composed only of numbers, letters, and "-", up to a limit of 64 characters.
    Region string
    The region where the NFS snapshot will be created.
    ShareId string
    The ID of the NFS share to snapshot.
    Size int
    The size of the snapshot in GiB.
    Status string
    createdAt String
    The date and time when the snapshot was created.
    name String
    A name for the NFS snapshot. Must be lowercase and composed only of numbers, letters, and "-", up to a limit of 64 characters.
    region String
    The region where the NFS snapshot will be created.
    shareId String
    The ID of the NFS share to snapshot.
    size Integer
    The size of the snapshot in GiB.
    status String
    createdAt string
    The date and time when the snapshot was created.
    name string
    A name for the NFS snapshot. Must be lowercase and composed only of numbers, letters, and "-", up to a limit of 64 characters.
    region string
    The region where the NFS snapshot will be created.
    shareId string
    The ID of the NFS share to snapshot.
    size number
    The size of the snapshot in GiB.
    status string
    created_at str
    The date and time when the snapshot was created.
    name str
    A name for the NFS snapshot. Must be lowercase and composed only of numbers, letters, and "-", up to a limit of 64 characters.
    region str
    The region where the NFS snapshot will be created.
    share_id str
    The ID of the NFS share to snapshot.
    size int
    The size of the snapshot in GiB.
    status str
    createdAt String
    The date and time when the snapshot was created.
    name String
    A name for the NFS snapshot. Must be lowercase and composed only of numbers, letters, and "-", up to a limit of 64 characters.
    region String
    The region where the NFS snapshot will be created.
    shareId String
    The ID of the NFS share to snapshot.
    size Number
    The size of the snapshot in GiB.
    status String

    Import

    NFS snapshots can be imported using the snapshot ID, e.g.

    $ pulumi import digitalocean:index/nfsSnapshot:NfsSnapshot foobar 506f78a4-e098-11e5-ad9f-000f53306ae1
    

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

    Package Details

    Repository
    DigitalOcean pulumi/pulumi-digitalocean
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the digitalocean Terraform Provider.
    digitalocean logo
    DigitalOcean v4.56.0 published on Monday, Dec 22, 2025 by Pulumi
      Meet Neo: Your AI Platform Teammate