1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. nas
  5. Fileset
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.nas.Fileset

Explore with Pulumi AI

Provides a File Storage (NAS) Fileset resource.

For information about File Storage (NAS) Fileset and how to use it, see What is Fileset.

NOTE: Available since v1.153.0.

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const example = alicloud.nas.getZones({
    fileSystemType: "cpfs",
});
const exampleNetwork = new alicloud.vpc.Network("example", {
    vpcName: "terraform-example",
    cidrBlock: "172.17.3.0/24",
});
const exampleSwitch = new alicloud.vpc.Switch("example", {
    vswitchName: "terraform-example",
    cidrBlock: "172.17.3.0/24",
    vpcId: exampleNetwork.id,
    zoneId: example.then(example => example.zones?.[1]?.zoneId),
});
const exampleFileSystem = new alicloud.nas.FileSystem("example", {
    protocolType: "cpfs",
    storageType: "advance_200",
    fileSystemType: "cpfs",
    capacity: 3600,
    zoneId: example.then(example => example.zones?.[1]?.zoneId),
    vpcId: exampleNetwork.id,
    vswitchId: exampleSwitch.id,
});
const exampleFileset = new alicloud.nas.Fileset("example", {
    fileSystemId: exampleFileSystem.id,
    description: "terraform-example",
    fileSystemPath: "/example_path/",
});
Copy
import pulumi
import pulumi_alicloud as alicloud

example = alicloud.nas.get_zones(file_system_type="cpfs")
example_network = alicloud.vpc.Network("example",
    vpc_name="terraform-example",
    cidr_block="172.17.3.0/24")
example_switch = alicloud.vpc.Switch("example",
    vswitch_name="terraform-example",
    cidr_block="172.17.3.0/24",
    vpc_id=example_network.id,
    zone_id=example.zones[1].zone_id)
example_file_system = alicloud.nas.FileSystem("example",
    protocol_type="cpfs",
    storage_type="advance_200",
    file_system_type="cpfs",
    capacity=3600,
    zone_id=example.zones[1].zone_id,
    vpc_id=example_network.id,
    vswitch_id=example_switch.id)
example_fileset = alicloud.nas.Fileset("example",
    file_system_id=example_file_system.id,
    description="terraform-example",
    file_system_path="/example_path/")
