Skip to content
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

fix(lambda-python): poetry bundling fails on python3.7 #21950

Merged
merged 1 commit into from
Sep 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions packages/@aws-cdk/aws-lambda-python/lib/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,4 @@ RUN mkdir /tmp/poetry-cache && \
# set the poetry cache
ENV POETRY_CACHE_DIR=/tmp/poetry-cache

# create non root user and change allow execute command for non root user
RUN /sbin/useradd -u 1000 user && chmod 711 /

CMD [ "python" ]

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,41 +1,54 @@
{
"version": "20.0.0",
"version": "21.0.0",
"files": {
"c5ecdc350b1c0ecd1962c18d253a073e9284d01d20377458b71dbce88b3fae0d": {
"377b8c7d7d74049daef959af1f7f0f0f2eaeb6ccb4c85fe80f8c00936183b6ff": {
"source": {
"path": "asset.c5ecdc350b1c0ecd1962c18d253a073e9284d01d20377458b71dbce88b3fae0d",
"path": "asset.377b8c7d7d74049daef959af1f7f0f0f2eaeb6ccb4c85fe80f8c00936183b6ff",
"packaging": "zip"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "c5ecdc350b1c0ecd1962c18d253a073e9284d01d20377458b71dbce88b3fae0d.zip",
"objectKey": "377b8c7d7d74049daef959af1f7f0f0f2eaeb6ccb4c85fe80f8c00936183b6ff.zip",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
},
"5a96395d40e1786ddf393dfb827b961680519f476484b507011d2745c82ffd78": {
"f27e50ce3e964bd188b2fad96e1819a8e68a7a7a17e1f701b6bdcc054e29503a": {
"source": {
"path": "asset.5a96395d40e1786ddf393dfb827b961680519f476484b507011d2745c82ffd78",
"path": "asset.f27e50ce3e964bd188b2fad96e1819a8e68a7a7a17e1f701b6bdcc054e29503a",
"packaging": "zip"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "5a96395d40e1786ddf393dfb827b961680519f476484b507011d2745c82ffd78.zip",
"objectKey": "f27e50ce3e964bd188b2fad96e1819a8e68a7a7a17e1f701b6bdcc054e29503a.zip",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
},
"69a465a4b05894359284e409dc3f2cc2208b03b032aa6d6f67b5a327b4b795e3": {
"d165152de494c90bdd8c4aa643a5b1e99b2a5cbacb7f4594319b3b45d6845fd3": {
"source": {
"path": "asset.d165152de494c90bdd8c4aa643a5b1e99b2a5cbacb7f4594319b3b45d6845fd3",
"packaging": "zip"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "d165152de494c90bdd8c4aa643a5b1e99b2a5cbacb7f4594319b3b45d6845fd3.zip",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
},
"5187de9a41f36d4b41ca1553d50265326d21791726e2a3dd0a3201910180fc0f": {
"source": {
"path": "cdk-integ-lambda-python.template.json",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "69a465a4b05894359284e409dc3f2cc2208b03b032aa6d6f67b5a327b4b795e3.json",
"objectKey": "5187de9a41f36d4b41ca1553d50265326d21791726e2a3dd0a3201910180fc0f.json",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"S3Bucket": {
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"S3Key": "c5ecdc350b1c0ecd1962c18d253a073e9284d01d20377458b71dbce88b3fae0d.zip"
"S3Key": "377b8c7d7d74049daef959af1f7f0f0f2eaeb6ccb4c85fe80f8c00936183b6ff.zip"
},
"Role": {
"Fn::GetAtt": [
Expand Down Expand Up @@ -91,7 +91,7 @@
"S3Bucket": {
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"S3Key": "5a96395d40e1786ddf393dfb827b961680519f476484b507011d2745c82ffd78.zip"
"S3Key": "f27e50ce3e964bd188b2fad96e1819a8e68a7a7a17e1f701b6bdcc054e29503a.zip"
},
"Role": {
"Fn::GetAtt": [
Expand All @@ -105,6 +105,59 @@
"DependsOn": [
"myhandlerpython38ServiceRole2049AFF7"
]
},
"myhandlerpython37ServiceRole45CBD18D": {
"Type": "AWS::IAM::Role",
"Properties": {
"AssumeRolePolicyDocument": {
"Statement": [
{
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": "lambda.amazonaws.com"
}
}
],
"Version": "2012-10-17"
},
"ManagedPolicyArns": [
{
"Fn::Join": [
"",
[
"arn:",
{
"Ref": "AWS::Partition"
},
":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
]
]
}
]
}
},
"myhandlerpython37C34039A7": {
"Type": "AWS::Lambda::Function",
"Properties": {
"Code": {
"S3Bucket": {
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"S3Key": "d165152de494c90bdd8c4aa643a5b1e99b2a5cbacb7f4594319b3b45d6845fd3.zip"
},
"Role": {
"Fn::GetAtt": [
"myhandlerpython37ServiceRole45CBD18D",
"Arn"
]
},
"Handler": "index.handler",
"Runtime": "python3.7"
},
"DependsOn": [
"myhandlerpython37ServiceRole45CBD18D"
]
}
},
"Outputs": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":"20.0.0"}
{"version":"21.0.0"}
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
{
"version": "20.0.0",
"version": "21.0.0",
"testCases": {
"integ.function.poetry": {
"poetry/DefaultTest": {
"stacks": [
"cdk-integ-lambda-python"
],
"diffAssets": false,
"stackUpdateWorkflow": false
"stackUpdateWorkflow": false,
"assertionStack": "poetry/DefaultTest/DeployAssert",
"assertionStackName": "poetryDefaultTestDeployAssertE9C9CB8F"
}
},
"synthContext": {},
"enableLookups": false
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "20.0.0",
"version": "21.0.0",
"artifacts": {
"Tree": {
"type": "cdk:tree",
Expand All @@ -23,7 +23,7 @@
"validateOnSynth": false,
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/69a465a4b05894359284e409dc3f2cc2208b03b032aa6d6f67b5a327b4b795e3.json",
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/5187de9a41f36d4b41ca1553d50265326d21791726e2a3dd0a3201910180fc0f.json",
"requiresBootstrapStackVersion": 6,
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
"additionalDependencies": [
Expand Down Expand Up @@ -75,6 +75,18 @@
"data": "Python38FunctionName"
}
],
"/cdk-integ-lambda-python/my_handler_python_37/ServiceRole/Resource": [
{
"type": "aws:cdk:logicalId",
"data": "myhandlerpython37ServiceRole45CBD18D"
}
],
"/cdk-integ-lambda-python/my_handler_python_37/Resource": [
{
"type": "aws:cdk:logicalId",
"data": "myhandlerpython37C34039A7"
}
],
"/cdk-integ-lambda-python/BootstrapVersion": [
{
"type": "aws:cdk:logicalId",
Expand All @@ -89,6 +101,53 @@
]
},
"displayName": "cdk-integ-lambda-python"
},
"poetryDefaultTestDeployAssertE9C9CB8F.assets": {
"type": "cdk:asset-manifest",
"properties": {
"file": "poetryDefaultTestDeployAssertE9C9CB8F.assets.json",
"requiresBootstrapStackVersion": 6,
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version"
}
},
"poetryDefaultTestDeployAssertE9C9CB8F": {
"type": "aws:cloudformation:stack",
"environment": "aws://unknown-account/unknown-region",
"properties": {
"templateFile": "poetryDefaultTestDeployAssertE9C9CB8F.template.json",
"validateOnSynth": false,
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json",
"requiresBootstrapStackVersion": 6,
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
"additionalDependencies": [
"poetryDefaultTestDeployAssertE9C9CB8F.assets"
],
"lookupRole": {
"arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}",
"requiresBootstrapStackVersion": 8,
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version"
}
},
"dependencies": [
"poetryDefaultTestDeployAssertE9C9CB8F.assets"
],
"metadata": {
"/poetry/DefaultTest/DeployAssert/BootstrapVersion": [
{
"type": "aws:cdk:logicalId",
"data": "BootstrapVersion"
}
],
"/poetry/DefaultTest/DeployAssert/CheckBootstrapVersion": [
{
"type": "aws:cdk:logicalId",
"data": "CheckBootstrapVersion"
}
]
},
"displayName": "poetry/DefaultTest/DeployAssert"
}
}
}
Loading