# Deploy Amazon S3 Files with Terraform

DevFeed: [Deploy Amazon S3 Files with Terraform](<https://devfeed.tech/articles/deploy-amazon-s3-files-with-terraform-133433.md>)

Original publisher: [Read original article](<https://aws.amazon.com/blogs/storage/deploy-amazon-s3-files-with-terraform/>)

Author: Karthik Akula

Published: 2026-11-13T19:06:41Z

Content type: tutorial

Language: en

Sources: [AWS Storage Blog](<https://devfeed.tech/sources/aws-storage-blog.md>)

Topics: [Terraform](<https://devfeed.tech/topics/terraform.md>), [Amazon S3](<https://devfeed.tech/topics/amazon-s3.md>), [Amazon CloudWatch](<https://devfeed.tech/topics/amazon-cloudwatch.md>), [mount](<https://devfeed.tech/topics/mount.md>), [Amazon EC2](<https://devfeed.tech/topics/amazon-ec2.md>)

Tags: [accessible](<https://devfeed.tech/tags/accessible.md>), [amazon](<https://devfeed.tech/tags/amazon.md>), [amazon-cloudwatch](<https://devfeed.tech/tags/amazon-cloudwatch.md>), [amazon-s3](<https://devfeed.tech/tags/amazon-s3.md>), [amazon-simple-storage-service-s3](<https://devfeed.tech/tags/amazon-simple-storage-service-s3.md>), [aws](<https://devfeed.tech/tags/aws.md>), [cloudwatch](<https://devfeed.tech/tags/cloudwatch.md>), [compute](<https://devfeed.tech/tags/compute.md>), [compute-resources](<https://devfeed.tech/tags/compute-resources.md>), [deploy](<https://devfeed.tech/tags/deploy.md>), [encryption](<https://devfeed.tech/tags/encryption.md>), [expert-400](<https://devfeed.tech/tags/expert-400.md>), [files](<https://devfeed.tech/tags/files.md>), [groups](<https://devfeed.tech/tags/groups.md>), [iam](<https://devfeed.tech/tags/iam.md>), [module](<https://devfeed.tech/tags/module.md>), [monitoring](<https://devfeed.tech/tags/monitoring.md>), [mount](<https://devfeed.tech/tags/mount.md>), [nfs](<https://devfeed.tech/tags/nfs.md>), [s3](<https://devfeed.tech/tags/s3.md>), [technical-how-to](<https://devfeed.tech/tags/technical-how-to.md>), [terraform](<https://devfeed.tech/tags/terraform.md>), [with](<https://devfeed.tech/tags/with.md>)

## AI overview

The Terraform module deploys Amazon S3 Files as an NFS file system backed by an S3 bucket, with mount targets in private subnets across multiple Availability Zones. It restricts NFS traffic to TCP 2049 between designated security groups, applies resource and identity IAM policies, configures synchronization and optional customer managed KMS encryption, and creates CloudWatch alarms and a per-client dashboard. Examples cover EC2, ECS on Fargate, and Lambda; ECS and Lambda use access points, while EC2 needs ClientRootAccess to write at the file system root. Prerequisites include Terraform 1.5.0 or later, AWS provider 6.53.0 or later, a versioned and encrypted bucket, and a VPC with private subnets in at least two zones. The article notes that alarms have no data when no client is mounted, and the first Lambda invocation may time out shortly after deployment; retry after about a minute.

## Source excerpt

Amazon S3 Files makes Amazon S3 buckets accessible as NFS mounts from AWS compute resources. This post walks through a Terraform module that deploys S3 Files end-to-end: multi-AZ mount targets, security groups, IAM policies, encryption, and Amazon CloudWatch monitoring.