Skip to main content

file_systems

Creates, updates, deletes, gets or lists a file_systems resource.

Overview

Namefile_systems
TypeResource
Idaws.efs.file_systems

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
availability_zone_idstringThe unique and consistent identifier of the Availability Zone in which the file system is located, and is valid only for One Zone file systems. For example, use1-az1 is an Availability Zone ID for the us-east-1 Amazon Web Services Region, and it has the same location in every Amazon Web Services account.
availability_zone_namestringDescribes the Amazon Web Services Availability Zone in which the file system is located, and is valid only for One Zone file systems. For more information, see Using EFS storage classes in the Amazon EFS User Guide. (pattern: <code>.+</code>)
creation_timestring (date-time)The time that the file system was created, in seconds (since 1970-01-01T00:00:00Z).
creation_tokenstringThe opaque string specified in the request. (pattern: <code>.+</code>)
encryptedbooleanA Boolean value that, if true, indicates that the file system is encrypted.
file_system_arnstringThe Amazon Resource Name (ARN) for the EFS file system, in the format arn:aws:elasticfilesystem:region:account-id:file-system/file-system-id . Example with sample data: arn:aws:elasticfilesystem:us-west-2:1111333322228888:file-system/fs-01234567
file_system_idstringThe ID of the file system, assigned by Amazon EFS. (pattern: <code>^(arn:aws[-a-z]*:elasticfilesystem:[0-9a-z-:]+:file-system/fs-[0-9a-f]{8,40}|fs-[0-9a-f]{8,40})$</code>)
file_system_protectionobjectDescribes the protection on the file system.
kms_key_idstringThe ID of an KMS key used to protect the encrypted file system. (pattern: <code>^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|mrk-[0-9a-f]{32}|alias/[a-zA-Z0-9/-]+|(arn:aws[-a-z]*:kms:[a-z0-9-]+:\d{12}:((key/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})|(key/mrk-[0-9a-f]{32})|(alias/[a-zA-Z0-9/-]+))))$</code>)
life_cycle_statestringThe lifecycle phase of the file system. (creating, available, updating, deleting, deleted, error)
namestringYou can add tags to a file system, including a Name tag. For more information, see CreateFileSystem. If the file system has a Name tag, Amazon EFS returns the value in this field. (pattern: <code>^([\p{L}\p{Z}\p{N}_.:/=+-@]*)$</code>)
number_of_mount_targetsintegerThe current number of mount targets that the file system has. For more information, see CreateMountTarget.
owner_idstringThe Amazon Web Services account that created the file system. (pattern: <code>^(\d{12})|(\d{4}-\d{4}-\d{4})$</code>)
performance_modestringThe performance mode of the file system. (generalPurpose, maxIO)
provisioned_throughput_in_mibpsnumber (double)The amount of provisioned throughput, measured in MiBps, for the file system. Valid for file systems using ThroughputMode set to provisioned.
size_in_bytesobjectThe latest known metered size (in bytes) of data stored in the file system, in its Value field, and the time at which that size was determined in its Timestamp field. The Timestamp value is the integer number of seconds since 1970-01-01T00:00:00Z. The SizeInBytes value doesn't represent the size of a consistent snapshot of the file system, but it is eventually consistent when there are no writes to the file system. That is, SizeInBytes represents actual size only if the file system is not modified for a period longer than a couple of hours. Otherwise, the value is not the exact size that the file system was at any point in time.
tagsarrayThe tags associated with the file system, presented as an array of Tag objects.
throughput_modestringDisplays the file system's throughput mode. For more information, see Throughput modes in the Amazon EFS User Guide. (bursting, provisioned, elastic)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_file_systemsselectregionMaxItems, Marker, CreationToken, FileSystemIdReturns the description of a specific Amazon EFS file system if either the file system CreationToken or the FileSystemId is provided. Otherwise, it returns descriptions of all file systems owned by the caller's Amazon Web Services account in the Amazon Web Services Region of the endpoint that you're calling. When retrieving all file system descriptions, you can optionally specify the MaxItems parameter to limit the number of descriptions in a response. This number is automatically set to 100. If more file system descriptions remain, Amazon EFS returns a NextMarker, an opaque token, in the response. In this case, you should send a subsequent request with the Marker request parameter set to the value of NextMarker. To retrieve a list of your file system descriptions, this operation is used in an iterative process, where DescribeFileSystems is called first without the Marker and then the operation continues to call it with the Marker parameter set to the value of the NextMarker from the previous response until the response has no NextMarker. The order of file systems returned in the response of one DescribeFileSystems call and the order of file systems returned across the responses of a multi-call iteration is unspecified. This operation requires permissions for the elasticfilesystem:DescribeFileSystems action.
create_file_systeminsertregion, CreationTokenCreates a new, empty file system. The operation requires a creation token in the request that Amazon EFS uses to ensure idempotent creation (calling the operation with same creation token has no effect). If a file system does not currently exist that is owned by the caller's Amazon Web Services account with the specified creation token, this operation does the following: Creates a new, empty file system. The file system will have an Amazon EFS assigned ID, and an initial lifecycle state creating. Returns with the description of the created file system. Otherwise, this operation returns a FileSystemAlreadyExists error with the ID of the existing file system. For basic use cases, you can use a randomly generated UUID for the creation token. The idempotent operation allows you to retry a CreateFileSystem call without risk of creating an extra file system. This can happen when an initial call fails in a way that leaves it uncertain whether or not a file system was actually created. An example might be that a transport level timeout occurred or your connection was reset. As long as you use the same creation token, if the initial call had succeeded in creating a file system, the client can learn of its existence from the FileSystemAlreadyExists error. For more information, see Creating a file system in the Amazon EFS User Guide. The CreateFileSystem call returns while the file system's lifecycle state is still creating. You can check the file system creation status by calling the DescribeFileSystems operation, which among other things returns the file system state. This operation accepts an optional PerformanceMode parameter that you choose for your file system. We recommend generalPurpose PerformanceMode for all file systems. The maxIO mode is a previous generation performance type that is designed for highly parallelized workloads that can tolerate higher latencies than the generalPurpose mode. MaxIO mode is not supported for One Zone file systems or file systems that use Elastic throughput. The PerformanceMode can't be changed after the file system has been created. For more information, see Amazon EFS performance modes. You can set the throughput mode for the file system using the ThroughputMode parameter. After the file system is fully created, Amazon EFS sets its lifecycle state to available, at which point you can create one or more mount targets for the file system in your VPC. For more information, see CreateMountTarget. You mount your Amazon EFS file system on an EC2 instances in your VPC by using the mount target. For more information, see Amazon EFS: How it Works. This operation requires permissions for the elasticfilesystem:CreateFileSystem action. File systems can be tagged on creation. If tags are specified in the creation action, IAM performs additional authorization on the elasticfilesystem:TagResource action to verify if users have permissions to create tags. Therefore, you must grant explicit permissions to use the elasticfilesystem:TagResource action. For more information, see Granting permissions to tag resources during creation.
update_file_systemupdatefile_system_id, regionUpdates the throughput mode or the amount of provisioned throughput of an existing file system.
delete_file_systemdeletefile_system_id, regionDeletes a file system, permanently severing access to its contents. Upon return, the file system no longer exists and you can't access any contents of the deleted file system. You need to manually delete mount targets attached to a file system before you can delete an EFS file system. This step is performed for you when you use the Amazon Web Services console to delete a file system. You cannot delete a file system that is part of an EFS replication configuration. You need to delete the replication configuration first. You can't delete a file system that is in use. That is, if the file system has any mount targets, you must first delete them. For more information, see DescribeMountTargets and DeleteMountTarget. The DeleteFileSystem call returns while the file system state is still deleting. You can check the file system deletion status by calling the DescribeFileSystems operation, which returns a list of file systems in your account. If you pass file system ID or creation token for the deleted file system, the DescribeFileSystems returns a 404 FileSystemNotFound error. This operation requires permissions for the elasticfilesystem:DeleteFileSystem action.
update_file_system_protectionexecfile_system_id, regionUpdates protection on the file system. This operation requires permissions for the elasticfilesystem:UpdateFileSystemProtection action.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
file_system_idstringThe ID of the file system to update.
regionstringAWS region (default: us-east-1)
CreationTokenstring(Optional) Restricts the list to the file system with this creation token (String). You specify a creation token when you create an Amazon EFS file system.
FileSystemIdstring(Optional) ID of the file system whose description you want to retrieve (String).
Markerstring(Optional) Opaque pagination token returned from a previous DescribeFileSystems operation (String). If present, specifies to continue the list from where the returning call had left off.
MaxItemsinteger(Optional) Specifies the maximum number of file systems to return in the response (integer). This number is automatically set to 100. The response is paginated at 100 per page if you have more than 100 file systems.

