← 返回命令列表

Linux command

aws-efs 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

List all file systems

aws efs describe-file-systems

Create a new file system

aws efs create-file-system --creation-token [unique_token]

Describe a specific file system

aws efs describe-file-systems --file-system-id [fs-xxxxxxxx]

Create a mount target

aws efs create-mount-target --file-system-id [fs-xxxxxxxx] --subnet-id [subnet-xxxxxxxx] --security-groups [sg-xxxxxxxx]

List mount targets

aws efs describe-mount-targets --file-system-id [fs-xxxxxxxx]

Delete a file system

aws efs delete-file-system --file-system-id [fs-xxxxxxxx]

Add a lifecycle policy

aws efs put-lifecycle-configuration --file-system-id [fs-xxxxxxxx] --lifecycle-policies TransitionToIA=AFTER_30_DAYS

说明

aws efs is a subcommand of the AWS CLI that manages Amazon Elastic File System, a serverless NFS file system for EC2 instances and on-premises servers. EFS automatically grows and shrinks as files are added or removed. File systems are accessed through mount targets, which provide IP addresses in your VPC subnets. Multiple EC2 instances can mount the same file system concurrently, making EFS suitable for shared workloads like web serving, content management, and container storage. EFS supports two storage classes: Standard for frequently accessed data, and Infrequent Access (IA) for cost optimization. Lifecycle policies automatically move files between classes based on access patterns.

参数

describe-file-systems
List file systems and their details.
create-file-system
Create a new EFS file system.
delete-file-system
Remove a file system (must be empty).
describe-mount-targets
List mount targets for a file system.
create-mount-target
Create a mount target in a subnet.
delete-mount-target
Remove a mount target.
put-lifecycle-configuration
Set lifecycle policies for storage class transitions.
describe-lifecycle-configuration
View current lifecycle policies.
--file-system-id _id_
The file system identifier (fs-xxxxxxxx).
--creation-token _token_
Idempotency token for creating file systems.
--subnet-id _id_
Subnet for the mount target.
--security-groups _ids_
Security groups for the mount target.
--performance-mode _mode_
generalPurpose or maxIO.
--throughput-mode _mode_
bursting, provisioned, or elastic.

FAQ

What is the aws-efs command used for?

aws efs is a subcommand of the AWS CLI that manages Amazon Elastic File System, a serverless NFS file system for EC2 instances and on-premises servers. EFS automatically grows and shrinks as files are added or removed. File systems are accessed through mount targets, which provide IP addresses in your VPC subnets. Multiple EC2 instances can mount the same file system concurrently, making EFS suitable for shared workloads like web serving, content management, and container storage. EFS supports two storage classes: Standard for frequently accessed data, and Infrequent Access (IA) for cost optimization. Lifecycle policies automatically move files between classes based on access patterns.

How do I run a basic aws-efs example?

Run `aws efs describe-file-systems` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does describe-file-systems do in aws-efs?

List file systems and their details.