1. Packages
  2. DigitalOcean Provider
  3. API Docs
  4. Nfs
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 share which can be mounted to Droplets to provide shared storage.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as digitalocean from "@pulumi/digitalocean";
    
    const example = new digitalocean.Vpc("example", {
        name: "example-vpc",
        region: "nyc1",
    });
    const exampleNfs = new digitalocean.Nfs("example", {
        region: "nyc1",
        name: "example-nfs",
        size: 50,
        vpcId: example.id,
    });
    
    import pulumi
    import pulumi_digitalocean as digitalocean
    
    example = digitalocean.Vpc("example",
        name="example-vpc",
        region="nyc1")
    example_nfs = digitalocean.Nfs("example",
        region="nyc1",
        name="example-nfs",
        size=50,
        vpc_id=example.id)
    
    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 {
    		example, err := digitalocean.NewVpc(ctx, "example", &digitalocean.VpcArgs{
    			Name:   pulumi.String("example-vpc"),
    			Region: pulumi.String("nyc1"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = digitalocean.NewNfs(ctx, "example", &digitalocean.NfsArgs{
    			Region: pulumi.String("nyc1"),
    			Name:   pulumi.String("example-nfs"),
    			Size:   pulumi.Int(50),
    			VpcId:  example.ID(),
    		})
    		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 example = new DigitalOcean.Vpc("example", new()
        {
            Name = "example-vpc",
            Region = "nyc1",
        });
    
        var exampleNfs = new DigitalOcean.Nfs("example", new()
        {
            Region = "nyc1",
            Name = "example-nfs",
            Size = 50,
            VpcId = example.Id,
        });
    
    });
    
    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 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 example = new Vpc("example", VpcArgs.builder()
                .name("example-vpc")
                .region("nyc1")
                .build());
    
            var exampleNfs = new Nfs("exampleNfs", NfsArgs.builder()
                .region("nyc1")
                .name("example-nfs")
                .size(50)
                .vpcId(example.id())
                .build());
    
        }
    }
    
    resources:
      example:
        type: digitalocean:Vpc
        properties:
          name: example-vpc
          region: nyc1
      exampleNfs:
        type: digitalocean:Nfs
        name: example
        properties:
          region: nyc1
          name: example-nfs
          size: 50
          vpcId: ${example.id}
    

    Create Nfs Resource

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

    Constructor syntax

    new Nfs(name: string, args: NfsArgs, opts?: CustomResourceOptions);
    @overload
    def Nfs(resource_name: str,
            args: NfsArgs,
            opts: Optional[ResourceOptions] = None)
    
    @overload
    def Nfs(resource_name: str,
            opts: Optional[ResourceOptions] = None,
            region: Optional[str] = None,
            size: Optional[int] = None,
            vpc_id: Optional[str] = None,
            name: Optional[str] = None,
            tags: Optional[Sequence[str]] = None)
    func NewNfs(ctx *Context, name string, args NfsArgs, opts ...ResourceOption) (*Nfs, error)
    public Nfs(string name, NfsArgs args, CustomResourceOptions? opts = null)
    public Nfs(String name, NfsArgs args)
    public Nfs(String name, NfsArgs args, CustomResourceOptions options)
    
    type: digitalocean:Nfs
    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 NfsArgs
    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 NfsArgs
    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 NfsArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args NfsArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args NfsArgs
    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 nfsResource = new DigitalOcean.Nfs("nfsResource", new()
    {
        Region = "string",
        Size = 0,
        VpcId = "string",
        Name = "string",
        Tags = new[]
        {
            "string",
        },
    });
    
    example, err := digitalocean.NewNfs(ctx, "nfsResource", &digitalocean.NfsArgs{
    	Region: pulumi.String("string"),
    	Size:   pulumi.Int(0),
    	VpcId:  pulumi.String("string"),
    	Name:   pulumi.String("string"),
    	Tags: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    })
    
    var nfsResource = new Nfs("nfsResource", NfsArgs.builder()
        .region("string")
        .size(0)
        .vpcId("string")
        .name("string")
        .tags("string")
        .build());
    
    nfs_resource = digitalocean.Nfs("nfsResource",
        region="string",
        size=0,
        vpc_id="string",
        name="string",
        tags=["string"])
    
    const nfsResource = new digitalocean.Nfs("nfsResource", {
        region: "string",
        size: 0,
        vpcId: "string",
        name: "string",
        tags: ["string"],
    });
    
    type: digitalocean:Nfs
    properties:
        name: string
        region: string
        size: 0
        tags:
            - string
        vpcId: string
    

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

    Region string
    The region where the NFS share will be created.
    Size int
    The size of the NFS share in GiB. Minimum size is 50 GiB.
    VpcId string
    The ID of the VPC where the NFS share will be created.
    Name string
    A name for the NFS share. Must be lowercase and composed only of numbers, letters, and "-", up to a limit of 64 characters. The name must begin with a letter.
    Tags List<string>
    Region string
    The region where the NFS share will be created.
    Size int
    The size of the NFS share in GiB. Minimum size is 50 GiB.
    VpcId string
    The ID of the VPC where the NFS share will be created.
    Name string
    A name for the NFS share. Must be lowercase and composed only of numbers, letters, and "-", up to a limit of 64 characters. The name must begin with a letter.
    Tags []string
    region String
    The region where the NFS share will be created.
    size Integer
    The size of the NFS share in GiB. Minimum size is 50 GiB.
    vpcId String
    The ID of the VPC where the NFS share will be created.
    name String
    A name for the NFS share. Must be lowercase and composed only of numbers, letters, and "-", up to a limit of 64 characters. The name must begin with a letter.
    tags List<String>
    region string
    The region where the NFS share will be created.
    size number
    The size of the NFS share in GiB. Minimum size is 50 GiB.
    vpcId string
    The ID of the VPC where the NFS share will be created.
    name string
    A name for the NFS share. Must be lowercase and composed only of numbers, letters, and "-", up to a limit of 64 characters. The name must begin with a letter.
    tags string[]
    region str
    The region where the NFS share will be created.
    size int
    The size of the NFS share in GiB. Minimum size is 50 GiB.
    vpc_id str
    The ID of the VPC where the NFS share will be created.
    name str
    A name for the NFS share. Must be lowercase and composed only of numbers, letters, and "-", up to a limit of 64 characters. The name must begin with a letter.
    tags Sequence[str]
    region String
    The region where the NFS share will be created.
    size Number
    The size of the NFS share in GiB. Minimum size is 50 GiB.
    vpcId String
    The ID of the VPC where the NFS share will be created.
    name String
    A name for the NFS share. Must be lowercase and composed only of numbers, letters, and "-", up to a limit of 64 characters. The name must begin with a letter.
    tags List<String>

    Outputs

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

    Host string
    The host IP of the NFS server accessible from the associated VPC.
    Id string
    The provider-assigned unique ID for this managed resource.
    MountPath string
    The mount path for accessing the NFS share.
    Status string
    The current status of the NFS share.
    VpcIds List<string>
    Host string
    The host IP of the NFS server accessible from the associated VPC.
    Id string
    The provider-assigned unique ID for this managed resource.
    MountPath string
    The mount path for accessing the NFS share.
    Status string
    The current status of the NFS share.
    VpcIds []string
    host String
    The host IP of the NFS server accessible from the associated VPC.
    id String
    The provider-assigned unique ID for this managed resource.
    mountPath String
    The mount path for accessing the NFS share.
    status String
    The current status of the NFS share.
    vpcIds List<String>
    host string
    The host IP of the NFS server accessible from the associated VPC.
    id string
    The provider-assigned unique ID for this managed resource.
    mountPath string
    The mount path for accessing the NFS share.
    status string
    The current status of the NFS share.
    vpcIds string[]
    host str
    The host IP of the NFS server accessible from the associated VPC.
    id str
    The provider-assigned unique ID for this managed resource.
    mount_path str
    The mount path for accessing the NFS share.
    status str
    The current status of the NFS share.
    vpc_ids Sequence[str]
    host String
    The host IP of the NFS server accessible from the associated VPC.
    id String
    The provider-assigned unique ID for this managed resource.
    mountPath String
    The mount path for accessing the NFS share.
    status String
    The current status of the NFS share.
    vpcIds List<String>

    Look up Existing Nfs Resource

    Get an existing Nfs 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?: NfsState, opts?: CustomResourceOptions): Nfs
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            host: Optional[str] = None,
            mount_path: Optional[str] = None,
            name: Optional[str] = None,
            region: Optional[str] = None,
            size: Optional[int] = None,
            status: Optional[str] = None,
            tags: Optional[Sequence[str]] = None,
            vpc_id: Optional[str] = None,
            vpc_ids: Optional[Sequence[str]] = None) -> Nfs
    func GetNfs(ctx *Context, name string, id IDInput, state *NfsState, opts ...ResourceOption) (*Nfs, error)
    public static Nfs Get(string name, Input<string> id, NfsState? state, CustomResourceOptions? opts = null)
    public static Nfs get(String name, Output<String> id, NfsState state, CustomResourceOptions options)
    resources:  _:    type: digitalocean:Nfs    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:
    Host string
    The host IP of the NFS server accessible from the associated VPC.
    MountPath string
    The mount path for accessing the NFS share.
    Name string
    A name for the NFS share. Must be lowercase and composed only of numbers, letters, and "-", up to a limit of 64 characters. The name must begin with a letter.
    Region string
    The region where the NFS share will be created.
    Size int
    The size of the NFS share in GiB. Minimum size is 50 GiB.
    Status string
    The current status of the NFS share.
    Tags List<string>
    VpcId string
    The ID of the VPC where the NFS share will be created.
    VpcIds List<string>
    Host string
    The host IP of the NFS server accessible from the associated VPC.
    MountPath string
    The mount path for accessing the NFS share.
    Name string
    A name for the NFS share. Must be lowercase and composed only of numbers, letters, and "-", up to a limit of 64 characters. The name must begin with a letter.
    Region string
    The region where the NFS share will be created.
    Size int
    The size of the NFS share in GiB. Minimum size is 50 GiB.
    Status string
    The current status of the NFS share.
    Tags []string
    VpcId string
    The ID of the VPC where the NFS share will be created.
    VpcIds []string
    host String
    The host IP of the NFS server accessible from the associated VPC.
    mountPath String
    The mount path for accessing the NFS share.
    name String
    A name for the NFS share. Must be lowercase and composed only of numbers, letters, and "-", up to a limit of 64 characters. The name must begin with a letter.
    region String
    The region where the NFS share will be created.
    size Integer
    The size of the NFS share in GiB. Minimum size is 50 GiB.
    status String
    The current status of the NFS share.
    tags List<String>
    vpcId String
    The ID of the VPC where the NFS share will be created.
    vpcIds List<String>
    host string
    The host IP of the NFS server accessible from the associated VPC.
    mountPath string
    The mount path for accessing the NFS share.
    name string
    A name for the NFS share. Must be lowercase and composed only of numbers, letters, and "-", up to a limit of 64 characters. The name must begin with a letter.
    region string
    The region where the NFS share will be created.
    size number
    The size of the NFS share in GiB. Minimum size is 50 GiB.
    status string
    The current status of the NFS share.
    tags string[]
    vpcId string
    The ID of the VPC where the NFS share will be created.
    vpcIds string[]
    host str
    The host IP of the NFS server accessible from the associated VPC.
    mount_path str
    The mount path for accessing the NFS share.
    name str
    A name for the NFS share. Must be lowercase and composed only of numbers, letters, and "-", up to a limit of 64 characters. The name must begin with a letter.
    region str
    The region where the NFS share will be created.
    size int
    The size of the NFS share in GiB. Minimum size is 50 GiB.
    status str
    The current status of the NFS share.
    tags Sequence[str]
    vpc_id str
    The ID of the VPC where the NFS share will be created.
    vpc_ids Sequence[str]
    host String
    The host IP of the NFS server accessible from the associated VPC.
    mountPath String
    The mount path for accessing the NFS share.
    name String
    A name for the NFS share. Must be lowercase and composed only of numbers, letters, and "-", up to a limit of 64 characters. The name must begin with a letter.
    region String
    The region where the NFS share will be created.
    size Number
    The size of the NFS share in GiB. Minimum size is 50 GiB.
    status String
    The current status of the NFS share.
    tags List<String>
    vpcId String
    The ID of the VPC where the NFS share will be created.
    vpcIds List<String>

    Import

    NFS shares can be imported using the share id and the region , e.g.

    $ pulumi import digitalocean:index/nfs:Nfs foobar 506f78a4-e098-11e5-ad9f-000f53306ae1,atl1
    

    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