Skip to main content

EC2 with EFS AWS CDK construct

npm version PyPI version

This Construct provides an easy way to mount an EFS on EC2 in AWS CDK.

It will inject mount commands as user data script to EC2. And the EFS will be mounted after initializing.

Installation

JavaScript & TypeScript

npm i cdk-aws-ec2-efs

Python

pip install cdk-aws-ec2-efs

Usage

Create an AWS CDK project, in your application stack create EC2 and EFS resources. Note EC2 and EFS must be in the same VPC so EC2 can reach EFS. Then use the construct to mount EFS to EC2:

    const fileSystem = new cdk.aws_efs.FileSystem(this, "fileSystem", {
      ...
    });
    const ec2Instance = new ec2.Instance(this, "ec2-instance", {
      ...
    });
    new Ec2WithEfs(this, "EfsMount", {
      instance: ec2Instance,
      fileSystem: fileSystem,
      configureConnection: true,
    });

In the above example we pass configureConnection as true, This tell construct to take care of adding rules to EFS security groups to enable EC2 access.

Refer to API.md for full documentation.

Metadata

Release files for cdk-aws-ec2-efs 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cdk-aws-ec2-efs 0.0.3
File Size Uploaded Provenance
cdk-aws-ec2-efs-0.0.3.tar.gz 27.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for cdk-aws-ec2-efs 0.0.3
File Interpreter ABI Platform
cdk_aws_ec2_efs-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 54.0 kB

Release files / cdk-aws-ec2-efs-0.0.3.tar.gz

Download URL cdk-aws-ec2-efs-0.0.3.tar.gz
Size 27.7 kB
Tags Source
SHA-256 checksum
How to use checksums
f961646cf74b785a5dedd0a0514fd9cc58dc7964b1b585547a9484a4e084aad5
BLAKE2b-256 checksum
How to use checksums
869d1182c89d8a2409552a7520f92a20063778c97d1ed9464201c9188e1fd6d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.0

Release files / cdk_aws_ec2_efs-0.0.3-py3-none-any.whl

Download URL cdk_aws_ec2_efs-0.0.3-py3-none-any.whl
Size 26.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d6e420467c61fc15c5af2858087f43e0e0ae0245bdc8d1f3069e09292b914d70
BLAKE2b-256 checksum
How to use checksums
bac2535a8fa6edda4b89d582d385314c78dbb8ed76c1a5f460d133a841736cfd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.0

Security for cdk-aws-ec2-efs 0.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page