Amazon ECS now supports tmpfs mounts on AWS Fargate and ECS Managed Instances
Amazon Elastic Container Service (Amazon ECS) now supports tmpfs mounts for Linux tasks running on AWS Fargate and Amazon ECS Managed Instances, extending beyond the EC2 launch type. With tmpfs, you can now create memory‑backed file systems for your containerized workloads without writing this data to task storage.
tmpfs mounts provide a temporary file system that is backed by memory and exposed inside the container at a path you choose. This is ideal for performance‑sensitive workloads that need fast access to scratch files, caches, or temporary working sets, and for security‑sensitive data such as short‑lived secrets or credentials, because the data does not persist after the task stops. tmpfs also lets you keep the container root file system read‑only using the readonlyRootFilesystem setting while still allowing applications to write to specific in‑memory directories.
To get started, update your task definition so that the container definitions include a linuxParameters block with one or more tmpfs entries. For each tmpfs mount, specify the containerPath, size, and optional mountOptions. You can register or update task definitions using the Amazon ECS console, AWS CLI, AWS CloudFormation, or AWS CDK. This feature is available in all AWS Regions where Amazon ECS, AWS Fargate, and Amazon ECS Managed Instances are supported. To learn more, see the LinuxParameters and Tmpfs sections in the Amazon ECS API Reference and the Amazon ECS Developer Guide.