Copy
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/nas"
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := nas.GetZones(ctx, &nas.GetZonesArgs{
			FileSystemType: pulumi.StringRef("cpfs"),
		}, nil)
		if err != nil {
			return err
		}
		exampleNetwork, err := vpc.NewNetwork(ctx, "example", &vpc.NetworkArgs{
			VpcName:   pulumi.String("terraform-example"),
			CidrBlock: pulumi.String("172.17.3.0/24"),
		})
		if err != nil {
			return err
		}
		exampleSwitch, err := vpc.NewSwitch(ctx, "example", &vpc.SwitchArgs{
			VswitchName: pulumi.String("terraform-example"),
			CidrBlock:   pulumi.String("172.17.3.0/24"),
			VpcId:       exampleNetwork.ID(),
			ZoneId:      pulumi.String(example.Zones[1].ZoneId),
		})
		if err != nil {
			return err
		}
		exampleFileSystem, err := nas.NewFileSystem(ctx, "example", &nas.FileSystemArgs{
			ProtocolType:   pulumi.String("cpfs"),
			StorageType:    pulumi.String("advance_200"),
			FileSystemType: pulumi.String("cpfs"),
			Capacity:       pulumi.Int(3600),
			ZoneId:         pulumi.String(example.Zones[1].ZoneId),
			VpcId:          exampleNetwork.ID(),
			VswitchId:      exampleSwitch.ID(),
		})
		if err != nil {
			return err
		}
		_, err = nas.NewFileset(ctx, "example", &nas.FilesetArgs{
			FileSystemId:   exampleFileSystem.ID(),
			Description:    pulumi.String("terraform-example"),
			FileSystemPath: pulumi.String("/example_path/"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    var example = AliCloud.Nas.GetZones.Invoke(new()
    {
        FileSystemType = "cpfs",
    });

    var exampleNetwork = new AliCloud.Vpc.Network("example", new()
    {
        VpcName = "terraform-example",
        CidrBlock = "172.17.3.0/24",
    });

    var exampleSwitch = new AliCloud.Vpc.Switch("example", new()
    {
        VswitchName = "terraform-example",
        CidrBlock = "172.17.3.0/24",
        VpcId = exampleNetwork.Id,
        ZoneId = example.Apply(getZonesResult => getZonesResult.Zones[1]?.ZoneId),
    });

    var exampleFileSystem = new AliCloud.Nas.FileSystem("example", new()
    {
        ProtocolType = "cpfs",
        StorageType = "advance_200",
        FileSystemType = "cpfs",
        Capacity = 3600,
        ZoneId = example.Apply(getZonesResult => getZonesResult.Zones[1]?.ZoneId),
        VpcId = exampleNetwork.Id,
        VswitchId = exampleSwitch.Id,
    });

    var exampleFileset = new AliCloud.Nas.Fileset("example", new()
    {
        FileSystemId = exampleFileSystem.Id,
        Description = "terraform-example",
        FileSystemPath = "/example_path/",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.nas.NasFunctions;
import com.pulumi.alicloud.nas.inputs.GetZonesArgs;
import com.pulumi.alicloud.vpc.Network;
import com.pulumi.alicloud.vpc.NetworkArgs;
import com.pulumi.alicloud.vpc.Switch;
import com.pulumi.alicloud.vpc.SwitchArgs;
import com.pulumi.alicloud.nas.FileSystem;
import com.pulumi.alicloud.nas.FileSystemArgs;
import com.pulumi.alicloud.nas.Fileset;
import com.pulumi.alicloud.nas.FilesetArgs;
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) {
        final var example = NasFunctions.getZones(GetZonesArgs.builder()
            .fileSystemType("cpfs")
            .build());

        var exampleNetwork = new Network("exampleNetwork", NetworkArgs.builder()
            .vpcName("terraform-example")
            .cidrBlock("172.17.3.0/24")
            .build());

        var exampleSwitch = new Switch("exampleSwitch", SwitchArgs.builder()
            .vswitchName("terraform-example")
            .cidrBlock("172.17.3.0/24")
            .vpcId(exampleNetwork.id())
            .zoneId(example.applyValue(getZonesResult -> getZonesResult.zones()[1].zoneId()))
            .build());

        var exampleFileSystem = new FileSystem("exampleFileSystem", FileSystemArgs.builder()
            .protocolType("cpfs")
            .storageType("advance_200")
            .fileSystemType("cpfs")
            .capacity(3600)
            .zoneId(example.applyValue(getZonesResult -> getZonesResult.zones()[1].zoneId()))
            .vpcId(exampleNetwork.id())
            .vswitchId(exampleSwitch.id())
            .build());

        var exampleFileset = new Fileset("exampleFileset", FilesetArgs.builder()
            .fileSystemId(exampleFileSystem.id())
            .description("terraform-example")
            .fileSystemPath("/example_path/")
            .build());

    }
}
Copy
resources:
  exampleNetwork:
    type: alicloud:vpc:Network
    name: example
    properties:
      vpcName: terraform-example
      cidrBlock: 172.17.3.0/24
  exampleSwitch:
    type: alicloud:vpc:Switch
    name: example
    properties:
      vswitchName: terraform-example
      cidrBlock: 172.17.3.0/24
      vpcId: ${exampleNetwork.id}
      zoneId: ${example.zones[1].zoneId}
  exampleFileSystem:
    type: alicloud:nas:FileSystem
    name: example
    properties:
      protocolType: cpfs
      storageType: advance_200
      fileSystemType: cpfs
      capacity: 3600
      zoneId: ${example.zones[1].zoneId}
      vpcId: ${exampleNetwork.id}
      vswitchId: ${exampleSwitch.id}
  exampleFileset:
    type: alicloud:nas:Fileset
    name: example
    properties:
      fileSystemId: ${exampleFileSystem.id}
      description: terraform-example
      fileSystemPath: /example_path/
variables:
  example:
    fn::invoke:
      function: alicloud:nas:getZones
      arguments:
        fileSystemType: cpfs
Copy

Create Fileset Resource

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

Constructor syntax

new Fileset(name: string, args: FilesetArgs, opts?: CustomResourceOptions);
@overload
def Fileset(resource_name: str,
            args: FilesetArgs,
            opts: Optional[ResourceOptions] = None)

@overload
def Fileset(resource_name: str,
            opts: Optional[ResourceOptions] = None,
            file_system_id: Optional[str] = None,
            file_system_path: Optional[str] = None,
            description: Optional[str] = None,
            dry_run: Optional[bool] = None)
func NewFileset(ctx *Context, name string, args FilesetArgs, opts ...ResourceOption) (*Fileset, error)
public Fileset(string name, FilesetArgs args, CustomResourceOptions? opts = null)
public Fileset(String name, FilesetArgs args)
public Fileset(String name, FilesetArgs args, CustomResourceOptions options)
type: alicloud:nas:Fileset
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. FilesetArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. FilesetArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. FilesetArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. FilesetArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. FilesetArgs
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 filesetResource = new AliCloud.Nas.Fileset("filesetResource", new()
{
    FileSystemId = "string",
    FileSystemPath = "string",
    Description = "string",
    DryRun = false,
});
Copy
example, err := nas.NewFileset(ctx, "filesetResource", &nas.FilesetArgs{
	FileSystemId:   pulumi.String("string"),
	FileSystemPath: pulumi.String("string"),
	Description:    pulumi.String("string"),
	DryRun:         pulumi.Bool(false),
})
Copy
var filesetResource = new Fileset("filesetResource", FilesetArgs.builder()
    .fileSystemId("string")
    .fileSystemPath("string")
    .description("string")
    .dryRun(false)
    .build());
Copy
fileset_resource = alicloud.nas.Fileset("filesetResource",
    file_system_id="string",
    file_system_path="string",
    description="string",
    dry_run=False)
Copy
const filesetResource = new alicloud.nas.Fileset("filesetResource", {
    fileSystemId: "string",
    fileSystemPath: "string",
    description: "string",
    dryRun: false,
});
Copy
type: alicloud:nas:Fileset
properties:
    description: string
    dryRun: false
    fileSystemId: string
    fileSystemPath: string
Copy

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

FileSystemId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the file system.
FileSystemPath
This property is required.
Changes to this property will trigger replacement.
string
The path of the fileset.
Description string
The description of the Fileset. It must be 2 to 128 characters in length and must start with a letter or Chinese, but cannot start with https:// or https://.
DryRun bool
The dry run.
FileSystemId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the file system.
FileSystemPath
This property is required.
Changes to this property will trigger replacement.
string
The path of the fileset.
Description string
The description of the Fileset. It must be 2 to 128 characters in length and must start with a letter or Chinese, but cannot start with https:// or https://.
DryRun bool
The dry run.
fileSystemId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the file system.
fileSystemPath
This property is required.
Changes to this property will trigger replacement.
String
The path of the fileset.
description String
The description of the Fileset. It must be 2 to 128 characters in length and must start with a letter or Chinese, but cannot start with https:// or https://.
dryRun Boolean
The dry run.
fileSystemId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the file system.
fileSystemPath
This property is required.
Changes to this property will trigger replacement.
string
The path of the fileset.
description string
The description of the Fileset. It must be 2 to 128 characters in length and must start with a letter or Chinese, but cannot start with https:// or https://.
dryRun boolean
The dry run.
file_system_id
This property is required.
Changes to this property will trigger replacement.
str
The ID of the file system.
file_system_path
This property is required.
Changes to this property will trigger replacement.
str
The path of the fileset.
description str
The description of the Fileset. It must be 2 to 128 characters in length and must start with a letter or Chinese, but cannot start with https:// or https://.
dry_run bool
The dry run.
fileSystemId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the file system.
fileSystemPath
This property is required.
Changes to this property will trigger replacement.
String
The path of the fileset.
description String
The description of the Fileset. It must be 2 to 128 characters in length and must start with a letter or Chinese, but cannot start with https:// or https://.
dryRun Boolean
The dry run.

Outputs

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

FilesetId string
The first ID of the resource.
Id string
The provider-assigned unique ID for this managed resource.
Status string
The status of the fileset.
FilesetId string
The first ID of the resource.
Id string
The provider-assigned unique ID for this managed resource.
Status string
The status of the fileset.
filesetId String
The first ID of the resource.
id String
The provider-assigned unique ID for this managed resource.
status String
The status of the fileset.
filesetId string
The first ID of the resource.
id string
The provider-assigned unique ID for this managed resource.
status string
The status of the fileset.
fileset_id str
The first ID of the resource.
id str
The provider-assigned unique ID for this managed resource.
status str
The status of the fileset.
filesetId String
The first ID of the resource.
id String
The provider-assigned unique ID for this managed resource.
status String
The status of the fileset.

Look up Existing Fileset Resource

Get an existing Fileset 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?: FilesetState, opts?: CustomResourceOptions): Fileset
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        description: Optional[str] = None,
        dry_run: Optional[bool] = None,
        file_system_id: Optional[str] = None,
        file_system_path: Optional[str] = None,
        fileset_id: Optional[str] = None,
        status: Optional[str] = None) -> Fileset
func GetFileset(ctx *Context, name string, id IDInput, state *FilesetState, opts ...ResourceOption) (*Fileset, error)
public static Fileset Get(string name, Input<string> id, FilesetState? state, CustomResourceOptions? opts = null)
public static Fileset get(String name, Output<String> id, FilesetState state, CustomResourceOptions options)
resources:  _:    type: alicloud:nas:Fileset    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
Description string
The description of the Fileset. It must be 2 to 128 characters in length and must start with a letter or Chinese, but cannot start with https:// or https://.
DryRun bool
The dry run.
FileSystemId Changes to this property will trigger replacement. string
The ID of the file system.
FileSystemPath Changes to this property will trigger replacement. string
The path of the fileset.
FilesetId string
The first ID of the resource.
Status string
The status of the fileset.
Description string
The description of the Fileset. It must be 2 to 128 characters in length and must start with a letter or Chinese, but cannot start with https:// or https://.
DryRun bool
The dry run.
FileSystemId Changes to this property will trigger replacement. string
The ID of the file system.
FileSystemPath Changes to this property will trigger replacement. string
The path of the fileset.
FilesetId string
The first ID of the resource.
Status string
The status of the fileset.
description String
The description of the Fileset. It must be 2 to 128 characters in length and must start with a letter or Chinese, but cannot start with https:// or https://.
dryRun Boolean
The dry run.
fileSystemId Changes to this property will trigger replacement. String
The ID of the file system.
fileSystemPath Changes to this property will trigger replacement. String
The path of the fileset.
filesetId String
The first ID of the resource.
status String
The status of the fileset.
description string
The description of the Fileset. It must be 2 to 128 characters in length and must start with a letter or Chinese, but cannot start with https:// or https://.
dryRun boolean
The dry run.
fileSystemId Changes to this property will trigger replacement. string
The ID of the file system.
fileSystemPath Changes to this property will trigger replacement. string
The path of the fileset.
filesetId string
The first ID of the resource.
status string
The status of the fileset.
description str
The description of the Fileset. It must be 2 to 128 characters in length and must start with a letter or Chinese, but cannot start with https:// or https://.
dry_run bool
The dry run.
file_system_id Changes to this property will trigger replacement. str
The ID of the file system.
file_system_path Changes to this property will trigger replacement. str
The path of the fileset.
fileset_id str
The first ID of the resource.
status str
The status of the fileset.
description String
The description of the Fileset. It must be 2 to 128 characters in length and must start with a letter or Chinese, but cannot start with https:// or https://.
dryRun Boolean
The dry run.
fileSystemId Changes to this property will trigger replacement. String
The ID of the file system.
fileSystemPath Changes to this property will trigger replacement. String
The path of the fileset.
filesetId String
The first ID of the resource.
status String
The status of the fileset.

Import

File Storage (NAS) Fileset can be imported using the id, e.g.

$ pulumi import alicloud:nas/fileset:Fileset example <file_system_id>:<fileset_id>
Copy

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

Package Details

Repository
Alibaba Cloud pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.