(aws-lambda-python-alpha): Bundling Options do not include PIP_TRUSTED_HOST, and do not get passed to bundling #29732
Labels
@aws-cdk/aws-lambda-python
bug
This issue is a bug.
effort/small
Small work item – less than a day of effort
p3
Describe the bug
Bundling arguments for a PythonLayerVersion do not work as expected. When specifying a
PIP_INDEX_URL
, I am unable to specifyPIP_TRUSTED_HOST
.Additionally, any configured indexes are not passed to the bundling stage.
Expected Behavior
Passing
PIP_TRUSTED_HOST
as a build argument allows full use of a mirrored pip repository.When passing
PIP_TRUSTED_HOST
andPIP_INDEX_URL
as a build argument, it get's passed to the pip install of therequirements.txt
fileCurrent Behavior
Passing
PIP_TRUSTED_HOST
does nothing.When configuring
PIP_INDEX_URL
, it passes the pipenv install, but does not get passed to the requirements.txt installReproduction Steps
Possible Solution
Update https://github.com/aws/aws-cdk/blob/v2.135.0/packages/%40aws-cdk/aws-lambda-python-alpha/lib/Dockerfile#L8 to include
ARG PIP_TRUSTED_HOST
Possibly add in a flag in Bundling Options for passing through the build_args into the pip3 install phase. This would be intended to prevent the need to duplicate the mirror information for both the pipenv install and the requirementst.txt install; in theory both would always use the same mirror, but having a flag that defaults to true just in case.
If true, it can simply turn the build_args into export statements in the before_bundling list.
Additional Information/Context
No response
CDK CLI Version
2.118.0
Framework Version
No response
Node.js Version
16.16.0
OS
Amazon Linux 2
Language
Python
Language Version
3.7
Other information
No response
The text was updated successfully, but these errors were encountered: