Bucket
Progress checklist
Overview
Section titled “Overview” S3FILES
Amazon S3 Files — a service that exposes an S3 bucket as a shared NFS file system. Supports EC2, EKS, ECS (Fargate), and Lambda. Uses the CLI namespace `aws s3files` and mount type `-t s3files`. Read APIs are `list-*` and `get-*` (for example `list-file-systems`, `get-file-system`), not `describe-*`. requires VERSIONING
S3 Versioning — keeps multiple versions of each object in a bucket. S3 Files requires versioning to be enabled on the linked bucket for synchronisation to work. to synchronise changes between the file system and the bucket. It also supports only SSE
Server-Side Encryption — encryption of data at rest in S3. S3 Files supports SSE-S3 (AWS-managed keys) and SSE-KMS (customer-managed keys). SSE-C is not supported. — specifically SSE-S3 or SSE-KMS. Set both before creating the file system.
-
Set environment variables. Required
Use these exports throughout the Lambda walkthrough. Replace values to match your environment.
Terminal window export AWS_REGION=ap-southeast-6export BUCKET=my-s3-files-bucket # ← replace with your real bucket nameexport BUCKET_ARN=arn:aws:s3:::${BUCKET}export ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text)echo "Account: $ACCOUNT_ID Region: $AWS_REGION Bucket: $BUCKET" -
Create the bucket. Required
Terminal window aws s3api create-bucket \--bucket $BUCKET \--region $AWS_REGION \--create-bucket-configuration LocationConstraint=$AWS_REGION -
Enable versioning. Required
S3 Files will fail to create a file system if versioning is not enabled.
Terminal window aws s3api put-bucket-versioning \--bucket $BUCKET \--versioning-configuration Status=EnabledVerify:
Terminal window aws s3api get-bucket-versioning --bucket $BUCKETExpected output:
{"Status": "Enabled"} -
Confirm encryption. Required
New buckets default to SSE-S3 (AES-256). Verify:
Terminal window aws s3api get-bucket-encryption --bucket $BUCKETThe rule type must be
aws:kms(SSE-KMS) orAES256(SSE-S3). If the command returns aServerSideEncryptionConfigurationNotFoundError, apply SSE-S3 explicitly:Terminal window aws s3api put-bucket-encryption \--bucket $BUCKET \--server-side-encryption-configuration '{"Rules": [{"ApplyServerSideEncryptionByDefault": {"SSEAlgorithm": "AES256"}}]}' -
Seed the
lambda/prefix. RequiredThe Lambda access point is configured with root directory
Path=/lambda. The function can only see objects under that prefix. Seed a fixture file so the mount is not empty on first invocation.Terminal window printf 'Hello from S3 Files Lambda walkthrough\n' \| aws s3 cp - "s3://$BUCKET/lambda/hello.txt" --region "$AWS_REGION"Confirm the upload:
Terminal window aws s3 ls "s3://$BUCKET/lambda/" --region "$AWS_REGION"You should see
lambda/hello.txt.
Next step
Section titled “Next step”Continue to File System to create the file system IAM role and the S3 Files file system.