Skip to main content

cdk-aws-ec2-efs

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cdk-aws-ec2-efs-0.0.2.tar.gz (27.5 kB view details)

Uploaded Source

Built Distribution

cdk_aws_ec2_efs-0.0.2-py3-none-any.whl (26.1 kB view details)

Uploaded Python 3

File details

Details for the file cdk-aws-ec2-efs-0.0.2.tar.gz.

File metadata

  • Download URL: cdk-aws-ec2-efs-0.0.2.tar.gz
  • Upload date:
  • Size: 27.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.0

File hashes

Hashes for cdk-aws-ec2-efs-0.0.2.tar.gz
Algorithm Hash digest
SHA256 83d1062fa202a6f98197c42010d82b075a99ae2ee281ba31c8b0569d9faf1792
MD5 fe7d50df161b1934d5206ccc9ee39503
BLAKE2b-256 8b7c7e089bf9bcb9dcb84c77da1c9aaa67ee5d43b6f8e88bf7971fe5d290865d

See more details on using hashes here.

File details

Details for the file cdk_aws_ec2_efs-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for cdk_aws_ec2_efs-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ecf124231ba68d61155e7539ed928ca6a5371c850c7debc5a65b305c43904e63
MD5 ae945b5ed152d6201240a35ab7e47a7a
BLAKE2b-256 159d4165f429832e2db99bc66e7eeb1e2731d0e3e7942817e1df400da6704830

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page