Profile Applicability:

  •  Level 2

Description:

Elastic File Cache is a fully managed, scalable, and high-performance file system cache that accelerates storage performance for applications that require shared access to data. It provides a cache for Amazon S3, FSx for Lustre, and other file systems. Proper creation and configuration of Elastic File Cache ensure improved performance, reduced latency, and better cost management for applications that require low-latency file system access.

Rationale:

Ensuring the creation of Elastic File Cache provides:

  • Faster and more efficient data retrieval with low-latency file access

  • Cost savings by reducing the frequency of expensive requests to backend storage

  • Simplified management and scaling of file system caches

  • Seamless integration with AWS storage services like Amazon S3 and FSx for Lustre

Default Value:

Elastic File Cache is not created by default. It must be manually set up via the AWS Console or CLI.

Impact:

Pros:
 • Improves application performance by providing low-latency file caching
• Reduces backend storage load by serving frequently accessed files from the cache
• Scalable and flexible for large-scale data workloads
 • Integration with S3 and FSx for Lustre enhances cloud-native applications

Cons:
 • Requires initial setup and configuration
• Costs may increase with large-scale caches or high request frequencies
 • Cache misses can result in higher latency or additional backend storage calls

Pre-requisites:

IAM Permissions Required:
 
elasticfilesystem:CreateFileCacheelasticfilesystem:DescribeFileCacheelasticfilesystem:DeleteFileCache
 Permissions to interact with S3 or FSx for Lustre if using them as the backend file system for caching

Remediation:

Test Plan:

Using AWS Console:
 • Log in to the AWS Management Console
 • Navigate to 
Elastic File Cache
 • Ensure the Create Cache option is visible and accessible
 • Review configuration options such as 
cache sizenetwork settings, and backend file system (e.g., Amazon S3, FSx for Lustre)
• Create the cache and monitor its creation status
 • Test by accessing cached data from an EC2 instance or application

Using AWS CLI:

aws efs create-file-cache \

  --file-cache-id <cache-id> \

  --resource-id <resource-id> \

  --network-configuration file://network-config.json

aws efs describe-file-caches

aws efs delete-file-cache \

  --file-cache-id <cache-id>

Implementation Plan:

Using AWS Console:
 • Navigate to Elastic File Cache under Amazon EFS
 • Click Create Cache
 • Select the File System ID and configure cache settings (e.g., cache size, VPC, subnet)
• Review and confirm creation
• Monitor cache creation and validate through CloudWatch metrics
 • Ensure integration with the backend file system (e.g., Amazon S3 or FSx for Lustre) is working

Using AWS CLI:
 Step 1: Create the file cache

aws efs create-file-cache \
  --file-cache-id <cache-id> \
  --resource-id <resource-id> \
  --network-configuration file://network-config.json

Step 2: Describe the cache to verify it is created

aws efs describe-file-caches

Step 3: Mount the file cache on an EC2 instance

sudo mount -t efs <file-cache-id>:/ /mnt/efs

Step 4: Validate access by reading and writing files to the cache

echo "test data" > /mnt/efs/testfile.txt
cat /mnt/efs/testfile.txt

Backout Plan:

Using AWS Console:
 • Navigate to Elastic File Cache
 • Select the cache that needs to be deleted
 • Click 
Delete Cache to remove the cache and any associated resources
 • Review any associated configurations that may need to be reverted

Using AWS CLI:

aws efs delete-file-cache \
  --file-cache-id <cache-id>

References: