alicloud_nas_file_system
更新时间:
Provides a Nas File System resource.
After activating NAS, you can create a file system and purchase a storage package for it in the NAS console. The NAS console also enables you to view the file system details and remove unnecessary file systems.
For information about NAS file system and how to use it, see Manage file systems
-> NOTE: Available in v1.33.0+.
Example Usage
Basic Usage
data "alicloud_nas_zones" "example" {
file_system_type = "standard"
}
resource "alicloud_nas_file_system" "foo" {
protocol_type = "NFS"
storage_type = "Performance"
description = "terraform-example"
encrypt_type = "1"
zone_id = data.alicloud_nas_zones.example.zones[0].zone_id
}
data "alicloud_nas_zones" "example" {
file_system_type = "extreme"
}
resource "alicloud_nas_file_system" "foo" {
file_system_type = "extreme"
protocol_type = "NFS"
zone_id = data.alicloud_nas_zones.example.zones[0].zone_id
storage_type = "standard"
capacity = "100"
}
provider "alicloud" {
region = "cn-zhangjiakou"
}
data "alicloud_nas_zones" "example" {
file_system_type = "cpfs"
}
resource "alicloud_vpc" "example" {
vpc_name = "terraform-example"
cidr_block = "172.17.3.0/24"
}
resource "alicloud_vswitch" "example" {
vswitch_name = "terraform-example"
cidr_block = "172.17.3.0/24"
vpc_id = alicloud_vpc.example.id
zone_id = data.alicloud_nas_zones.example.zones[1].zone_id
}
resource "alicloud_nas_file_system" "example" {
protocol_type = "cpfs"
storage_type = "advance_200"
file_system_type = "cpfs"
capacity = 3600
zone_id = data.alicloud_nas_zones.example.zones[1].zone_id
vpc_id = alicloud_vpc.example.id
vswitch_id = alicloud_vswitch.example.id
}
Argument Reference
The following arguments are supported:
file_system_type
- (Optional, Available in v1.140.0+) the type of the file system. Valid values:standard
(Default),extreme
,cpfs
.protocol_type
- (Required, ForceNew) The protocol type of the file system. Valid values:NFS
,SMB
(Available when thefile_system_type
isstandard
),cpfs
(Available when thefile_system_type
iscpfs
).storage_type
- (Required, ForceNew) The storage type of the file System.- Valid values:
Performance
(Available when thefile_system_type
isstandard
)Capacity
(Available when thefile_system_type
isstandard
)standard
(Available in v1.140.0+ and when thefile_system_type
isextreme
)advance
(Available in v1.140.0+ and when thefile_system_type
isextreme
)advance_100
(Available in v1.153.0+ and when thefile_system_type
iscpfs
)advance_200
(Available in v1.153.0+ and when thefile_system_type
iscpfs
)
- Valid values:
description
- (Optional) The File System description.encrypt_type
- (Optional, Available in v1.121.2+) Whether the file system is encrypted. Using kms service escrow key to encrypt and store the file system data. When reading and writing encrypted data, there is no need to decrypt.- Valid values:
0
(Default): The file system is not encrypted.1
: The file system is encrypted with a managed secret key.2
(Available in v1.140.0+ and when thefile_system_type
isextreme
): User management key.
- Valid values:
capacity
- (Optional, Available in v1.140.0+ and when thefile_system_type
isextreme
) The capacity of the file system. Thecapacity
is required when thefile_system_type
isextreme
. Unit: gib; Note: The minimum value is 100.zone_id
- (Optional, Available in v1.140.0+) The available zones information that supports nas.When FileSystemType=standard, this parameter is not required. Note: By default, a qualified availability zone is randomly selected according to theprotocol_type
andstorage_type
configuration.kms_key_id
- (Optional, Available in v1.140.0+ and when theencrypt_type
is2
) The id of the KMS key. Thekms_key_id
is required when theencrypt_type
is2
.vpc_id
- (Optional, Available in v1.153.0+) The id of the VPC. Thevpc_id
is required when thefile_system_type
iscpfs
.vswitch_id
- (Optional, Available in v1.153.0+) The id of the vSwitch. Thevswitch_id
is required when thefile_system_type
iscpfs
.tags
- (Optional, Available in v1.153.0+) A mapping of tags to assign to the resource.
Attributes Reference
The following attributes are exported:
id
- The ID of the File System.
Timeouts
The timeouts
block allows you to specify timeouts for certain actions:
create
- (Defaults to 10 mins) Used when create the File System.update
- (Defaults to 10 mins) Used when update the File System.delete
- (Defaults to 10 mins) Used when delete the File System.
Import
Nas File System can be imported using the id, e.g.
$ terraform import alicloud_nas_file_system.foo 1337849c59
文档内容是否对您有帮助?