Skip to content

Resource: awsStoragegatewayNfsFileShare

Manages an AWS Storage Gateway NFS File Share.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
new aws.storagegatewayNfsFileShare.StoragegatewayNfsFileShare(this, "example", {
  clientList: ["0.0.0.0/0"],
  gatewayArn: "${aws_storagegateway_gateway.example.arn}",
  locationArn: "${aws_s3_bucket.example.arn}",
  roleArn: "${aws_iam_role.example.arn}",
});

Argument Reference

The following arguments are supported:

  • clientList - (Required) The list of clients that are allowed to access the file gateway. The list must contain either valid IP addresses or valid CIDR blocks. Set to ["0000/0"] to not limit access. Minimum 1 item. Maximum 100 items.
  • gatewayArn - (Required) Amazon Resource Name (ARN) of the file gateway.
  • locationArn - (Required) The ARN of the backed storage used for storing file data.
  • vpcEndpointDnsName - (Optional) The DNS name of the VPC endpoint for S3 PrivateLink.
  • bucketRegion - (Optional) The region of the S3 bucket used by the file share. Required when specifying vpcEndpointDnsName.
  • roleArn - (Required) The ARN of the AWS Identity and Access Management (IAM) role that a file gateway assumes when it accesses the underlying storage.
  • auditDestinationArn - (Optional) The Amazon Resource Name (ARN) of the storage used for audit logs.
  • defaultStorageClass - (Optional) The default storage class for objects put into an Amazon S3 bucket by the file gateway. Defaults to S3_STANDARD.
  • guessMimeTypeEnabled - (Optional) Boolean value that enables guessing of the MIME type for uploaded objects based on file extensions. Defaults to true.
  • kmsEncrypted - (Optional) Boolean value if true to use Amazon S3 server side encryption with your own AWS KMS key, or false to use a key managed by Amazon S3. Defaults to false.
  • kmsKeyArn - (Optional) Amazon Resource Name (ARN) for KMS key used for Amazon S3 server side encryption. This value can only be set when kmsEncrypted is true.
  • nfsFileShareDefaults - (Optional) Nested argument with file share default values. More information below. see NFS File Share Defaults for more details.
  • cacheAttributes - (Optional) Refresh cache information. see Cache Attributes for more details.
  • objectAcl - (Optional) Access Control List permission for S3 objects. Defaults to private.
  • readOnly - (Optional) Boolean to indicate write status of file share. File share does not accept writes if true. Defaults to false.
  • requesterPays - (Optional) Boolean who pays the cost of the request and the data download from the Amazon S3 bucket. Set this value to true if you want the requester to pay instead of the bucket owner. Defaults to false.
  • squash - (Optional) Maps a user to anonymous user. Defaults to rootSquash. Valid values: rootSquash (only root is mapped to anonymous user), noSquash (no one is mapped to anonymous user), allSquash (everyone is mapped to anonymous user)
  • fileShareName - (Optional) The name of the file share. Must be set if an S3 prefix name is set in locationArn.
  • notificationPolicy - (Optional) The notification policy of the file share. For more information see the AWS Documentation. Default value is {}.
  • tags - (Optional) Key-value map of resource tags. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

nfsFileShareDefaults

Files and folders stored as Amazon S3 objects in S3 buckets don't, by default, have Unix file permissions assigned to them. Upon discovery in an S3 bucket by Storage Gateway, the S3 objects that represent files and folders are assigned these default Unix permissions.

  • directoryMode - (Optional) The Unix directory mode in the string form "nnnn". Defaults to "0777".
  • fileMode - (Optional) The Unix file mode in the string form "nnnn". Defaults to "0666".
  • groupId - (Optional) The default group ID for the file share (unless the files have another group ID specified). Defaults to 65534 (nfsnobody). Valid values: 0 through 4294967294.
  • ownerId - (Optional) The default owner ID for the file share (unless the files have another owner ID specified). Defaults to 65534 (nfsnobody). Valid values: 0 through 4294967294.

cacheAttributes

  • cacheStaleTimeoutInSeconds - (Optional) Refreshes a file share's cache by using Time To Live (TTL). TTL is the length of time since the last refresh after which access to the directory would cause the file gateway to first refresh that directory's contents from the Amazon S3 bucket. Valid Values: 300 to 2,592,000 seconds (5 minutes to 30 days)

Attributes Reference

In addition to all arguments above, the following attributes are exported:

  • id - Amazon Resource Name (ARN) of the NFS File Share.
  • arn - Amazon Resource Name (ARN) of the NFS File Share.
  • fileshareId - ID of the NFS File Share.
  • path - File share path used by the NFS client to identify the mount point.
  • tagsAll - A map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.

Timeouts

Configuration options:

  • create - (Default 10M)
  • update - (Default 10M)
  • delete - (Default 10M)

Import

awsStoragegatewayNfsFileShare can be imported by using the NFS File Share Amazon Resource Name (ARN), e.g.,

$ terraform import aws_storagegateway_nfs_file_share.example arn:aws:storagegateway:us-east-1:123456789012:share/share-12345678