Registry / aws / aws-cdk-aws-efs

aws-cdk-aws-efs

JSON →
library1.204.0pypypiunverified

The AWS CDK Construct Library for AWS EFS (Amazon Elastic File System) provides constructs to create and manage EFS resources as infrastructure-as-code. This package is part of the AWS CDK v1 ecosystem (version 1.204.0), which is currently in maintenance mode. AWS CDK v1 typically sees infrequent updates, primarily for critical bug fixes or security patches.

pip install aws-cdk.aws-efs aws-cdk.core
INSTALL
IMPORT
SIG · AWS-CDK-AWS-EFS
A
aws-cdk-aws-efs
awspythonv1.204.0
Install
5.5s avg
Import
Disk
50MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.204.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 48.7MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 5.5s · import 0.000s · 49MB
50MB installed
● package 50MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

FileSystem
from aws_cdk import aws_efs
from aws_cdk.aws_efs import FileSystem
In AWS CDK v1, construct libraries are typically imported as submodules of 'aws_cdk' (e.g., 'aws_cdk.aws_efs'), not directly from 'aws_cdk.aws_efs' which is more common in v2.
AccessPoint
from aws_cdk import aws_efs
from aws_cdk import efs
Ensure the full submodule name 'aws_efs' is used, not a shorthand 'efs'.

This quickstart demonstrates how to create an AWS EFS File System within a new VPC, including an optional Access Point for POSIX-compliant access. It's designed for AWS CDK v1 projects. Remember to configure your AWS credentials and default region/account for `cdk deploy`.

import os from aws_cdk import ( core as cdk, aws_ec2 as ec2, aws_efs as efs, ) class EfsStack(cdk.Stack): def __init__(self, scope: cdk.Construct, construct_id: str, **kwargs) -> None: super().__init__(scope, construct_id, **kwargs) # Create a VPC for the EFS File System vpc = ec2.Vpc(self, "EfsVpc", max_azs=2) # Create an EFS File System file_system = efs.FileSystem(self, "MyEfsFileSystem", vpc=vpc, performance_mode=efs.PerformanceMode.GENERAL_PURPOSE, throughput_mode=efs.ThroughputMode.BURSTING, encrypted=True ) # Optional: Create an Access Point for granular access control efs.AccessPoint(self, "MyEfsAccessPoint", file_system=file_system, path="/mydata", create_acl=efs.Acl(owner_uid="1001", owner_gid="1001", permissions="755"), posix_user=efs.PosixUser(uid="1001", gid="1001") ) cdk.CfnOutput(self, "FileSystemId", value=file_system.file_system_id) app = cdk.App() EfsStack(app, "EfsQuickstartStack", env=cdk.Environment(account=os.environ.get("CDK_DEFAULT_ACCOUNT", ""), region=os.environ.get("CDK_DEFAULT_REGION", "")) ) app.synth()
Debug
Known issues
breakingThis package is for AWS CDK v1. Using it with an AWS CDK v2 application (which uses the `aws-cdk-lib` package) will cause `TypeError` or `AttributeError` due to incompatible types and API differences. The v2 equivalent constructs are part of the `aws-cdk-lib` package.
fix
For new projects, prefer AWS CDK v2 (`pip install aws-cdk-lib`). For existing v1 projects, ensure `aws-cdk.core` is pinned to a v1 version compatible with `aws-cdk.aws-efs`.
affects: All v1.x versions when used with v2 CDK projects.
deprecatedAWS CDK v1 is in maintenance mode and no longer receives new feature development. Users are strongly encouraged to migrate to AWS CDK v2 for new projects to benefit from active development, consolidated packages, and improved features.
fix
Plan a migration to AWS CDK v2 (`aws-cdk-lib`). The migration guide provides details on necessary code changes.
affects: All v1.x versions.
gotchaEFS File Systems require a VPC and correctly configured security groups for EC2 instances to mount them. Failing to specify a VPC or providing inadequate security group rules will prevent instances from accessing the EFS share.
fix
Always provide a `vpc` property when creating `efs.FileSystem`. Ensure that the security group attached to the EFS mount targets allows inbound TCP port 2049 from the security groups of your EC2 instances.
affects: All versions.
Upgrade
Version history
1.204.0latest on PyPI · released Jun 19, 2023
Audit
Dependencies
aws-cdk.corerequiredRequired for core CDK constructs and app definition in v1.
Agent activity
21 hits · last 30 days
node
20
Amazon
1
Resources
aws-cdk-aws-efs — pip install aws-cdk-aws-efs · libregistry