Fileset

Provides a Network Attached Storage (NAS) Fileset resource.

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

NOTE: Available in v1.153.0+.

Example Usage

Basic Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var defaultZones = Output.Create(AliCloud.Nas.GetZones.InvokeAsync(new AliCloud.Nas.GetZonesArgs
        {
            FileSystemType = "cpfs",
        }));
        var defaultNetworks = Output.Create(AliCloud.Vpc.GetNetworks.InvokeAsync(new AliCloud.Vpc.GetNetworksArgs
        {
            NameRegex = "default-NODELETING",
        }));
        var defaultSwitches = Output.Tuple(defaultNetworks, defaultZones).Apply(values =>
        {
            var defaultNetworks = values.Item1;
            var defaultZones = values.Item2;
            return Output.Create(AliCloud.Vpc.GetSwitches.InvokeAsync(new AliCloud.Vpc.GetSwitchesArgs
            {
                VpcId = defaultNetworks.Ids?[0],
                ZoneId = defaultZones.Zones?[0]?.ZoneId,
            }));
        });
        var defaultFileSystem = new AliCloud.Nas.FileSystem("defaultFileSystem", new AliCloud.Nas.FileSystemArgs
        {
            ProtocolType = "cpfs",
            StorageType = "advance_200",
            FileSystemType = "cpfs",
            Capacity = 3600,
            Description = "tf-testacc",
            ZoneId = defaultZones.Apply(defaultZones => defaultZones.Zones?[0]?.ZoneId),
            VpcId = defaultNetworks.Apply(defaultNetworks => defaultNetworks.Ids?[0]),
            VswitchId = defaultSwitches.Apply(defaultSwitches => defaultSwitches.Ids?[0]),
        });
        var defaultFileset = new AliCloud.Nas.Fileset("defaultFileset", new AliCloud.Nas.FilesetArgs
        {
            FileSystemId = defaultFileSystem.Id,
            FileSystemPath = "/example_path/",
            Description = "tf-testacc",
        });
    }

}
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 {
		defaultZones, err := nas.GetZones(ctx, &nas.GetZonesArgs{
			FileSystemType: pulumi.StringRef("cpfs"),
		}, nil)
		if err != nil {
			return err
		}
		defaultNetworks, err := vpc.GetNetworks(ctx, &vpc.GetNetworksArgs{
			NameRegex: pulumi.StringRef("default-NODELETING"),
		}, nil)
		if err != nil {
			return err
		}
		defaultSwitches, err := vpc.GetSwitches(ctx, &vpc.GetSwitchesArgs{
			VpcId:  pulumi.StringRef(defaultNetworks.Ids[0]),
			ZoneId: pulumi.StringRef(defaultZones.Zones[0].ZoneId),
		}, nil)
		if err != nil {
			return err
		}
		defaultFileSystem, err := nas.NewFileSystem(ctx, "defaultFileSystem", &nas.FileSystemArgs{
			ProtocolType:   pulumi.String("cpfs"),
			StorageType:    pulumi.String("advance_200"),
			FileSystemType: pulumi.String("cpfs"),
			Capacity:       pulumi.Int(3600),
			Description:    pulumi.String("tf-testacc"),
			ZoneId:         pulumi.String(defaultZones.Zones[0].ZoneId),
			VpcId:          pulumi.String(defaultNetworks.Ids[0]),
			VswitchId:      pulumi.String(defaultSwitches.Ids[0]),
		})
		if err != nil {
			return err
		}
		_, err = nas.NewFileset(ctx, "defaultFileset", &nas.FilesetArgs{
			FileSystemId:   defaultFileSystem.ID(),
			FileSystemPath: pulumi.String("/example_path/"),
			Description:    pulumi.String("tf-testacc"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
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.adb.inputs.GetZonesArgs;
import com.pulumi.alicloud.vpc.VpcFunctions;
import com.pulumi.alicloud.cloudconnect.inputs.GetNetworksArgs;
import com.pulumi.alicloud.vpc.inputs.GetSwitchesArgs;
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 defaultZones = NasFunctions.getZones(GetZonesArgs.builder()
            .fileSystemType("cpfs")
            .build());

        final var defaultNetworks = VpcFunctions.getNetworks(GetNetworksArgs.builder()
            .nameRegex("default-NODELETING")
            .build());

        final var defaultSwitches = VpcFunctions.getSwitches(GetSwitchesArgs.builder()
            .vpcId(defaultNetworks.applyValue(getNetworksResult -> getNetworksResult.ids()[0]))
            .zoneId(defaultZones.applyValue(getZonesResult -> getZonesResult.zones()[0].zoneId()))
            .build());

        var defaultFileSystem = new FileSystem("defaultFileSystem", FileSystemArgs.builder()        
            .protocolType("cpfs")
            .storageType("advance_200")
            .fileSystemType("cpfs")
            .capacity(3600)
            .description("tf-testacc")
            .zoneId(defaultZones.applyValue(getZonesResult -> getZonesResult.zones()[0].zoneId()))
            .vpcId(defaultNetworks.applyValue(getNetworksResult -> getNetworksResult.ids()[0]))
            .vswitchId(defaultSwitches.applyValue(getSwitchesResult -> getSwitchesResult.ids()[0]))
            .build());

        var defaultFileset = new Fileset("defaultFileset", FilesetArgs.builder()        
            .fileSystemId(defaultFileSystem.id())
            .fileSystemPath("/example_path/")
            .description("tf-testacc")
            .build());

    }
}
import pulumi
import pulumi_alicloud as alicloud

default_zones = alicloud.nas.get_zones(file_system_type="cpfs")
default_networks = alicloud.vpc.get_networks(name_regex="default-NODELETING")
default_switches = alicloud.vpc.get_switches(vpc_id=default_networks.ids[0],
    zone_id=default_zones.zones[0].zone_id)
default_file_system = alicloud.nas.FileSystem("defaultFileSystem",
    protocol_type="cpfs",
    storage_type="advance_200",
    file_system_type="cpfs",
    capacity=3600,
    description="tf-testacc",
    zone_id=default_zones.zones[0].zone_id,
    vpc_id=default_networks.ids[0],
    vswitch_id=default_switches.ids[0])
default_fileset = alicloud.nas.Fileset("defaultFileset",
    file_system_id=default_file_system.id,
    file_system_path="/example_path/",
    description="tf-testacc")
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const defaultZones = alicloud.nas.getZones({
    fileSystemType: "cpfs",
});
const defaultNetworks = alicloud.vpc.getNetworks({
    nameRegex: "default-NODELETING",
});
const defaultSwitches = Promise.all([defaultNetworks, defaultZones]).then(([defaultNetworks, defaultZones]) => alicloud.vpc.getSwitches({
    vpcId: defaultNetworks.ids?[0],
    zoneId: defaultZones.zones?[0]?.zoneId,
}));
const defaultFileSystem = new alicloud.nas.FileSystem("defaultFileSystem", {
    protocolType: "cpfs",
    storageType: "advance_200",
    fileSystemType: "cpfs",
    capacity: 3600,
    description: "tf-testacc",
    zoneId: defaultZones.then(defaultZones => defaultZones.zones?[0]?.zoneId),
    vpcId: defaultNetworks.then(defaultNetworks => defaultNetworks.ids?[0]),
    vswitchId: defaultSwitches.then(defaultSwitches => defaultSwitches.ids?[0]),
});
const defaultFileset = new alicloud.nas.Fileset("defaultFileset", {
    fileSystemId: defaultFileSystem.id,
    fileSystemPath: "/example_path/",
    description: "tf-testacc",
});
resources:
  defaultFileSystem:
    type: alicloud:nas:FileSystem
    properties:
      protocolType: cpfs
      storageType: advance_200
      fileSystemType: cpfs
      capacity: 3600
      description: tf-testacc
      zoneId: ${defaultZones.zones[0].zoneId}
      vpcId: ${defaultNetworks.ids[0]}
      vswitchId: ${defaultSwitches.ids[0]}
  defaultFileset:
    type: alicloud:nas:Fileset
    properties:
      fileSystemId: ${defaultFileSystem.id}
      fileSystemPath: /example_path/
      description: tf-testacc
variables:
  defaultZones:
    Fn::Invoke:
      Function: alicloud:nas:getZones
      Arguments:
        fileSystemType: cpfs
  defaultNetworks:
    Fn::Invoke:
      Function: alicloud:vpc:getNetworks
      Arguments:
        nameRegex: default-NODELETING
  defaultSwitches:
    Fn::Invoke:
      Function: alicloud:vpc:getSwitches
      Arguments:
        vpcId: ${defaultNetworks.ids[0]}
        zoneId: ${defaultZones.zones[0].zoneId}

Create Fileset Resource

new Fileset(name: string, args: FilesetArgs, opts?: CustomResourceOptions);
@overload
def Fileset(resource_name: 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)
@overload
def Fileset(resource_name: str,
            args: FilesetArgs,
            opts: Optional[ResourceOptions] = 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.

name string
The unique name of the resource.
args FilesetArgs
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 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 string
The unique name of the resource.
args FilesetArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args FilesetArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args FilesetArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

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

The Fileset resource accepts the following input properties:

FileSystemId string

The ID of the file system.

FileSystemPath 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 string

The ID of the file system.

FileSystemPath 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 String

The ID of the file system.

fileSystemPath 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 string

The ID of the file system.

fileSystemPath 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 str

The ID of the file system.

file_system_path 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 String

The ID of the file system.

fileSystemPath 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)
Resource lookup is not supported in YAML
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:
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 string

The ID of the file system.

FileSystemPath 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 string

The ID of the file system.

FileSystemPath 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 String

The ID of the file system.

fileSystemPath 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 string

The ID of the file system.

fileSystemPath 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 str

The ID of the file system.

file_system_path 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 String

The ID of the file system.

fileSystemPath String

The path of the fileset.

filesetId String

The first ID of the resource.

status String

The status of the fileset.

Import

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

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

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.