SELECT examples

Returns the description of a specific Amazon EFS file system if either the file system CreationToken or the FileSystemId is provided. Otherwise, it returns descriptions of all file systems owned by the caller's Amazon Web Services account in the Amazon Web Services Region of the endpoint that you're calling. When retrieving all file system descriptions, you can optionally specify the MaxItems parameter to limit the number of descriptions in a response. This number is automatically set to 100. If more file system descriptions remain, Amazon EFS returns a NextMarker, an opaque token, in the response. In this case, you should send a subsequent request with the Marker request parameter set to the value of NextMarker. To retrieve a list of your file system descriptions, this operation is used in an iterative process, where DescribeFileSystems is called first without the Marker and then the operation continues to call it with the Marker parameter set to the value of the NextMarker from the previous response until the response has no NextMarker. The order of file systems returned in the response of one DescribeFileSystems call and the order of file systems returned across the responses of a multi-call iteration is unspecified. This operation requires permissions for the elasticfilesystem:DescribeFileSystems action.

SELECT
availability_zone_id,
availability_zone_name,
creation_time,
creation_token,
encrypted,
file_system_arn,
file_system_id,
file_system_protection,
kms_key_id,
life_cycle_state,
name,
number_of_mount_targets,
owner_id,
performance_mode,
provisioned_throughput_in_mibps,
size_in_bytes,
tags,
throughput_mode
FROM aws.efs.file_systems
WHERE region = '{{ region }}' -- required
AND MaxItems = '{{ MaxItems }}'
AND Marker = '{{ Marker }}'
AND CreationToken = '{{ CreationToken }}'
AND FileSystemId = '{{ FileSystemId }}'
;

