powerscale_nfs_export (Resource)

This resource is used to manage the NFS export entity of PowerScale Array. PowerScale provides an NFS server so you can share files on your cluster. We can Create, Update and Delete the NFS export using this resource. We can also import an existing NFS export from PowerScale array.

Example Usage

/*
Copyright (c) 2023 Dell Inc., or its subsidiaries. All Rights Reserved.

Licensed under the Mozilla Public License Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://mozilla.org/MPL/2.0/


Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

# Available actions: Create, Update, Delete and Import
# After `terraform apply` of this example file it will create NFS export on specified paths on the PowerScale

# PowerScale provides an NFS server so you can share files on your cluster
resource "powerscale_nfs_export" "example_export" {
  # Required path for creating
  paths = ["/ifs/example_export"]

  # Computed identifier for export
  # id = 1

  # Optional parameter when creating
  # ignore_bad_auth = true
  # ignore_bad_paths= true
  # ignore_conflicts = true
  # ignore_unresolvable_hosts = true
  # zone = "System"

  # Optional parameter when creating and updating. Will ignore the conflict when set true
  # force = true

  # Optional query. Will return the information according to scope
  # scope = "default"

  # Computed attributes, can be updated
  # all_dirs = false
  # block_size = 8192
  # can_set_time = true
  # case_insensitive = true
  # case_preserving = false
  # chown_restricted = false
  # clients = ["client1"]
  # commit_asynchronous = false
  # conflicting_paths = ["/ifs/conflicting_path"]
  # description = "Example path"
  # directory_transfer_size = 131072
  # encoding = "DEFAULT"
  # link_max = 32767
  # map_all = {
  #   enabled = false,
  #   primary_group = {
  #       id = "GROUP:nobody"
  #   }
  #   secondary_groups = [
  #     {
  #       id   = "GROUP:Users"
  #     }
  #   ]
  #   user = {
  #       id = "USER:nobody"
  #   }
  # }
  # map_failure = {}
  # map_full = true
  # map_lookup_uid = false
  # map_non_root = {}
  # map_retry = true
  # map_root = {}
  # max_file_size = 9223372036854775807
  # name_max_size = 255
  # no_truncate = false
  # read_only = false
  # read_only_clients = []
  # read_transfer_max_size = 1048576
  # read_transfer_multiple = 4194304
  # read_transfer_size = 131072
  # read_write_clients = []
  # readdirplus = true
  # readdirplus_prefetch = 10
  # return_32bit_file_ids = false
  # root_clients = []
  # security_flavors = ["unix"]
  # setattr_asynchronous = false
  # snapshot = "-"
  # symlinks = true
  # time_delta = 0.0000000009999999717180685
  # unresolved_clients = []
  # write_datasync_action = "DATASYNC"
  # write_datasync_reply = "DATASYNC"
  # write_filesync_action = "FILESYNC"
  # write_filesync_reply = "FILESYNC"
  # write_transfer_max_size = 1048576
  # write_transfer_multiple = 512
  # write_transfer_size = 524288
  # write_unstable_action = "UNSTABLE"
  # write_unstable_reply = "UNSTABLE"
}

# After the execution of above resource block, an NFS export would have been created on the PowerScale array.
# For more information, Please check the terraform state file.

Schema

Required

  • paths (List of String) Specifies the paths under /ifs that are exported.

Optional

  • all_dirs (Boolean) True if all directories under the specified paths are mountable.
  • block_size (Number) Specifies the block size returned by the NFS statfs procedure.
  • can_set_time (Boolean) True if the client can set file times through the NFS set attribute request. This parameter does not affect server behavior, but is included to accommodate legacy client requirements.
  • case_insensitive (Boolean) True if the case is ignored for file names. This parameter does not affect server behavior, but is included to accommodate legacy client requirements.
  • case_preserving (Boolean) True if the case is preserved for file names. This parameter does not affect server behavior, but is included to accommodate legacy client requirements.
  • chown_restricted (Boolean) True if the superuser can change file ownership. This parameter does not affect server behavior, but is included to accommodate legacy client requirements.
  • clients (List of String) Specifies the clients with root access to the export.
  • commit_asynchronous (Boolean) True if NFS commit requests execute asynchronously.
  • conflicting_paths (List of String) Reports the paths that conflict with another export.
  • description (String) Specifies the user-defined string that is used to identify the export.
  • directory_transfer_size (Number) Specifies the preferred size for directory read operations. This value is used to advise the client of optimal settings for the server, but is not enforced.
  • encoding (String) Specifies the default character set encoding of the clients connecting to the export, unless otherwise specified.
  • force (Boolean) If true, the export will be created even if it conflicts with another export.
  • ignore_bad_auth (Boolean) Ignore invalid users.
  • ignore_bad_paths (Boolean) Ignore nonexistent or otherwise bad paths.
  • ignore_conflicts (Boolean) Ignore conflicts with existing exports.
  • ignore_unresolvable_hosts (Boolean) Ignore unresolvable hosts.
  • link_max (Number) Specifies the reported maximum number of links to a file. This parameter does not affect server behavior, but is included to accommodate legacy client requirements.
  • map_all (Attributes) Specifies the users and groups to which non-root and root clients are mapped. (see below for nested schema)
  • map_failure (Attributes) Specifies the users and groups to which non-root and root clients are mapped. (see below for nested schema)
  • map_full (Boolean) True if user mappings query the OneFS user database. When set to false, user mappings only query local authentication.
  • map_lookup_uid (Boolean) True if incoming user IDs (UIDs) are mapped to users in the OneFS user database. When set to false, incoming UIDs are applied directly to file operations.
  • map_non_root (Attributes) Specifies the users and groups to which non-root and root clients are mapped. (see below for nested schema)
  • map_retry (Boolean) Determines whether searches for users specified in ‘map_all’, ‘map_root’ or ‘map_nonroot’ are retried if the search fails.
  • map_root (Attributes) Specifies the users and groups to which non-root and root clients are mapped. (see below for nested schema)
  • max_file_size (Number) Specifies the maximum file size for any file accessed from the export. This parameter does not affect server behavior, but is included to accommodate legacy client requirements.
  • name_max_size (Number) Specifies the reported maximum length of a file name. This parameter does not affect server behavior, but is included to accommodate legacy client requirements.
  • no_truncate (Boolean) True if long file names result in an error. This parameter does not affect server behavior, but is included to accommodate legacy client requirements.
  • read_only (Boolean) True if the export is set to read-only.
  • read_only_clients (List of String) Specifies the clients with read-only access to the export.
  • read_transfer_max_size (Number) Specifies the maximum buffer size that clients should use on NFS read requests. This value is used to advise the client of optimal settings for the server, but is not enforced.
  • read_transfer_multiple (Number) Specifies the preferred multiple size for NFS read requests. This value is used to advise the client of optimal settings for the server, but is not enforced.
  • read_transfer_size (Number) Specifies the preferred size for NFS read requests. This value is used to advise the client of optimal settings for the server, but is not enforced.
  • read_write_clients (List of String) Specifies the clients with both read and write access to the export, even when the export is set to read-only.
  • readdirplus (Boolean) True if ‘readdirplus’ requests are enabled. Enabling this property might improve network performance and is only available for NFSv3.
  • readdirplus_prefetch (Number) Sets the number of directory entries that are prefetched when a ‘readdirplus’ request is processed. (Deprecated.)
  • return_32bit_file_ids (Boolean) Limits the size of file identifiers returned by NFSv3+ to 32-bit values (may require remount).
  • root_clients (List of String) Clients that have root access to the export.
  • scope (String) When specified as ’effective’, or not specified, all fields are returned. When specified as ‘user’, only fields with non-default values are shown. When specified as ‘default’, the original values are returned.
  • security_flavors (List of String) Specifies the authentication types that are supported for this export.
  • setattr_asynchronous (Boolean) True if set attribute operations execute asynchronously.
  • snapshot (String) Specifies the snapshot for all mounts.
  • symlinks (Boolean) True if symlinks are supported. This value is used to advise the client of optimal settings for the server, but is not enforced.
  • time_delta (Number) Specifies the resolution of all time values that are returned to the clients
  • unresolved_clients (List of String) Reports clients that cannot be resolved.
  • write_datasync_action (String) Specifies the action to be taken when an NFSv3+ datasync write is requested.
  • write_datasync_reply (String) Specifies the stability disposition returned when an NFSv3+ datasync write is processed.
  • write_filesync_action (String) Specifies the action to be taken when an NFSv3+ filesync write is requested.
  • write_filesync_reply (String) Specifies the stability disposition returned when an NFSv3+ filesync write is processed.
  • write_transfer_max_size (Number) Specifies the maximum buffer size that clients should use on NFS write requests. This value is used to advise the client of optimal settings for the server, but is not enforced.
  • write_transfer_multiple (Number) Specifies the preferred multiple size for NFS write requests. This value is used to advise the client of optimal settings for the server, but is not enforced.
  • write_transfer_size (Number) Specifies the preferred multiple size for NFS write requests. This value is used to advise the client of optimal settings for the server, but is not enforced.
  • write_unstable_action (String) Specifies the action to be taken when an NFSv3+ unstable write is requested.
  • write_unstable_reply (String) Specifies the stability disposition returned when an NFSv3+ unstable write is processed.
  • zone (String) Specifies the zone in which the export is valid. Cannot be changed once set

Read-Only

  • id (Number) Specifies the system-assigned ID for the export. This ID is returned when an export is created through the POST method.

Nested Schema for map_all

Optional:

  • enabled (Boolean) True if the user mapping is applied.
  • primary_group (Attributes) Specifies the persona of the file group. (see below for nested schema)
  • secondary_groups (Attributes List) Specifies persona properties for the secondary user group. A persona consists of either a type and name, or an ID. (see below for nested schema)
  • user (Attributes) Specifies the persona of the file group. (see below for nested schema)

Nested Schema for map_all.primary_group

Optional:

  • id (String) Specifies the serialized form of a persona, which can be ‘UID:0’, ‘USER:name’, ‘GID:0’, ‘GROUP:wheel’, or ‘SID:S-1-1’.
  • name (String) Specifies the persona name, which must be combined with a type.
  • type (String) Specifies the type of persona, which must be combined with a name.

Nested Schema for map_all.secondary_groups

Optional:

  • id (String) Specifies the serialized form of a persona, which can be ‘UID:0’, ‘USER:name’, ‘GID:0’, ‘GROUP:wheel’, or ‘SID:S-1-1’.
  • name (String) Specifies the persona name, which must be combined with a type.
  • type (String) Specifies the type of persona, which must be combined with a name.

Nested Schema for map_all.user

Optional:

  • id (String) Specifies the serialized form of a persona, which can be ‘UID:0’, ‘USER:name’, ‘GID:0’, ‘GROUP:wheel’, or ‘SID:S-1-1’.
  • name (String) Specifies the persona name, which must be combined with a type.
  • type (String) Specifies the type of persona, which must be combined with a name.

Nested Schema for map_failure

Optional:

  • enabled (Boolean) True if the user mapping is applied.
  • primary_group (Attributes) Specifies the persona of the file group. (see below for nested schema)
  • secondary_groups (Attributes List) Specifies persona properties for the secondary user group. A persona consists of either a type and name, or an ID. (see below for nested schema)
  • user (Attributes) Specifies the persona of the file group. (see below for nested schema)

Nested Schema for map_failure.primary_group

Optional:

  • id (String) Specifies the serialized form of a persona, which can be ‘UID:0’, ‘USER:name’, ‘GID:0’, ‘GROUP:wheel’, or ‘SID:S-1-1’.
  • name (String) Specifies the persona name, which must be combined with a type.
  • type (String) Specifies the type of persona, which must be combined with a name.

Nested Schema for map_failure.secondary_groups

Optional:

  • id (String) Specifies the serialized form of a persona, which can be ‘UID:0’, ‘USER:name’, ‘GID:0’, ‘GROUP:wheel’, or ‘SID:S-1-1’.
  • name (String) Specifies the persona name, which must be combined with a type.
  • type (String) Specifies the type of persona, which must be combined with a name.

Nested Schema for map_failure.user

Optional:

  • id (String) Specifies the serialized form of a persona, which can be ‘UID:0’, ‘USER:name’, ‘GID:0’, ‘GROUP:wheel’, or ‘SID:S-1-1’.
  • name (String) Specifies the persona name, which must be combined with a type.
  • type (String) Specifies the type of persona, which must be combined with a name.

Nested Schema for map_non_root

Optional:

  • enabled (Boolean) True if the user mapping is applied.
  • primary_group (Attributes) Specifies the persona of the file group. (see below for nested schema)
  • secondary_groups (Attributes List) Specifies persona properties for the secondary user group. A persona consists of either a type and name, or an ID. (see below for nested schema)
  • user (Attributes) Specifies the persona of the file group. (see below for nested schema)

Nested Schema for map_non_root.primary_group

Optional:

  • id (String) Specifies the serialized form of a persona, which can be ‘UID:0’, ‘USER:name’, ‘GID:0’, ‘GROUP:wheel’, or ‘SID:S-1-1’.
  • name (String) Specifies the persona name, which must be combined with a type.
  • type (String) Specifies the type of persona, which must be combined with a name.

Nested Schema for map_non_root.secondary_groups

Optional:

  • id (String) Specifies the serialized form of a persona, which can be ‘UID:0’, ‘USER:name’, ‘GID:0’, ‘GROUP:wheel’, or ‘SID:S-1-1’.
  • name (String) Specifies the persona name, which must be combined with a type.
  • type (String) Specifies the type of persona, which must be combined with a name.

Nested Schema for map_non_root.user

Optional:

  • id (String) Specifies the serialized form of a persona, which can be ‘UID:0’, ‘USER:name’, ‘GID:0’, ‘GROUP:wheel’, or ‘SID:S-1-1’.
  • name (String) Specifies the persona name, which must be combined with a type.
  • type (String) Specifies the type of persona, which must be combined with a name.

Nested Schema for map_root

Optional:

  • enabled (Boolean) True if the user mapping is applied.
  • primary_group (Attributes) Specifies the persona of the file group. (see below for nested schema)
  • secondary_groups (Attributes List) Specifies persona properties for the secondary user group. A persona consists of either a type and name, or an ID. (see below for nested schema)
  • user (Attributes) Specifies the persona of the file group. (see below for nested schema)

Nested Schema for map_root.primary_group

Optional:

  • id (String) Specifies the serialized form of a persona, which can be ‘UID:0’, ‘USER:name’, ‘GID:0’, ‘GROUP:wheel’, or ‘SID:S-1-1’.
  • name (String) Specifies the persona name, which must be combined with a type.
  • type (String) Specifies the type of persona, which must be combined with a name.

Nested Schema for map_root.secondary_groups

Optional:

  • id (String) Specifies the serialized form of a persona, which can be ‘UID:0’, ‘USER:name’, ‘GID:0’, ‘GROUP:wheel’, or ‘SID:S-1-1’.
  • name (String) Specifies the persona name, which must be combined with a type.
  • type (String) Specifies the type of persona, which must be combined with a name.

Nested Schema for map_root.user

Optional:

  • id (String) Specifies the serialized form of a persona, which can be ‘UID:0’, ‘USER:name’, ‘GID:0’, ‘GROUP:wheel’, or ‘SID:S-1-1’.
  • name (String) Specifies the persona name, which must be combined with a type.
  • type (String) Specifies the type of persona, which must be combined with a name.

Import

Import is supported using the following syntax:

# Copyright (c) 2023 Dell Inc., or its subsidiaries. All Rights Reserved.

# Licensed under the Mozilla Public License Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at

#     http://mozilla.org/MPL/2.0/


# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# The command is
# terraform import powerscale_nfs_export.example_export [<zoneID>]:<name>
# Example 1:  <zoneID> is Optional, defaults to System:
terraform import powerscale_nfs_export.example_export example_export
# Example 2:
terraform import powerscale_nfs_export.example_export zone_id:example_export
# after running this command, populate the name field and other required parameters in the config file to start managing this resource.
# Note: running "terraform show" after importing shows the current config/state of the resource. You can copy/paste that config to make it easier to manage the resource.