cdk-aws-ec2-efs
Project description
EC2 with EFS AWS CDK construct
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
Built Distribution
File details
Details for the file cdk-aws-ec2-efs-0.0.3.tar.gz
.
File metadata
- Download URL: cdk-aws-ec2-efs-0.0.3.tar.gz
- Upload date:
- Size: 27.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f961646cf74b785a5dedd0a0514fd9cc58dc7964b1b585547a9484a4e084aad5 |
|
MD5 | c60de8ecd93ba3e8fb0fa51d4e6ac372 |
|
BLAKE2b-256 | 869d1182c89d8a2409552a7520f92a20063778c97d1ed9464201c9188e1fd6d5 |
File details
Details for the file cdk_aws_ec2_efs-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: cdk_aws_ec2_efs-0.0.3-py3-none-any.whl
- Upload date:
- Size: 26.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6e420467c61fc15c5af2858087f43e0e0ae0245bdc8d1f3069e09292b914d70 |
|
MD5 | 85ef0429eaba54ff32586a40a90478a4 |
|
BLAKE2b-256 | bac2535a8fa6edda4b89d582d385314c78dbb8ed76c1a5f460d133a841736cfd |