INSERT examples

Creates a new, empty file system. The operation requires a creation token in the request that Amazon EFS uses to ensure idempotent creation (calling the operation with same creation token has no effect). If a file system does not currently exist that is owned by the caller's Amazon Web Services account with the specified creation token, this operation does the following: Creates a new, empty file system. The file system will have an Amazon EFS assigned ID, and an initial lifecycle state creating. Returns with the description of the created file system. Otherwise, this operation returns a FileSystemAlreadyExists error with the ID of the existing file system. For basic use cases, you can use a randomly generated UUID for the creation token. The idempotent operation allows you to retry a CreateFileSystem call without risk of creating an extra file system. This can happen when an initial call fails in a way that leaves it uncertain whether or not a file system was actually created. An example might be that a transport level timeout occurred or your connection was reset. As long as you use the same creation token, if the initial call had succeeded in creating a file system, the client can learn of its existence from the FileSystemAlreadyExists error. For more information, see Creating a file system in the Amazon EFS User Guide. The CreateFileSystem call returns while the file system's lifecycle state is still creating. You can check the file system creation status by calling the DescribeFileSystems operation, which among other things returns the file system state. This operation accepts an optional PerformanceMode parameter that you choose for your file system. We recommend generalPurpose PerformanceMode for all file systems. The maxIO mode is a previous generation performance type that is designed for highly parallelized workloads that can tolerate higher latencies than the generalPurpose mode. MaxIO mode is not supported for One Zone file systems or file systems that use Elastic throughput. The PerformanceMode can't be changed after the file system has been created. For more information, see Amazon EFS performance modes. You can set the throughput mode for the file system using the ThroughputMode parameter. After the file system is fully created, Amazon EFS sets its lifecycle state to available, at which point you can create one or more mount targets for the file system in your VPC. For more information, see CreateMountTarget. You mount your Amazon EFS file system on an EC2 instances in your VPC by using the mount target. For more information, see Amazon EFS: How it Works. This operation requires permissions for the elasticfilesystem:CreateFileSystem action. File systems can be tagged on creation. If tags are specified in the creation action, IAM performs additional authorization on the elasticfilesystem:TagResource action to verify if users have permissions to create tags. Therefore, you must grant explicit permissions to use the elasticfilesystem:TagResource action. For more information, see Granting permissions to tag resources during creation.

