Skip to main content

AWS CDK custom resource that handles large files deployment to S3 bucket.

Project description

B.CfnS3LargeDeployment

b-cfn-s3-large-deployment - AWS CDK custom resource that handles large files deployment to S3 bucket.

Description

This custom resource is deploys local files or S3 bucket objects to a destination bucket retaining their file-system hierarchy.

Two types of deployment sources are available:

  • BucketDeploymentSource - uses another S3 bucket object(-s) as source for the deployment to a destination bucket. Only files up to 5TB are supported due to S3 bucket limitations;
  • AssetDeploymentSource - uses aws-cdk.aws-s3-assets lib to deploy local files as .zip files to assets bucket from which extracted contents are moved to the destination bucket. Asset files more than 2GB in size are not supported.

See "Known limits" sections below for more information on this resource limitations.

This resource implementation is based on GitHub pull-request https://github.com/aws/aws-cdk/pull/15220.

Remarks

Biomapas aims to modernise life-science industry by sharing its IT knowledge with other companies and the community.

Related technology

  • Python 3.8
  • Amazon Web Services (AWS)

Assumptions

The project assumes that the person working with it have basic knowledge in python programming.

Useful sources

See code documentation for any additional sources and references. Also see aws-cdk.s3-deployment library for more information as this implementation is based on work done there.

Install

Use the package manager pip to install this package. This project is not in the PyPi repository yet. Install directly from source or PyPI.

pip install .

Or

pip install b-cfn-s3-large-deployment

Usage & Examples

from aws_cdk.core import App, Stack, Construct
from aws_cdk.aws_s3 import Bucket

from b_cfn_s3_large_deployment.resource import S3LargeDeploymentResource
from b_cfn_s3_large_deployment.deployment_props import DeploymentProps
from b_cfn_s3_large_deployment.deployment_source import AssetDeploymentSource, BucketDeploymentSource


class ExampleStack(Stack):
    def __init__(self, scope: Construct):
        super().__init__(...)

        S3LargeDeploymentResource(
            scope=self,
            name='ExampleLargeDeployment',
            props=DeploymentProps(
                sources=[
                    AssetDeploymentSource(path='/path/to/your/local/directory'),
                    AssetDeploymentSource(path='/path/to/your/local/zip/file.zip'),
                    BucketDeploymentSource(
                      bucket=..., 
                      zip_object_key='your-source-bucket-object-key'
                    ),
                    ...
                ],
                destination_bucket=Bucket(...),
                ...
            )
        )

        ...


app = App()
ExampleStack(app, "ExampleStack")

app.synth()

Known limits

  • aws_cdk.aws_s3_assets.Asset supports up to 2GB/asset (limited by NodeJS implementation).
  • S3 bucket supports up to 5TB objects.

Testing

No throughout testing is yet implemented - only a single integration test, checking the success of cdk synth command.

Contribution

Found a bug? Want to add or suggest a new feature? Contributions of any kind are gladly welcome. Contact your direct supervisor, create a pull-request or an issue in Jira platform.

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

b-cfn-s3-large-deployment-1.0.0.tar.gz (16.7 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file b-cfn-s3-large-deployment-1.0.0.tar.gz.

File metadata

  • Download URL: b-cfn-s3-large-deployment-1.0.0.tar.gz
  • Upload date:
  • Size: 16.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.8.11

File hashes

Hashes for b-cfn-s3-large-deployment-1.0.0.tar.gz
Algorithm Hash digest
SHA256 5dec39be5df46064b3afbe8e13e841703e047a99a3fe345fcb58cda503abfa1b
MD5 430aed3af039a5eb19532128a16a274b
BLAKE2b-256 64024144d661d5708a89a8c40e4c1160f7b4197e611cac4c25b5485a54aa1638

See more details on using hashes here.

File details

Details for the file b_cfn_s3_large_deployment-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: b_cfn_s3_large_deployment-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 18.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.8.11

File hashes

Hashes for b_cfn_s3_large_deployment-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 79ba1113103f52cebc86ed67b423e979e09ee73337e38d8a369d1ec4151db3ad
MD5 7016bdcf510479ff6a82a0f4d8fe1d91
BLAKE2b-256 8153411eb8bd6ac62d66c7a34a54118dcbb62cd08e4c7e58590464604d5a4894

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