文档

alicloud_nas_access_point

更新时间:
一键部署

Provides a NAS Access Point resource.

For information about NAS Access Point and how to use it, see What is Access Point.

-> NOTE: Available since v1.224.0.

Example Usage

Basic Usage


variable "name" {
  default = "terraform-example"
}

provider "alicloud" {
  region = "cn-hangzhou"
}

variable "region_id" {
  default = "cn-hangzhou"
}

variable "azone" {
  default = "cn-hangzhou-g"
}

data "alicloud_zones" "default" {
  available_resource_creation = "VSwitch"
}

resource "alicloud_vpc" "defaultkyVC70" {
  cidr_block  = "172.16.0.0/12"
  description = "接入点测试noRootDirectory"
}

resource "alicloud_vswitch" "defaultoZAPmO" {
  vpc_id     = alicloud_vpc.defaultkyVC70.id
  zone_id    = data.alicloud_zones.default.zones.0.id
  cidr_block = "172.16.0.0/24"
}

resource "alicloud_nas_access_group" "defaultBbc7ev" {
  access_group_type = "Vpc"
  access_group_name = var.name
  file_system_type  = "standard"
}

resource "alicloud_nas_file_system" "defaultVtUpDh" {
  storage_type     = "Performance"
  zone_id          = var.azone
  encrypt_type     = "0"
  protocol_type    = "NFS"
  file_system_type = "standard"
  description      = "AccessPointnoRootDirectory"
}


resource "alicloud_nas_access_point" "default" {
  vpc_id            = alicloud_vpc.defaultkyVC70.id
  access_group      = alicloud_nas_access_group.defaultBbc7ev.access_group_name
  vswitch_id        = alicloud_vswitch.defaultoZAPmO.id
  file_system_id    = alicloud_nas_file_system.defaultVtUpDh.id
  access_point_name = var.name
  posix_user {
    posix_group_id = "123"
    posix_user_id  = "123"
  }
  root_path_permission {
    owner_group_id = "1"
    owner_user_id  = "1"
    permission     = "0777"
  }
}

Argument Reference

The following arguments are supported:

  • access_group - (Required) The permission group name.
  • access_point_name - (Optional) The Access Point Name.
  • enabled_ram - (Optional) Whether to enable the RAM policy.
  • file_system_id - (Required, ForceNew) The ID of the file system.
  • posix_user - (Optional, ForceNew) The Posix user. See posix_user below.
  • root_path - (Optional, ForceNew) The root directory.
  • root_path_permission - (Optional, ForceNew) Root permissions. See root_path_permission below.
  • vswitch_id - (Required, ForceNew) The vSwitch ID.
  • vpc_id - (Required, ForceNew) The ID of the VPC.

posix_user

The posix_user supports the following:

  • posix_group_id - (Optional, ForceNew) The ID of the Posix user group.
  • posix_user_id - (Optional, ForceNew) The Posix user ID.

root_path_permission

The root_path_permission supports the following:

  • owner_group_id - (Optional, ForceNew) The ID of the primary user group.
  • owner_user_id - (Optional, ForceNew) The owner user ID.
  • permission - (Optional, ForceNew) POSIX permission.

Attributes Reference

The following attributes are exported:

  • id - The ID of the resource supplied above.The value is formulated as <file_system_id>:<access_point_id>.
  • access_point_id - Access point ID.
  • create_time - Creation time.
  • posix_user - The Posix user.
    • posix_secondary_group_ids - The ID of the second user group.
  • status - Current access point state.

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

  • create - (Defaults to 5 mins) Used when create the Access Point.
  • delete - (Defaults to 5 mins) Used when delete the Access Point.
  • update - (Defaults to 5 mins) Used when update the Access Point.

Import

NAS Access Point can be imported using the id, e.g.

$ terraform import alicloud_nas_access_point.example <file_system_id>:<access_point_id>