Skip to main content

file_system_policies

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

Overview

Namefile_system_policies
TypeResource
Idaws.efs.file_system_policies

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
file_system_idstringSpecifies the EFS file system to which the FileSystemPolicy applies. (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>)
policystringThe JSON formatted FileSystemPolicy for the EFS file system. (pattern: <code>[\s\S]+</code>)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_file_system_policyselectfile_system_id, regionReturns the FileSystemPolicy for the specified EFS file system. This operation requires permissions for the elasticfilesystem:DescribeFileSystemPolicy action.
put_file_system_policyreplacefile_system_id, regionApplies an Amazon EFS FileSystemPolicy to an Amazon EFS file system. A file system policy is an IAM resource-based policy and can contain multiple policy statements. A file system always has exactly one file system policy, which can be the default policy or an explicit policy set or updated using this API operation. EFS file system policies have a 20,000 character limit. When an explicit policy is set, it overrides the default policy. For more information about the default file system policy, see Default EFS file system policy. EFS file system policies have a 20,000 character limit. This operation requires permissions for the elasticfilesystem:PutFileSystemPolicy action.
delete_file_system_policydeletefile_system_id, regionDeletes the FileSystemPolicy for the specified file system. The default FileSystemPolicy goes into effect once the existing policy is deleted. For more information about the default file system policy, see Using Resource-based Policies with EFS. This operation requires permissions for the elasticfilesystem:DeleteFileSystemPolicy 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_idstringSpecifies the EFS file system for which to delete the FileSystemPolicy.
regionstringAWS region (default: us-east-1)

SELECT examples

Returns the FileSystemPolicy for the specified EFS file system. This operation requires permissions for the elasticfilesystem:DescribeFileSystemPolicy action.

SELECT
file_system_id,
policy
FROM aws.efs.file_system_policies
WHERE file_system_id = '{{ file_system_id }}' -- required
AND region = '{{ region }}' -- required
;

REPLACE examples

Applies an Amazon EFS FileSystemPolicy to an Amazon EFS file system. A file system policy is an IAM resource-based policy and can contain multiple policy statements. A file system always has exactly one file system policy, which can be the default policy or an explicit policy set or updated using this API operation. EFS file system policies have a 20,000 character limit. When an explicit policy is set, it overrides the default policy. For more information about the default file system policy, see Default EFS file system policy. EFS file system policies have a 20,000 character limit. This operation requires permissions for the elasticfilesystem:PutFileSystemPolicy action.

REPLACE aws.efs.file_system_policies
SET
Policy = '{{ Policy }}',
BypassPolicyLockoutSafetyCheck = {{ BypassPolicyLockoutSafetyCheck }}
WHERE
file_system_id = '{{ file_system_id }}' --required
AND region = '{{ region }}' --required
RETURNING
file_system_id,
policy;

DELETE examples

Deletes the FileSystemPolicy for the specified file system. The default FileSystemPolicy goes into effect once the existing policy is deleted. For more information about the default file system policy, see Using Resource-based Policies with EFS. This operation requires permissions for the elasticfilesystem:DeleteFileSystemPolicy action.

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