alicloud.nas.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 System.Collections.Generic;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var defaultZones = AliCloud.Nas.GetZones.Invoke(new()
{
FileSystemType = "cpfs",
});
var defaultNetworks = AliCloud.Vpc.GetNetworks.Invoke(new()
{
NameRegex = "default-NODELETING",
});
var defaultSwitches = AliCloud.Vpc.GetSwitches.Invoke(new()
{
VpcId = defaultNetworks.Apply(getNetworksResult => getNetworksResult.Ids[0]),
ZoneId = defaultZones.Apply(getZonesResult => getZonesResult.Zones[0]?.ZoneId),
});
var defaultFileSystem = new AliCloud.Nas.FileSystem("defaultFileSystem", new()
{
ProtocolType = "cpfs",
StorageType = "advance_200",
FileSystemType = "cpfs",
Capacity = 3600,
Description = "tf-testacc",
ZoneId = defaultZones.Apply(getZonesResult => getZonesResult.Zones[0]?.ZoneId),
VpcId = defaultNetworks.Apply(getNetworksResult => getNetworksResult.Ids[0]),
VswitchId = defaultSwitches.Apply(getSwitchesResult => getSwitchesResult.Ids[0]),
});
var defaultFileset = new AliCloud.Nas.Fileset("defaultFileset", new()
{
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.nas.inputs.GetZonesArgs;
import com.pulumi.alicloud.vpc.VpcFunctions;
import com.pulumi.alicloud.vpc.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:
- File
System stringId The ID of the file system.
- File
System stringPath The path of the fileset.
- Description string
The description of the Fileset. It must be
2
to128
characters in length and must start with a letter or Chinese, but cannot start withhttps://
orhttps://
.- Dry
Run bool The dry run.
- File
System stringId The ID of the file system.
- File
System stringPath The path of the fileset.
- Description string
The description of the Fileset. It must be
2
to128
characters in length and must start with a letter or Chinese, but cannot start withhttps://
orhttps://
.- Dry
Run bool The dry run.
- file
System StringId The ID of the file system.
- file
System StringPath The path of the fileset.
- description String
The description of the Fileset. It must be
2
to128
characters in length and must start with a letter or Chinese, but cannot start withhttps://
orhttps://
.- dry
Run Boolean The dry run.
- file
System stringId The ID of the file system.
- file
System stringPath The path of the fileset.
- description string
The description of the Fileset. It must be
2
to128
characters in length and must start with a letter or Chinese, but cannot start withhttps://
orhttps://
.- dry
Run boolean The dry run.
- file_
system_ strid The ID of the file system.
- file_
system_ strpath The path of the fileset.
- description str
The description of the Fileset. It must be
2
to128
characters in length and must start with a letter or Chinese, but cannot start withhttps://
orhttps://
.- dry_
run bool The dry run.
- file
System StringId The ID of the file system.
- file
System StringPath The path of the fileset.
- description String
The description of the Fileset. It must be
2
to128
characters in length and must start with a letter or Chinese, but cannot start withhttps://
orhttps://
.- dry
Run Boolean The dry run.
Outputs
All input properties are implicitly available as output properties. Additionally, the Fileset resource produces the following output properties:
- 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.
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.
- Description string
The description of the Fileset. It must be
2
to128
characters in length and must start with a letter or Chinese, but cannot start withhttps://
orhttps://
.- Dry
Run bool The dry run.
- File
System stringId The ID of the file system.
- File
System stringPath The path of the fileset.
- Fileset
Id 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
to128
characters in length and must start with a letter or Chinese, but cannot start withhttps://
orhttps://
.- Dry
Run bool The dry run.
- File
System stringId The ID of the file system.
- File
System stringPath The path of the fileset.
- Fileset
Id 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
to128
characters in length and must start with a letter or Chinese, but cannot start withhttps://
orhttps://
.- dry
Run Boolean The dry run.
- file
System StringId The ID of the file system.
- file
System StringPath The path of the fileset.
- fileset
Id 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
to128
characters in length and must start with a letter or Chinese, but cannot start withhttps://
orhttps://
.- dry
Run boolean The dry run.
- file
System stringId The ID of the file system.
- file
System stringPath The path of the fileset.
- fileset
Id 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
to128
characters in length and must start with a letter or Chinese, but cannot start withhttps://
orhttps://
.- dry_
run bool The dry run.
- file_
system_ strid The ID of the file system.
- file_
system_ strpath 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
to128
characters in length and must start with a letter or Chinese, but cannot start withhttps://
orhttps://
.- dry
Run Boolean The dry run.
- file
System StringId The ID of the file system.
- file
System StringPath The path of the fileset.
- fileset
Id 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
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
alicloud
Terraform Provider.