The Elastic File System implementation of IFileSystem. It creates a new, empty file system in Amazon Elastic File System (Amazon EFS). It also creates mount target (AWS::EFS::MountTarget) implicitly to mount the EFS file system on an Amazon Elastic Compute Cloud (Amazon EC2) instance or another resource.
import { FileSystem } from 'aws-cdk-lib/aws-efs';Or use the module namespace:
import * as efs from 'aws-cdk-lib/aws-efs';
// efs.FileSystemConfiguration passed to the constructor as FileSystemProps.
vpcRequiredIVpcVPC to launch the file system in.
allowAnonymousAccessOptionalbooleanAllow 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
enableAutomaticBackupsOptionalbooleanWhether to enable automatic backups for the file system.
Default: false
encryptedOptionalbooleanDefines 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.
fileSystemNameOptionalstringThe file system's name.
Default: - CDK generated name
fileSystemPolicyOptionalPolicyDocumentFile system policy is an IAM resource policy used to control NFS access to an EFS file system.
Default: none
kmsKeyOptionalIKeyRefThe KMS key used for encryption. This is required to encrypt the data at rest if
Default: - if 'encrypted' is true, the default key for EFS (/aws/elasticfilesystem) is used
lifecyclePolicyOptionalLifecyclePolicyA 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.
oneZoneOptionalbooleanWhether this is a One Zone file system. If enabled, `performanceMode` must be set to `GENERAL_PURPOSE` and `vpcSubnets` cannot be set.
Default: false
outOfInfrequentAccessPolicyOptionalOutOfInfrequentAccessPolicyA 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.
performanceModeOptionalPerformanceModeThe 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.
Default: PerformanceMode.GENERAL_PURPOSE
provisionedThroughputPerSecondOptionalSizeProvisioned throughput for the file system. This is a required property if the throughput mode is set to PROVISIONED. Must be at least 1MiB/s.
Default: - none, errors out
removalPolicyOptionalRemovalPolicyThe removal policy to apply to the file system.
Default: RemovalPolicy.RETAIN
replicationConfigurationOptionalReplicationConfigurationReplication configuration for the file system.
Default: - no replication
replicationOverwriteProtectionOptionalReplicationOverwriteProtectionWhether to enable the filesystem's replication overwrite protection or not. Set false if you want to create a read-only filesystem for use as a replication destination.
Default: ReplicationOverwriteProtection.ENABLED
securityGroupOptionalISecurityGroupSecurity Group to assign to this file system.
Default: - creates new security group which allows all outbound traffic
throughputModeOptionalThroughputModeEnum to mention the throughput mode of the file system.
Default: ThroughputMode.BURSTING
transitionToArchivePolicyOptionalLifecyclePolicyThe number of days after files were last accessed in primary storage (the Standard storage class) at which to move them to Archive storage. Metadata operations such as listing the contents of a directory don't count as file access events.
Default: - None. EFS will not transition files to Archive storage class.
vpcSubnetsOptionalSubnetSelectionWhich subnets to place the mount target in the VPC.
Default: - the Vpc default strategy if not specified
Our bi-weekly newsletter teaches hands-on AWS fundamentals. No certification fluff - just practical knowledge.
Subscribe to Newsletteraws-efs