powerscale_smb_share (Resource)

This resource is used to manage the SMB share entity on PowerScale array. PowerScale SMB shares provide clients network access to file system resources on the cluster. We can Create, Update and Delete the SMB share using this resource. We can also import an existing SMB Share from PowerScale array.

Example Usage

/*
Copyright (c) 2023-2024 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 Array.
# For more information, Please check the terraform state file.

# PowerScale SMB shares provide clients network access to file system resources on the cluster
resource "powerscale_smb_share" "share_example" {
  # Required information for creating
  name = "smb_share_example"
  path = "/ifs/smb_share_example"
  permissions = [
    {
      permission      = "full"
      permission_type = "allow"
      trustee = {
        id   = "SID:S-1-1-0",
        name = "Everyone",
        type = "wellknown"
      }
    }
  ]

  # Zone is optional while creating and updating
  # zone = "System"

  # Optional attributes, can be updated
  # access_based_enumeration = false
  # access_based_enumeration_root_only = false
  # allow_delete_readonly = false
  # allow_execute_always = false
  # allow_variable_expansion = false
  # auto_create_directory = true
  # browsable = true
  # ca_timeout = 120
  # ca_write_integrity = "write-read-coherent"
  # change_notify = "norecurse"
  # create_path = false
  # create_permissions = "default acl"
  # csc_policy = "manual"
  # description = "description"
  # directory_create_mask = 448
  # directory_create_mode = 0
  # file_create_mask = 448
  # file_create_mode = 64
  # file_filter_extensions = ["ext"]
  # file_filter_type = "deny"
  # file_filtering_enabled = false
  # hide_dot_files = false
  # host_acl = ["example_host"]
  # impersonate_guest = "never"
  # impersonate_user = ""
  # inheritable_path_acl = false
  # mangle_byte_start = 60672
  # mangle_map = ["0x22:-1"]
  # ntfs_acl_support = true
  # oplocks = true
  # run_as_root = [{
  #   id   = "SID:S-1-1-0",
  #   name = "Everyone",
  #   type = "wellknown"
  # }]
  # smb3_encryption_enabled = false
  # sparse_file = false
  # strict_ca_lockout = true
  # strict_flush = true
  # strict_locking = false

  # zid should be computed according to zone
  # zid = 1
}

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

Schema

Required

  • name (String) Share name.
  • path (String) Path of share within /ifs.
  • permissions (Attributes List) Specifies an ordered list of permission modifications. (see below for nested schema)

Optional

  • access_based_enumeration (Boolean) Only enumerate files and folders the requesting user has access to.
  • access_based_enumeration_root_only (Boolean) Access-based enumeration on only the root directory of the share.
  • allow_delete_readonly (Boolean) Allow deletion of read-only files in the share.
  • allow_execute_always (Boolean) Allows users to execute files they have read rights for.
  • allow_variable_expansion (Boolean) Allow automatic expansion of variables for home directories.
  • auto_create_directory (Boolean) Automatically create home directories.
  • browsable (Boolean) Share is visible in net view and the browse list.
  • ca_timeout (Number) Persistent open timeout for the share.
  • ca_write_integrity (String) Specify the level of write-integrity on continuously available shares.
  • change_notify (String) Level of change notification alerts on the share.
  • create_path (Boolean) Create path if does not exist.
  • create_permissions (String) Create permissions for new files and directories in share.
  • csc_policy (String) Client-side caching policy for the shares.
  • description (String) Description for this SMB share.
  • directory_create_mask (Number) Directory create mask bits.
  • directory_create_mode (Number) Directory create mode bits.
  • file_create_mask (Number) File create mask bits.
  • file_create_mode (Number) File create mode bits.
  • file_filter_extensions (List of String) Specifies the list of file extensions.
  • file_filter_type (String) Specifies if filter list is for deny or allow. Default is deny.
  • file_filtering_enabled (Boolean) Enables file filtering on this zone.
  • hide_dot_files (Boolean) Hide files and directories that begin with a period ‘.’.
  • host_acl (List of String) An ACL expressing which hosts are allowed access. A deny clause must be the final entry.
  • impersonate_guest (String) Specify the condition in which user access is done as the guest account.
  • impersonate_user (String) User account to be used as guest account.
  • inheritable_path_acl (Boolean) Set the inheritable ACL on the share path.
  • mangle_byte_start (Number) Specifies the wchar_t starting point for automatic byte mangling.
  • mangle_map (List of String) Character mangle map.
  • ntfs_acl_support (Boolean) Support NTFS ACLs on files and directories.
  • oplocks (Boolean) Support oplocks.
  • run_as_root (Attributes List) Allow account to run as root. (see below for nested schema)
  • smb3_encryption_enabled (Boolean) Enables SMB3 encryption for the share.
  • sparse_file (Boolean) Enables sparse file.
  • strict_ca_lockout (Boolean) Specifies if persistent opens would do strict lockout on the share.
  • strict_flush (Boolean) Handle SMB flush operations.
  • strict_locking (Boolean) Specifies whether byte range locks contend against SMB I/O.
  • zone (String) Name of the access zone to which to move this SMB share.

Read-Only

  • continuously_available (Boolean) Specify if persistent opens are allowed on the share.
  • id (String) The ID of the smb share.
  • zid (Number) Numeric ID of the access zone which contains this SMB share.

Nested Schema for permissions

Required:

  • permission (String) Specifies the file system rights that are allowed or denied.
  • permission_type (String) Determines whether the permission is allowed or denied.
  • trustee (Attributes) Specifies the persona of the file group. (see below for nested schema)

Nested Schema for permissions.trustee

Optional:

  • id (String) Specifies the serialized form of a persona using security identifier, which can be ‘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 run_as_root

Optional:

  • id (String) Specifies the serialized form of a persona using security identifier, which can be ‘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-2024 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_smb_share.share_example [<zoneID>]:<name>
# Example 1: <zoneID> is Optional, defaults to System:
terraform import powerscale_smb_share.share_example example_share
# Example 2:
terraform import powerscale_smb_share.share_example zone_id:example_share
# 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.