Profile Applicability:

  •  Level 2

Description:

Amazon Elastic File Cache is a fully managed, scalable, and high-performance file system cache that accelerates applications using shared file storage. It is ideal for workloads that require high throughput and low-latency file access, such as data lakes, content repositories, and big data analytics. Elastic File Cache is designed to work seamlessly with Amazon S3, Amazon FSx for Lustre, and on-premises file systems.

Rationale:

Ensuring that Amazon Elastic File Cache is configured properly provides:

  • Faster access to frequently used data through low-latency file caching

  • A seamless extension of your existing file storage systems

  • Better performance and scalability for applications that require file system access

  • A highly available and durable file caching solution integrated with AWS services

Default Value:

Amazon Elastic File Cache is not enabled by default and needs to be manually created and configured for use.

Impact:

Pros:
 • Improves application performance by providing a low-latency file cache
• Scalable and highly available for data-intensive workloads
• Integrates with Amazon S3, FSx for Lustre, and on-premises file systems
 • Simplifies caching for large-scale file system operations

Cons:
 • Requires manual setup and configuration
• Misconfigurations or excessive caching may lead to increased costs
 • Requires monitoring and adjustment as workloads evolve

Pre-requisites:

IAM Permissions Required:
 
elasticfilesystem:CreateFileCacheelasticfilesystem:DescribeFileCacheelasticfilesystem:DeleteFileCache
 Access to an existing file system such as Amazon S3 or FSx for Lustre (if using as a backend storage system)

Remediation:

Test Plan:

Using AWS Console:
 • Log in to the AWS Management Console
 • Navigate to 
Elastic File Cache
 • Ensure that Create File Cache is accessible and visible
 • Select the 
File System to be cached and configure the cache size, network settings, and backend integration
 • Monitor the 
cache creation process and confirm successful setup via the console dashboard
 • Test cache functionality by accessing and writing data from EC2 instances or applications to the cached file system

Using AWS CLI:

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

Implementation Plan:

Using AWS Console:
 • Navigate to Elastic File Cache under Amazon EFS
 • Click on Create Cache and select the file system that you want to cache
 • Configure settings such as 
cache sizeVPC, and subnet
 • Choose the backend file system (e.g., Amazon S3FSx for Lustre)
• Confirm the cache creation and wait for it to be provisioned
 • Once the cache is created, mount it to your EC2 instance or application for testing

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: Verify the cache creation

aws efs describe-file-caches

Step 3: Mount the file cache on an EC2 instance

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

Step 4: Verify that the cache is accessible by writing and reading files

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

Backout Plan:

Using AWS Console:
 • If issues arise, delete the created file cache from the Elastic File Cache section in the AWS Management Console
• Revert any network or backend file system changes made during setup
 • If the cache was used in production, ensure that backup and recovery options are considered before removal

Using AWS CLI:
 To delete the created file cache:

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

To remove the file system mount:

sudo umount /mnt/efs

References: