Manages attaching a NFS share to a vpc.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";
const foobar = new digitalocean.Vpc("foobar", {
name: "example-vpc",
region: "atl1",
});
const foobarNfs = new digitalocean.Nfs("foobar", {
region: "atl1",
name: "example-nfs",
size: 50,
vpcId: foobar.id,
});
const foobarNfsAttachment = new digitalocean.NfsAttachment("foobar", {
shareId: foobarNfs.id,
vpcId: foobar.id,
});
import pulumi
import pulumi_digitalocean as digitalocean
foobar = digitalocean.Vpc("foobar",
name="example-vpc",
region="atl1")
foobar_nfs = digitalocean.Nfs("foobar",
region="atl1",
name="example-nfs",
size=50,
vpc_id=foobar.id)
foobar_nfs_attachment = digitalocean.NfsAttachment("foobar",
share_id=foobar_nfs.id,
vpc_id=foobar.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 {
foobar, err := digitalocean.NewVpc(ctx, "foobar", &digitalocean.VpcArgs{
Name: pulumi.String("example-vpc"),
Region: pulumi.String("atl1"),
})
if err != nil {
return err
}
foobarNfs, err := digitalocean.NewNfs(ctx, "foobar", &digitalocean.NfsArgs{
Region: pulumi.String("atl1"),
Name: pulumi.String("example-nfs"),
Size: pulumi.Int(50),
VpcId: foobar.ID(),
})
if err != nil {
return err
}
_, err = digitalocean.NewNfsAttachment(ctx, "foobar", &digitalocean.NfsAttachmentArgs{
ShareId: foobarNfs.ID(),
VpcId: foobar.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 foobar = new DigitalOcean.Vpc("foobar", new()
{
Name = "example-vpc",
Region = "atl1",
});
var foobarNfs = new DigitalOcean.Nfs("foobar", new()
{
Region = "atl1",
Name = "example-nfs",
Size = 50,
VpcId = foobar.Id,
});
var foobarNfsAttachment = new DigitalOcean.NfsAttachment("foobar", new()
{
ShareId = foobarNfs.Id,
VpcId = foobar.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 com.pulumi.digitalocean.NfsAttachment;
import com.pulumi.digitalocean.NfsAttachmentArgs;
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("atl1")
.build());
var foobarNfs = new Nfs("foobarNfs", NfsArgs.builder()
.region("atl1")
.name("example-nfs")
.size(50)
.vpcId(foobar.id())
.build());
var foobarNfsAttachment = new NfsAttachment("foobarNfsAttachment", NfsAttachmentArgs.builder()
.shareId(foobarNfs.id())
.vpcId(foobar.id())
.build());
}
}
resources:
foobar:
type: digitalocean:Vpc
properties:
name: example-vpc
region: atl1
foobarNfs:
type: digitalocean:Nfs
name: foobar
properties:
region: atl1
name: example-nfs
size: 50
vpcId: ${foobar.id}
foobarNfsAttachment:
type: digitalocean:NfsAttachment
name: foobar
properties:
shareId: ${foobarNfs.id}
vpcId: ${foobar.id}
Create NfsAttachment Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new NfsAttachment(name: string, args: NfsAttachmentArgs, opts?: CustomResourceOptions);@overload
def NfsAttachment(resource_name: str,
args: NfsAttachmentArgs,
opts: Optional[ResourceOptions] = None)
@overload
def NfsAttachment(resource_name: str,
opts: Optional[ResourceOptions] = None,
region: Optional[str] = None,
share_id: Optional[str] = None,
vpc_id: Optional[str] = None)func NewNfsAttachment(ctx *Context, name string, args NfsAttachmentArgs, opts ...ResourceOption) (*NfsAttachment, error)public NfsAttachment(string name, NfsAttachmentArgs args, CustomResourceOptions? opts = null)
public NfsAttachment(String name, NfsAttachmentArgs args)
public NfsAttachment(String name, NfsAttachmentArgs args, CustomResourceOptions options)
type: digitalocean:NfsAttachment
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 NfsAttachmentArgs
- 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 NfsAttachmentArgs
- 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 NfsAttachmentArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args NfsAttachmentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args NfsAttachmentArgs
- 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 nfsAttachmentResource = new DigitalOcean.NfsAttachment("nfsAttachmentResource", new()
{
Region = "string",
ShareId = "string",
VpcId = "string",
});
example, err := digitalocean.NewNfsAttachment(ctx, "nfsAttachmentResource", &digitalocean.NfsAttachmentArgs{
Region: pulumi.String("string"),
ShareId: pulumi.String("string"),
VpcId: pulumi.String("string"),
})
var nfsAttachmentResource = new NfsAttachment("nfsAttachmentResource", NfsAttachmentArgs.builder()
.region("string")
.shareId("string")
.vpcId("string")
.build());
nfs_attachment_resource = digitalocean.NfsAttachment("nfsAttachmentResource",
region="string",
share_id="string",
vpc_id="string")
const nfsAttachmentResource = new digitalocean.NfsAttachment("nfsAttachmentResource", {
region: "string",
shareId: "string",
vpcId: "string",
});
type: digitalocean:NfsAttachment
properties:
region: string
shareId: string
vpcId: string
NfsAttachment 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 NfsAttachment resource accepts the following input properties:
Outputs
All input properties are implicitly available as output properties. Additionally, the NfsAttachment resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing NfsAttachment Resource
Get an existing NfsAttachment 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?: NfsAttachmentState, opts?: CustomResourceOptions): NfsAttachment@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
region: Optional[str] = None,
share_id: Optional[str] = None,
vpc_id: Optional[str] = None) -> NfsAttachmentfunc GetNfsAttachment(ctx *Context, name string, id IDInput, state *NfsAttachmentState, opts ...ResourceOption) (*NfsAttachment, error)public static NfsAttachment Get(string name, Input<string> id, NfsAttachmentState? state, CustomResourceOptions? opts = null)public static NfsAttachment get(String name, Output<String> id, NfsAttachmentState state, CustomResourceOptions options)resources: _: type: digitalocean:NfsAttachment 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.
Import
NFS attachments can be imported using the share_id and vpc_id separated by a comma, e.g.
$ pulumi import digitalocean:index/nfsAttachment:NfsAttachment foobar 506f78a4-e098-11e5-ad9f-000f53306ae1,d1ebc5a4-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
digitaloceanTerraform Provider.
