Provides a File Storage (NAS) Fileset resource.
Fileset of CPFS file system.
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/",
});
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/")
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
})
}
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/",
});
});
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.zones()[1].zoneId())
.build());
var exampleFileSystem = new FileSystem("exampleFileSystem", FileSystemArgs.builder()
.protocolType("cpfs")
.storageType("advance_200")
.fileSystemType("cpfs")
.capacity(3600)
.zoneId(example.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());
}
}
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
📚 Need more examples? VIEW MORE EXAMPLES
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,
deletion_protection: Optional[bool] = 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 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.
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",
DeletionProtection = false,
Description = "string",
DryRun = false,
});
example, err := nas.NewFileset(ctx, "filesetResource", &nas.FilesetArgs{
FileSystemId: pulumi.String("string"),
FileSystemPath: pulumi.String("string"),
DeletionProtection: pulumi.Bool(false),
Description: pulumi.String("string"),
DryRun: pulumi.Bool(false),
})
var filesetResource = new Fileset("filesetResource", FilesetArgs.builder()
.fileSystemId("string")
.fileSystemPath("string")
.deletionProtection(false)
.description("string")
.dryRun(false)
.build());
fileset_resource = alicloud.nas.Fileset("filesetResource",
file_system_id="string",
file_system_path="string",
deletion_protection=False,
description="string",
dry_run=False)
const filesetResource = new alicloud.nas.Fileset("filesetResource", {
fileSystemId: "string",
fileSystemPath: "string",
deletionProtection: false,
description: "string",
dryRun: false,
});
type: alicloud:nas:Fileset
properties:
deletionProtection: false
description: string
dryRun: false
fileSystemId: string
fileSystemPath: string
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:
- File
System stringId - The ID of the file system.
- File
System stringPath - The path of Fileset.
- Deletion
Protection bool - The instance release protection attribute, which specifies whether the instance can be released through the console or API( DeleteFileset).
- true: Enable instance release protection.
- false (default): Turn off instance release protection
- Description string
- Description of Fileset.
- Dry
Run bool - Specifies whether to perform a dry run. Default value:
false. Valid values:true,false.
- File
System stringId - The ID of the file system.
- File
System stringPath - The path of Fileset.
- Deletion
Protection bool - The instance release protection attribute, which specifies whether the instance can be released through the console or API( DeleteFileset).
- true: Enable instance release protection.
- false (default): Turn off instance release protection
- Description string
- Description of Fileset.
- Dry
Run bool - Specifies whether to perform a dry run. Default value:
false. Valid values:true,false.
- file
System StringId - The ID of the file system.
- file
System StringPath - The path of Fileset.
- deletion
Protection Boolean - The instance release protection attribute, which specifies whether the instance can be released through the console or API( DeleteFileset).
- true: Enable instance release protection.
- false (default): Turn off instance release protection
- description String
- Description of Fileset.
- dry
Run Boolean - Specifies whether to perform a dry run. Default value:
false. Valid values:true,false.
- file
System stringId - The ID of the file system.
- file
System stringPath - The path of Fileset.
- deletion
Protection boolean - The instance release protection attribute, which specifies whether the instance can be released through the console or API( DeleteFileset).
- true: Enable instance release protection.
- false (default): Turn off instance release protection
- description string
- Description of Fileset.
- dry
Run boolean - Specifies whether to perform a dry run. Default value:
false. Valid values:true,false.
- file_
system_ strid - The ID of the file system.
- file_
system_ strpath - The path of Fileset.
- deletion_
protection bool - The instance release protection attribute, which specifies whether the instance can be released through the console or API( DeleteFileset).
- true: Enable instance release protection.
- false (default): Turn off instance release protection
- description str
- Description of Fileset.
- dry_
run bool - Specifies whether to perform a dry run. Default value:
false. Valid values:true,false.
- file
System StringId - The ID of the file system.
- file
System StringPath - The path of Fileset.
- deletion
Protection Boolean - The instance release protection attribute, which specifies whether the instance can be released through the console or API( DeleteFileset).
- true: Enable instance release protection.
- false (default): Turn off instance release protection
- description String
- Description of Fileset.
- dry
Run Boolean - Specifies whether to perform a dry run. Default value:
false. Valid values:true,false.
Outputs
All input properties are implicitly available as output properties. Additionally, the Fileset resource produces the following output properties:
- Create
Time string - The time when Fileset was created.
- Fileset
Id string - Fileset ID
- Id string
- The provider-assigned unique ID for this managed resource.
- Status string
- The status of Fileset. Includes:
- Create
Time string - The time when Fileset was created.
- Fileset
Id string - Fileset ID
- Id string
- The provider-assigned unique ID for this managed resource.
- Status string
- The status of Fileset. Includes:
- create
Time String - The time when Fileset was created.
- fileset
Id String - Fileset ID
- id String
- The provider-assigned unique ID for this managed resource.
- status String
- The status of Fileset. Includes:
- create
Time string - The time when Fileset was created.
- fileset
Id string - Fileset ID
- id string
- The provider-assigned unique ID for this managed resource.
- status string
- The status of Fileset. Includes:
- create_
time str - The time when Fileset was created.
- fileset_
id str - Fileset ID
- id str
- The provider-assigned unique ID for this managed resource.
- status str
- The status of Fileset. Includes:
- create
Time String - The time when Fileset was created.
- fileset
Id String - Fileset ID
- id String
- The provider-assigned unique ID for this managed resource.
- status String
- The status of Fileset. Includes:
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,
create_time: Optional[str] = None,
deletion_protection: Optional[bool] = 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) -> Filesetfunc 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
- 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.
- Create
Time string - The time when Fileset was created.
- Deletion
Protection bool - The instance release protection attribute, which specifies whether the instance can be released through the console or API( DeleteFileset).
- true: Enable instance release protection.
- false (default): Turn off instance release protection
- Description string
- Description of Fileset.
- Dry
Run bool - Specifies whether to perform a dry run. Default value:
false. Valid values:true,false. - File
System stringId - The ID of the file system.
- File
System stringPath - The path of Fileset.
- Fileset
Id string - Fileset ID
- Status string
- The status of Fileset. Includes:
- Create
Time string - The time when Fileset was created.
- Deletion
Protection bool - The instance release protection attribute, which specifies whether the instance can be released through the console or API( DeleteFileset).
- true: Enable instance release protection.
- false (default): Turn off instance release protection
- Description string
- Description of Fileset.
- Dry
Run bool - Specifies whether to perform a dry run. Default value:
false. Valid values:true,false. - File
System stringId - The ID of the file system.
- File
System stringPath - The path of Fileset.
- Fileset
Id string - Fileset ID
- Status string
- The status of Fileset. Includes:
- create
Time String - The time when Fileset was created.
- deletion
Protection Boolean - The instance release protection attribute, which specifies whether the instance can be released through the console or API( DeleteFileset).
- true: Enable instance release protection.
- false (default): Turn off instance release protection
- description String
- Description of Fileset.
- dry
Run Boolean - Specifies whether to perform a dry run. Default value:
false. Valid values:true,false. - file
System StringId - The ID of the file system.
- file
System StringPath - The path of Fileset.
- fileset
Id String - Fileset ID
- status String
- The status of Fileset. Includes:
- create
Time string - The time when Fileset was created.
- deletion
Protection boolean - The instance release protection attribute, which specifies whether the instance can be released through the console or API( DeleteFileset).
- true: Enable instance release protection.
- false (default): Turn off instance release protection
- description string
- Description of Fileset.
- dry
Run boolean - Specifies whether to perform a dry run. Default value:
false. Valid values:true,false. - file
System stringId - The ID of the file system.
- file
System stringPath - The path of Fileset.
- fileset
Id string - Fileset ID
- status string
- The status of Fileset. Includes:
- create_
time str - The time when Fileset was created.
- deletion_
protection bool - The instance release protection attribute, which specifies whether the instance can be released through the console or API( DeleteFileset).
- true: Enable instance release protection.
- false (default): Turn off instance release protection
- description str
- Description of Fileset.
- dry_
run bool - Specifies whether to perform a dry run. Default value:
false. Valid values:true,false. - file_
system_ strid - The ID of the file system.
- file_
system_ strpath - The path of Fileset.
- fileset_
id str - Fileset ID
- status str
- The status of Fileset. Includes:
- create
Time String - The time when Fileset was created.
- deletion
Protection Boolean - The instance release protection attribute, which specifies whether the instance can be released through the console or API( DeleteFileset).
- true: Enable instance release protection.
- false (default): Turn off instance release protection
- description String
- Description of Fileset.
- dry
Run Boolean - Specifies whether to perform a dry run. Default value:
false. Valid values:true,false. - file
System StringId - The ID of the file system.
- file
System StringPath - The path of Fileset.
- fileset
Id String - Fileset ID
- status String
- The status of Fileset. Includes:
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>
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
alicloudTerraform Provider.
