AWS Amazon S3 NFS File Share
This page shows how to write Terraform for Amazon S3 NFS File Share and write them securely.
aws_storagegateway_nfs_file_share (Terraform)
The NFS File Share in Amazon S3 can be configured in Terraform with the resource name aws_storagegateway_nfs_file_share
. The following sections describe 2 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "aws_storagegateway_nfs_file_share" "nfs-file" {
client_list = ["0.0.0.0/0"]
gateway_arn = aws_storagegateway_gateway.storage-gateway.arn
location_arn = aws_s3_bucket.bucket.arn
role_arn = aws_iam_role.gateway.arn
resource "aws_storagegateway_nfs_file_share" "this" {
client_list = var.client_list
default_storage_class = var.default_storage_class
gateway_arn = var.gateway_arn
guess_mime_type_enabled = var.guess_mime_type_enabled
kms_encrypted = var.kms_encrypted
Parameters
-
arn
optional computed - string -
client_list
required - set of string -
default_storage_class
optional - string -
file_share_name
optional computed - string -
fileshare_id
optional computed - string -
gateway_arn
required - string -
guess_mime_type_enabled
optional - bool -
id
optional computed - string -
kms_encrypted
optional - bool -
kms_key_arn
optional - string -
location_arn
required - string -
notification_policy
optional - string -
object_acl
optional - string -
path
optional computed - string -
read_only
optional - bool -
requester_pays
optional - bool -
role_arn
required - string -
squash
optional - string -
tags
optional - map from string to string -
cache_attributes
list block-
cache_stale_timeout_in_seconds
optional - number
-
-
nfs_file_share_defaults
list block-
directory_mode
optional - string -
file_mode
optional - string -
group_id
optional - string -
owner_id
optional - string
-
-
timeouts
single block
Explanation in Terraform Registry
Manages an AWS Storage Gateway NFS File Share.
Tips: Best Practices for The Other AWS Amazon S3 Resources
In addition to the aws_s3_bucket_public_access_block, AWS Amazon S3 has the other resources that should be configured for security reasons. Please check some examples of those resources and precautions.
aws_s3_bucket_public_access_block
Ensure S3 bucket-level Public Access Block restricts public bucket policies
It is better to enable S3 bucket-level Public Access Block if you don't need public buckets.
aws_s3_bucket
Ensure S3 bucket access policy is well configured
It is better to configure the S3 bucket access policy properly to limit it unless explicitly required.
CloudFormation Example
CloudFormation code does not have the related resource.
Frequently asked questions
What is AWS Amazon S3 NFS File Share?
AWS Amazon S3 NFS File Share is a resource for Amazon S3 of Amazon Web Service. Settings can be wrote in Terraform.
Where can I find the example code for the AWS Amazon S3 NFS File Share?
For Terraform, the EASThyeok/soldeskTEAM1 and niveklabs/aws source code examples are useful. See the Terraform Example section for further details.