Skip to content

(aws-lambda-python): Asset bundling fails on Windows #18861

Closed
@gshpychka

Description

What is the problem?

aws-lambda-python does not work, bundling fails.

Reproduction Steps

Use the PythonFunction construct. Peform a synth.

Code excerpt:

        lambda_python.PythonFunction(
            self,
            "my_func",
            entry=os.path.join("src", "my_lambda"),
            handler="handler",
            index="my_index.py",
            runtime=typing.cast(lambda_.Runtime, lambda_.Runtime.PYTHON_3_9)
        )

What did you expect to happen?

The lambda is bundled successfully.

What actually happened?

Error during synth:
cp: cannot copy a directory, '/asset_input/', into itself, 'asset-output'.
Error: Failed to bundle asset ...

CDK CLI Version

2.10.0

Framework Version

2.10.0

Node.js Version

16.13.0

OS

Windows

Language

Python

Language Version

No response

Other information

The same works on Linux somehow. This is related - #18301

Pinning aws-cdk.aws-lambda-python-alpha==2.3.0a0 solves the issue.

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions