Skip to main content

Amazon EFS assets from Github repositories or S3 buckets

Project description

NPM version PyPI version Release

cdk-efs-assets

CDK construct library to populate Amazon EFS assets from Github or S3.

GithubSourceSync

The GithubSourceSync deploys your Amazon EFS assets from specified Github repository.

Sample

# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
from cdk_efs_assets import GithubSourceSync

app = App()

env = {
    "region": process.env.CDK_DEFAULT_REGION ?? AWS_DEFAULT_REGION,
    "account": process.env.CDK_DEFAULT_ACCOUNT
}

stack = Stack(app, "testing-stack", env=env)

vpc = ec2.Vpc.from_lookup(stack, "Vpc", is_default=True)

fs = efs.FileSystem(stack, "Filesystem",
    vpc=vpc,
    removal_policy=RemovalPolicy.DESTROY
)

efs_access_point = fs.add_access_point("EfsAccessPoint",
    path="/demo",
    create_acl={
        "owner_gid": "1001",
        "owner_uid": "1001",
        "permissions": "0755"
    },
    posix_user={
        "uid": "1001",
        "gid": "1001"
    }
)

# create the one-time sync from Github repository to Amaozn EFS
GithubSourceSync(stack, "GithubSourceSync",
    repository="https://github.com/pahud/cdk-efs-assets.git",
    efs_access_point=efs_access_point,
    runs_after=[fs.mount_targets_available],
    vpc=vpc
)

S3ArchiveSync

The S3ArchiveSync deploys your Amazon EFS assets from a specified zip archive file stored in S3. The extracted contents will be placed into the root directory of the access point.

If the syncOnUpdate property is set to true (defaults to true), then the specified zip file path will be monitored, and if a new object is uploaded to the path, then it will resync the data to EFS. Note that to use this functionality, you must have a CloudTrail Trail in your account that captures the desired S3 write data event.

WARNING: The contents of the access point will be removed before extracting the zip file.

Sample

# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
from cdk_efs_assets import S3ArchiveSync

app = App()

env = {
    "region": process.env.CDK_DEFAULT_REGION ?? AWS_DEFAULT_REGION,
    "account": process.env.CDK_DEFAULT_ACCOUNT
}

stack = Stack(app, "testing-stack", env=env)

vpc = ec2.Vpc.from_lookup(stack, "Vpc", is_default=True)

fs = efs.FileSystem(stack, "Filesystem",
    vpc=vpc,
    removal_policy=RemovalPolicy.DESTROY
)

efs_access_point = fs.add_access_point("EfsAccessPoint",
    path="/demo",
    create_acl={
        "owner_gid": "1001",
        "owner_uid": "1001",
        "permissions": "0755"
    },
    posix_user={
        "uid": "1001",
        "gid": "1001"
    }
)

bucket = Bucket.from_bucket_name(self, "Bucket", "demo-bucket")

# Will sync initial data from compressed S3 archive to EFS, and resync if the zip file in S3 changes
S3ArchiveSync(self, "S3ArchiveSync",
    bucket=bucket,
    zip_file_path="folder/foo.zip",
    vpc=vpc,
    efs_access_point=efs_access_point,
    runs_after=[fs.mount_targets_available]
)

S3SourceSync

TBD

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

cdk-efs-assets-0.1.65.tar.gz (30.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cdk_efs_assets-0.1.65-py3-none-any.whl (29.3 kB view details)

Uploaded Python 3

File details

Details for the file cdk-efs-assets-0.1.65.tar.gz.

File metadata

  • Download URL: cdk-efs-assets-0.1.65.tar.gz
  • Upload date:
  • Size: 30.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.7.9

File hashes

Hashes for cdk-efs-assets-0.1.65.tar.gz
Algorithm Hash digest
SHA256 5fc15be5f5e220e94ab64086ee94f1549bb92958820c86536a19c04156974b2a
MD5 1ca1d82eb0430387a2e6ac65f796c95b
BLAKE2b-256 f80bce0824c706fe8b8858cfbe858bac252e8f638e0efb0d15514bc41998f795

See more details on using hashes here.

File details

Details for the file cdk_efs_assets-0.1.65-py3-none-any.whl.

File metadata

  • Download URL: cdk_efs_assets-0.1.65-py3-none-any.whl
  • Upload date:
  • Size: 29.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.7.9

File hashes

Hashes for cdk_efs_assets-0.1.65-py3-none-any.whl
Algorithm Hash digest
SHA256 662099f0cdba9846d1c19816de2b1b29ca682f1de35b66bdc59dce5f54a782fd
MD5 770753eba47201c4025e9621ca52e86e
BLAKE2b-256 1fb257de5ef235017b54b3c65ef6670e40e77db96104d3e7cab6994c3ae4b98b

See more details on using hashes here.

Supported by

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