-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
aws_cdk.aws_lambda_python_alpha: Enforced 'image' argument when using bundling in PythonLayerVersion #24859
Comments
Unfortunately I can't reproduce this error. My code: from aws_cdk import (
Stack, RemovalPolicy,
aws_lambda as _lambda,
aws_lambda_python_alpha as _alambda,
)
from constructs import Construct
class IssueTriagePyStack(Stack):
def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None:
super().__init__(scope, construct_id, **kwargs)
lambda_layer = _alambda.PythonLayerVersion(
self,
"LambdaLayer_test-layer",
layer_version_name="test-layer",
entry='./assets.d',
compatible_runtimes=[_lambda.Runtime.PYTHON_3_9],
removal_policy=RemovalPolicy.DESTROY,
bundling=_alambda.BundlingOptions(
environment={"PIP_INDEX_URL": "dummyURL"},
),
) I am using CDK 2.70.0. I am leaving this issue open as p2 and we probably need more report before we can address this issue. |
Unfortunately I am also unable to reproduce this error with the following code: from aws_cdk import (
Stack, RemovalPolicy,
aws_lambda as _lambda,
aws_lambda_python_alpha as _alambda
)
from constructs import Construct
class IssueEnforceImageStack(Stack):
def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None:
super().__init__(scope, construct_id, **kwargs)
lambda_layer = _alambda.PythonLayerVersion(
self,
"LambdaLayer_test-layer",
layer_version_name="test-layer",
entry='./lambda',
compatible_runtimes=[_lambda.Runtime.PYTHON_3_9],
removal_policy=RemovalPolicy.DESTROY,
bundling=_alambda.BundlingOptions(
environment={"PIP_INDEX_URL": "https://pypi.org/simple"},
),
) I am using CDK 2.140.0. Since this issue has been open for almost a year now without further comment, and is not able to be reproduced with the information given, I am closing it. If the issue persists, please feel free to open a new issue. |
|
Describe the bug
According to the documentation present HERE, the following code should work, since in no place it is said that
image
is a mandatory argument ofbundling
.But to fix the error you need to add an
image
argument so the code becomes like this:Expected Behavior
I think the code should work without the need to provide an
image
argument. If you can create aPythonLayerVersion
using the public PyPI by just specifying your Python packages in arequirements.txt
file that you provide asentry
argument, then why it cannot be the same for an AWS CodeArtifact private PyPI? I honestly don't get it.Current Behavior
TypeError: __init__() missing 1 required keyword-only argument: 'image'
Reproduction Steps
See snippets provided in bug description.
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.70.0
Framework Version
No response
Node.js Version
19.4.0
OS
Windows 11 22H2
Language
Python
Language Version
Python 3.9
Other information
No response
The text was updated successfully, but these errors were encountered: