Skip to content

aws_lambda_python_alpha: Using PIP_INDEX_URL and Codeartifact cause Docker to rebuild lambda every synth #27331

@kcp-chewie

Description

@kcp-chewie

Describe the bug

When following the instructions for using CodeArtifact, the lambda artifact is rebuilt anytime the CodeArtifact token changes, despite the actual code not changing at all.

Expected Behavior

The lambda shouldn't be rebuilt unless the actual code changes.

Current Behavior

The lambda is rebuilt with a new hash, which causes an unnecessary redeploy. This slows down the synth and deploy steps, and causes cold starts for all lambdas.

Reproduction Steps

Define any lambda function using the Custom Bundling with Code Artifact instructions. Observe that the lambda is rebuilt on each synth, even with no code changes.

Possible Solution

The Token included in the CodeArtifact URL should be ignored when computing the hash that determines if the lambda is rebuilt. Alternately, provide an option to ignore the PIP_INDEX_URL entirely.

Additional Information/Context

No response

CDK CLI Version

2.95.1

Framework Version

No response

Node.js Version

v20.6.1

OS

OSX 12.2

Language

Python

Language Version

Python 3.9.16

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions