Skip to content

Instantly share code, notes, and snippets.

@CarlosDomingues
Last active February 13, 2024 22:22
Show Gist options
  • Select an option

  • Save CarlosDomingues/09cf89f29c9c4c4f39e8ac2d1764a7ee to your computer and use it in GitHub Desktop.

Select an option

Save CarlosDomingues/09cf89f29c9c4c4f39e8ac2d1764a7ee to your computer and use it in GitHub Desktop.

Revisions

  1. CarlosDomingues revised this gist Jan 12, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion local_bundler.py
    Original file line number Diff line number Diff line change
    @@ -23,6 +23,6 @@ def try_bundle(self, output_dir: str, options: BundlingOptions) -> bool:
    image=BundlingDockerImage.from_registry(
    "dummy"
    ), # We are not going to use Docker Bundling, but the image parameter needs to be set.
    local=local_poetry_bundler,
    local=my_local_bundler,
    ),
    )
  2. CarlosDomingues revised this gist Jan 12, 2021. No changes.
  3. CarlosDomingues revised this gist Jan 12, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion local_bundler.py
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@
    BundlingOptions,
    ILocalBundling
    )

    from aws_cdk.aws_lambda import Code
    from jsii import implements, member

    @implements(ILocalBundling)
  4. CarlosDomingues created this gist Jan 12, 2021.
    28 changes: 28 additions & 0 deletions local_bundler.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,28 @@
    from aws_cdk.core import (
    BundlingDockerImage,
    BundlingOptions,
    ILocalBundling
    )

    from jsii import implements, member

    @implements(ILocalBundling)
    class MyLocalBundler:
    @member(jsii_name="tryBundle")
    def try_bundle(self, output_dir: str, options: BundlingOptions) -> bool:
    # ... do stuff, return bool ...
    return True

    my_local_bundler = MyLocalBundler()

    my_code = Code.from_asset(
    path=path.join(".."),
    exclude=["*.pyc"],
    asset_hash_type=AssetHashType.BUNDLE,
    bundling=BundlingOptions(
    image=BundlingDockerImage.from_registry(
    "dummy"
    ), # We are not going to use Docker Bundling, but the image parameter needs to be set.
    local=local_poetry_bundler,
    ),
    )