Skip to content
v2.275.0

FileSystemProps Struct ​

Properties of EFS FileSystem.

Example ​

ts
import * as iam from 'aws-cdk-lib/aws-iam';

const role = new iam.Role(this, 'ClientRole', {
  assumedBy: new iam.AnyPrincipal(),
});
const fileSystem = new efs.FileSystem(this, 'MyEfsFileSystem', {
  vpc: new ec2.Vpc(this, 'VPC'),
  allowAnonymousAccess: true,
});

fileSystem.grantRead(role);

Properties ​

allowAnonymousAccessoptionalbooleanallow_anonymous_accessoptionalboolallowAnonymousAccessoptionalBooleanAllowAnonymousAccessoptionalboolAllowAnonymousAccessoptional*bool#
Allow access from anonymous client that doesn't use IAM authentication.

Default: false when using grantRead, grantWrite, grantRootAccess or set @aws-cdk/aws-efs:denyAnonymousAccess feature flag, otherwise true

enableAutomaticBackupsoptionalbooleanenable_automatic_backupsoptionalboolenableAutomaticBackupsoptionalBooleanEnableAutomaticBackupsoptionalboolEnableAutomaticBackupsoptional*bool= false#
Whether to enable automatic backups for the file system.
encryptedoptionalbooleanencryptedoptionalboolencryptedoptionalBooleanEncryptedoptionalboolEncryptedoptional*bool#
Defines if the data at rest in the file system is encrypted or not.

Default: If your application has the '@aws-cdk/aws-efs:defaultEncryptionAtRest' feature flag set, the default is true, otherwise, the default is false.

fileSystemNameoptionalstringfile_system_nameoptionalstrfileSystemNameoptionalStringFileSystemNameoptionalstringFileSystemNameoptional*string#
The file system's name.

Default: CDK generated name

fileSystemPolicyoptionalPolicyDocumentfile_system_policyoptionalPolicyDocumentfileSystemPolicyoptionalPolicyDocumentFileSystemPolicyoptionalPolicyDocumentFileSystemPolicyoptionalPolicyDocument= none#
File system policy is an IAM resource policy used to control NFS access to an EFS file system.
kmsKeyoptionalIKeyRefkms_keyoptionalIKeyRefkmsKeyoptionalIKeyRefKmsKeyoptionalIKeyRefKmsKeyoptionalIKeyRef#
The KMS key used for encryption.

Default: if 'encrypted' is true, the default key for EFS (/aws/elasticfilesystem) is used

This is required to encrypt the data at rest if

lifecyclePolicyoptionalLifecyclePolicylifecycle_policyoptionalLifecyclePolicylifecyclePolicyoptionalLifecyclePolicyLifecyclePolicyoptionalLifecyclePolicyLifecyclePolicyoptionalLifecyclePolicy#
A policy used by EFS lifecycle management to transition files to the Infrequent Access (IA) storage class.

Default: None. EFS will not transition files to the IA storage class.

oneZoneoptionalbooleanone_zoneoptionalbooloneZoneoptionalBooleanOneZoneoptionalboolOneZoneoptional*bool= false#
Whether this is a One Zone file system.

If enabled, performanceMode must be set to GENERAL_PURPOSE and vpcSubnets cannot be set.

outOfInfrequentAccessPolicyoptionalOutOfInfrequentAccessPolicyout_of_infrequent_access_policyoptionalOutOfInfrequentAccessPolicyoutOfInfrequentAccessPolicyoptionalOutOfInfrequentAccessPolicyOutOfInfrequentAccessPolicyoptionalOutOfInfrequentAccessPolicyOutOfInfrequentAccessPolicyoptionalOutOfInfrequentAccessPolicy#
A policy used by EFS lifecycle management to transition files from Infrequent Access (IA) storage class to primary storage class.

Default: None. EFS will not transition files from IA storage to primary storage.

performanceModeoptionalPerformanceModeperformance_modeoptionalPerformanceModeperformanceModeoptionalPerformanceModePerformanceModeoptionalPerformanceModePerformanceModeoptionalPerformanceMode= PerformanceMode.GENERAL_PURPOSE#
The performance mode that the file system will operate under.

An Amazon EFS file system's performance mode can't be changed after the file system has been created. Updating this property will replace the file system.

provisionedThroughputPerSecondoptionalSizeprovisioned_throughput_per_secondoptionalSizeprovisionedThroughputPerSecondoptionalSizeProvisionedThroughputPerSecondoptionalSizeProvisionedThroughputPerSecondoptionalSize#
Provisioned throughput for the file system.

Default: none, errors out

This is a required property if the throughput mode is set to PROVISIONED. Must be at least 1MiB/s.

removalPolicyoptionalRemovalPolicyremoval_policyoptionalRemovalPolicyremovalPolicyoptionalRemovalPolicyRemovalPolicyoptionalRemovalPolicyRemovalPolicyoptionalRemovalPolicy= RemovalPolicy.RETAIN#
The removal policy to apply to the file system.
replicationConfigurationoptionalReplicationConfigurationreplication_configurationoptionalReplicationConfigurationreplicationConfigurationoptionalReplicationConfigurationReplicationConfigurationoptionalReplicationConfigurationReplicationConfigurationoptionalReplicationConfiguration#
Replication configuration for the file system.

Default: no replication

replicationOverwriteProtectionoptionalReplicationOverwriteProtectionreplication_overwrite_protectionoptionalReplicationOverwriteProtectionreplicationOverwriteProtectionoptionalReplicationOverwriteProtectionReplicationOverwriteProtectionoptionalReplicationOverwriteProtectionReplicationOverwriteProtectionoptionalReplicationOverwriteProtection#
Whether to enable the filesystem's replication overwrite protection or not.

Default: ReplicationOverwriteProtection.ENABLED

Set false if you want to create a read-only filesystem for use as a replication destination.

securityGroupoptionalISecurityGroupsecurity_groupoptionalISecurityGroupsecurityGroupoptionalISecurityGroupSecurityGroupoptionalISecurityGroupSecurityGroupoptionalISecurityGroup#
Security Group to assign to this file system.

Default: creates new security group which allows all outbound traffic

throughputModeoptionalThroughputModethroughput_modeoptionalThroughputModethroughputModeoptionalThroughputModeThroughputModeoptionalThroughputModeThroughputModeoptionalThroughputMode= ThroughputMode.BURSTING#
Enum to mention the throughput mode of the file system.
transitionToArchivePolicyoptionalLifecyclePolicytransition_to_archive_policyoptionalLifecyclePolicytransitionToArchivePolicyoptionalLifecyclePolicyTransitionToArchivePolicyoptionalLifecyclePolicyTransitionToArchivePolicyoptionalLifecyclePolicy#
The number of days after files were last accessed in primary storage (the Standard storage class) at which to move them to Archive storage.

Default: None. EFS will not transition files to Archive storage class.

Metadata operations such as listing the contents of a directory don't count as file access events.

vpcIVpcvpcIVpcvpcIVpcVpcIVpcVpcIVpcrequired#
VPC to launch the file system in.
vpcSubnetsoptionalSubnetSelectionvpc_subnetsoptionalSubnetSelectionvpcSubnetsoptionalSubnetSelectionVpcSubnetsoptionalSubnetSelectionVpcSubnetsoptionalSubnetSelection#
Which subnets to place the mount target in the VPC.

Default: the Vpc default strategy if not specified