Metadata-Version: 2.1
Name: aws-cdk.aws-efs
Version: 1.32.1
Summary: The CDK Construct Library for AWS::EFS
Home-page: https://github.com/aws/aws-cdk
Author: Amazon Web Services
License: Apache-2.0
Project-URL: Source, https://github.com/aws/aws-cdk.git
Description: ## Amazon Elastic File System Construct Library
        
        <!--BEGIN STABILITY BANNER-->---
        
        
        ![Stability: Experimental](https://img.shields.io/badge/stability-Experimental-important.svg?style=for-the-badge)
        
        > **This is a *developer preview* (public beta) module.**
        >
        > All classes with the `Cfn` prefix in this module ([CFN Resources](https://docs.aws.amazon.com/cdk/latest/guide/constructs.html#constructs_lib))
        > are auto-generated from CloudFormation. They are stable and safe to use.
        >
        > However, all other classes, i.e., higher level constructs, are under active development and subject to non-backward
        > compatible changes or removal in any future version. These are not subject to the [Semantic Versioning](https://semver.org/) model.
        > This means that while you may use them, you may need to update your source code when upgrading to a newer version of this package.
        
        ---
        <!--END STABILITY BANNER-->
        
        This construct library allows you to set up AWS Elastic File System (EFS).
        
        ```python
        # Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
        import aws_cdk.aws_efs as efs
        
        my_vpc = ec2.Vpc(self, "VPC")
        file_system = efs.EfsFileSystem(self, "MyEfsFileSystem",
            vpc=my_vpc,
            encrypted=True,
            lifecycle_policy=EfsLifecyclePolicyProperty.AFTER_14_DAYS,
            performance_mode=EfsPerformanceMode.GENERAL_PURPOSE,
            throughput_mode=EfsThroughputMode.BURSTING
        )
        ```
        
        ### Connecting
        
        To control who can access the EFS, use the `.connections` attribute. EFS has
        a fixed default port, so you don't need to specify the port:
        
        ```python
        # Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
        file_system.connections.allow_default_port_from(instance)
        ```
        
        ### Mounting the file system using User Data
        
        In order to automatically mount this file system during instance launch,
        following code can be used as reference:
        
        ```
        const vpc = new ec2.Vpc(this, 'VPC');
        
        const fileSystem = new efs.EfsFileSystem(this, 'EfsFileSystem', {
          vpc,
          encrypted: true,
          lifecyclePolicy: efs.EfsLifecyclePolicyProperty.AFTER_14_DAYS,
          performanceMode: efs.EfsPerformanceMode.GENERAL_PURPOSE,
          throughputMode: efs.EfsThroughputMode.BURSTING
        });
        
        const inst = new Instance(this, 'inst', {
          instanceType: InstanceType.of(InstanceClass.T2, InstanceSize.LARGE),
          machineImage: new AmazonLinuxImage({
            generation: AmazonLinuxGeneration.AMAZON_LINUX_2
          }),
          vpc,
          vpcSubnets: {
            subnetType: SubnetType.PUBLIC,
          }
        });
        
        fileSystem.connections.allowDefaultPortFrom(inst);
        
        inst.userData.addCommands("yum check-update -y",    // Ubuntu: apt-get -y update
          "yum upgrade -y",                                 // Ubuntu: apt-get -y upgrade
          "yum install -y amazon-efs-utils",                // Ubuntu: apt-get -y install amazon-efs-utils
          "yum install -y nfs-utils",                       // Ubuntu: apt-get -y install nfs-common
          "file_system_id_1=" + fileSystem.fileSystemId,
          "efs_mount_point_1=/mnt/efs/fs1",
          "mkdir -p \"${efs_mount_point_1}\"",
          "test -f \"/sbin/mount.efs\" && echo \"${file_system_id_1}:/ ${efs_mount_point_1} efs defaults,_netdev\" >> /etc/fstab || " +
          "echo \"${file_system_id_1}.efs." + cdk.Stack.of(this).region + ".amazonaws.com:/ ${efs_mount_point_1} nfs4 nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport,_netdev 0 0\" >> /etc/fstab",
          "mount -a -t efs,nfs4 defaults");
        ```
        
        This module is part of the [AWS Cloud Development Kit](https://github.com/aws/aws-cdk) project.
        
Platform: UNKNOWN
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: JavaScript
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Typing :: Typed
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved
Requires-Python: >=3.6
Description-Content-Type: text/markdown