INSERT INTO aws.efs.file_systems (
CreationToken,
PerformanceMode,
Encrypted,
KmsKeyId,
ThroughputMode,
ProvisionedThroughputInMibps,
AvailabilityZoneName,
Backup,
Tags,
region
)
SELECT
'{{ CreationToken }}' /* required */,
'{{ PerformanceMode }}',
{{ Encrypted }},
'{{ KmsKeyId }}',
'{{ ThroughputMode }}',
{{ ProvisionedThroughputInMibps }},
'{{ AvailabilityZoneName }}',
{{ Backup }},
'{{ Tags }}',
'{{ region }}'
RETURNING
availability_zone_id,
availability_zone_name,
creation_time,
creation_token,
encrypted,
file_system_arn,
file_system_id,
file_system_protection,
kms_key_id,
life_cycle_state,
name,
number_of_mount_targets,
owner_id,
performance_mode,
provisioned_throughput_in_mibps,
size_in_bytes,
tags,
throughput_mode
;

UPDATE examples

Updates the throughput mode or the amount of provisioned throughput of an existing file system.

UPDATE aws.efs.file_systems
SET
ThroughputMode = '{{ ThroughputMode }}',
ProvisionedThroughputInMibps = {{ ProvisionedThroughputInMibps }}
WHERE
file_system_id = '{{ file_system_id }}' --required
AND region = '{{ region }}' --required
RETURNING
availability_zone_id,
availability_zone_name,
creation_time,
creation_token,
encrypted,
file_system_arn,
file_system_id,
file_system_protection,
kms_key_id,
life_cycle_state,
name,
number_of_mount_targets,
owner_id,
performance_mode,
provisioned_throughput_in_mibps,
size_in_bytes,
tags,
throughput_mode;

DELETE examples

Deletes a file system, permanently severing access to its contents. Upon return, the file system no longer exists and you can't access any contents of the deleted file system. You need to manually delete mount targets attached to a file system before you can delete an EFS file system. This step is performed for you when you use the Amazon Web Services console to delete a file system. You cannot delete a file system that is part of an EFS replication configuration. You need to delete the replication configuration first. You can't delete a file system that is in use. That is, if the file system has any mount targets, you must first delete them. For more information, see DescribeMountTargets and DeleteMountTarget. The DeleteFileSystem call returns while the file system state is still deleting. You can check the file system deletion status by calling the DescribeFileSystems operation, which returns a list of file systems in your account. If you pass file system ID or creation token for the deleted file system, the DescribeFileSystems returns a 404 FileSystemNotFound error. This operation requires permissions for the elasticfilesystem:DeleteFileSystem action.

DELETE FROM aws.efs.file_systems
WHERE file_system_id = '{{ file_system_id }}' --required
AND region = '{{ region }}' --required
;

Lifecycle Methods

Updates protection on the file system. This operation requires permissions for the elasticfilesystem:UpdateFileSystemProtection action.

EXEC aws.efs.file_systems.update_file_system_protection
@file_system_id='{{ file_system_id }}' --required,
@region='{{ region }}' --required
@@json=
'{
"ReplicationOverwriteProtection": "{{ ReplicationOverwriteProtection }}"
}'
;