Menu
AWS Storage Gateway Service
API Reference (API Version 2013-06-30)

CreateNFSFileShare

Creates a file share on an existing file gateway. In Storage Gateway, a file share is a file system mount point backed by Amazon S3 cloud storage. Storage Gateway exposes file shares using a Network File System (NFS) interface. This operation is only supported in the file gateway type.

Important

File gateway requires AWS Security Token Service (AWS STS) to be activated to enable you create a file share. Make sure AWS STS is activated in the region you are creating your file gateway in. If AWS STS is not activated in the region, activate it. For information about how to activate AWS STS, see Activating and Deactivating AWS STS in an AWS Region in the AWS Identity and Access Management User Guide.

File gateway does not support creating hard or symbolic links on a file share.

Request Syntax

{
   "ClientList": [ "string" ],
   "ClientToken": "string",
   "DefaultStorageClass": "string",
   "GatewayARN": "string",
   "GuessMIMETypeEnabled": boolean,
   "KMSEncrypted": boolean,
   "KMSKey": "string",
   "LocationARN": "string",
   "NFSFileShareDefaults": { 
      "DirectoryMode": "string",
      "FileMode": "string",
      "GroupId": number,
      "OwnerId": number
   },
   "ReadOnly": boolean,
   "Role": "string",
   "Squash": "string"
}

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

ClientList

The list of clients that are allowed to access the file gateway. The list must contain either valid IP addresses or valid CIDR blocks.

Type: Array of strings

Array Members: Minimum number of 1 item. Maximum number of 100 items.

Pattern: ^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))?$

Required: No

ClientToken

A unique string value that you supply that is used by file gateway to ensure idempotent file share creation.

Type: String

Length Constraints: Minimum length of 5. Maximum length of 100.

Required: Yes

DefaultStorageClass

The default storage class for objects put into an Amazon S3 bucket by file gateway. Possible values are S3_STANDARD or S3_STANDARD_IA. If this field is not populated, the default value S3_STANDARD is used. Optional.

Type: String

Length Constraints: Minimum length of 5. Maximum length of 20.

Required: No

GatewayARN

The Amazon Resource Name (ARN) of the file gateway on which you want to create a file share.

Type: String

Length Constraints: Minimum length of 50. Maximum length of 500.

Required: Yes

GuessMIMETypeEnabled

Enables guessing of the MIME type for uploaded objects based on file extensions: "true" to enable MIME type guessing, and otherwise "false". The default value is "true".

Type: Boolean

Required: No

KMSEncrypted

True to use Amazon S3 server side encryption with your own AWS KMS key, or false to use a key managed by Amazon S3. Optional.

Type: Boolean

Required: No

KMSKey

The KMS key used for Amazon S3 server side encryption. This value can only be set when KmsEncrypted is true. Optional.

Type: String

Length Constraints: Minimum length of 20. Maximum length of 2048.

Required: No

LocationARN

The ARN of the backed storage used for storing file data.

Type: String

Length Constraints: Minimum length of 16. Maximum length of 310.

Required: Yes

NFSFileShareDefaults

File share default values. Optional.

Type: NFSFileShareDefaults object

Required: No

ReadOnly

Sets the write status of a file share: "true" if the write status is read-only, and otherwise "false".

Type: Boolean

Required: No

Role

The ARN of the AWS Identity and Access Management (IAM) role that a file gateway assumes when it accesses the underlying storage.

Type: String

Length Constraints: Minimum length of 20. Maximum length of 2048.

Required: Yes

Squash

Maps a user to anonymous user. Valid options are the following:

  • "RootSquash" - Only root is mapped to anonymous user.

  • "NoSquash" - No one is mapped to anonymous user.

  • "AllSquash" - Everyone is mapped to anonymous user.

Type: String

Length Constraints: Minimum length of 5. Maximum length of 15.

Required: No

Response Syntax

{
   "FileShareARN": "string"
}

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

FileShareARN

The Amazon Resource Name (ARN) of the newly created file share.

Type: String

Length Constraints: Minimum length of 50. Maximum length of 500.

Errors

For information about the errors that are common to all actions, see Common Errors.

InternalServerError

An internal server error has occurred during the request. For more information, see the error and message fields.

HTTP Status Code: 400

InvalidGatewayRequestException

An exception occurred because an invalid gateway request was issued to the service. For more information, see the error and message fields.

HTTP Status Code: 400

Example

Create a File Share

In the following request, you create a file share using an existing file gateway.

Sample Request


{"ClientToken": "xy23421",
 "NfsFileShareDefaults":
  {"FileMode": "0777",
   "DirectoryMode": "0777",
   "GroupId": 500,
   "OwnerId": 500},
 "GatewayARN": "arn:aws:storagegateway:us-east-2:111122223333:gateway/sgw-XXXXXXX",
 "GuessMIMETypeEnabled": "true",
 "KMSEncrypted": "false",
 "Role": "arn:aws:iam::111122223333:role/my-role",
 "ReadOnly": "false",
 "LocationARN": "arn:aws:s3:::my-bucket-alpha",
 "DefaultStorageClass" : "S3_STANDARD",
 "Squash" : "RootSquash"}
            

Sample Response


{"FileShareARN": "arn:aws:storagegateway:us-east-2:111122223333:share/share-YYYYYYY"}
            

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: