aws-cdk-lib.aws_efs.FileSystemProps

interface FileSystemProps

LanguageType name
.NETAmazon.CDK.AWS.EFS.FileSystemProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsefs#FileSystemProps
Javasoftware.amazon.awscdk.services.efs.FileSystemProps
Pythonaws_cdk.aws_efs.FileSystemProps
TypeScript (source)aws-cdk-lib » aws_efs » FileSystemProps

Properties of EFS FileSystem.

Example

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

const myFileSystemPolicy = new iam.PolicyDocument({
  statements: [new iam.PolicyStatement({
    actions: [
      'elasticfilesystem:ClientWrite',
      'elasticfilesystem:ClientMount',
    ],
    principals: [new iam.AccountRootPrincipal()],
    resources: ['*'],
    conditions: {
      Bool: {
        'elasticfilesystem:AccessedViaMountTarget': 'true',
      },
    },
  })],
});

const fileSystem = new efs.FileSystem(this, 'MyEfsFileSystem', {
  vpc: new ec2.Vpc(this, 'VPC'),
  fileSystemPolicy: myFileSystemPolicy,
});

Properties

NameTypeDescription
vpcIVpcVPC to launch the file system in.
enableAutomaticBackups?booleanWhether to enable automatic backups for the file system.
encrypted?booleanDefines if the data at rest in the file system is encrypted or not.
fileSystemName?stringThe file system's name.
fileSystemPolicy?PolicyDocumentFile system policy is an IAM resource policy used to control NFS access to an EFS file system.
kmsKey?IKeyThe KMS key used for encryption.
lifecyclePolicy?LifecyclePolicyA policy used by EFS lifecycle management to transition files to the Infrequent Access (IA) storage class.
outOfInfrequentAccessPolicy?OutOfInfrequentAccessPolicyA policy used by EFS lifecycle management to transition files from Infrequent Access (IA) storage class to primary storage class.
performanceMode?PerformanceModeThe performance mode that the file system will operate under.
provisionedThroughputPerSecond?SizeProvisioned throughput for the file system.
removalPolicy?RemovalPolicyThe removal policy to apply to the file system.
securityGroup?ISecurityGroupSecurity Group to assign to this file system.
throughputMode?ThroughputModeEnum to mention the throughput mode of the file system.
vpcSubnets?SubnetSelectionWhich subnets to place the mount target in the VPC.

vpc

Type: IVpc

VPC to launch the file system in.


enableAutomaticBackups?

Type: boolean (optional, default: false)

Whether to enable automatic backups for the file system.


encrypted?

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

Defines if the data at rest in the file system is encrypted or not.


fileSystemName?

Type: string (optional, default: CDK generated name)

The file system's name.


fileSystemPolicy?

Type: PolicyDocument (optional, default: none)

File system policy is an IAM resource policy used to control NFS access to an EFS file system.


kmsKey?

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

The KMS key used for encryption.

This is required to encrypt the data at rest if @encrypted is set to true.


lifecyclePolicy?

Type: LifecyclePolicy (optional, default: None. EFS will not transition files to the IA storage class.)

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


outOfInfrequentAccessPolicy?

Type: OutOfInfrequentAccessPolicy (optional, default: None. EFS will not transition files from IA storage to primary storage.)

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


performanceMode?

Type: PerformanceMode (optional, default: 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.


provisionedThroughputPerSecond?

Type: Size (optional, default: none, errors out)

Provisioned throughput for the file system.

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


removalPolicy?

Type: RemovalPolicy (optional, default: RemovalPolicy.RETAIN)

The removal policy to apply to the file system.


securityGroup?

Type: ISecurityGroup (optional, default: creates new security group which allows all outbound traffic)

Security Group to assign to this file system.


throughputMode?

Type: ThroughputMode (optional, default: ThroughputMode.BURSTING)

Enum to mention the throughput mode of the file system.


vpcSubnets?

Type: SubnetSelection (optional, default: the Vpc default strategy if not specified)

Which subnets to place the mount target in the VPC.