Skip to content

Commit adc5b5e

Browse files
authored
Merge pull request #10 from BMorinDrifter/python3.11
Update to Python 3.11 and set POWERTOOLS_SERVICE_NAME for Python Lambda functions
2 parents a8bc8b1 + 355d18b commit adc5b5e

File tree

3 files changed

+67
-62
lines changed

3 files changed

+67
-62
lines changed

CustomIdentityComponent/lib/custom_identity_component-stack.ts

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -101,19 +101,20 @@ export class CustomIdentityComponentStack extends Stack {
101101
role: generate_keys_function_role,
102102
code: lambda.Code.fromAsset("lambda", {
103103
bundling: {
104-
image: lambda.Runtime.PYTHON_3_10.bundlingImage,
104+
image: lambda.Runtime.PYTHON_3_11.bundlingImage,
105105
command: [
106106
'bash', '-c',
107-
'pip install --platform manylinux2010_x86_64 --only-binary=:all: -r requirements.txt -t /asset-output && cp -ru . /asset-output'
107+
'pip install --platform manylinux2014_x86_64 --only-binary=:all: -r requirements.txt -t /asset-output && cp -ru . /asset-output'
108108
],
109109
},}),
110-
runtime: lambda.Runtime.PYTHON_3_10,
110+
runtime: lambda.Runtime.PYTHON_3_11,
111111
handler: 'generate_keys.lambda_handler',
112112
timeout: Duration.seconds(300),
113113
memorySize: 2048,
114114
environment: {
115115
"ISSUER_BUCKET": issuer_bucket.bucketName,
116116
"ISSUER_ENDPOINT": "https://"+distribution.domainName,
117+
"POWERTOOLS_SERVICE_NAME": "CustomIdentityComponentApi",
117118
"SECRET_KEY_ID": secret.secretName,
118119
}
119120
});
@@ -254,19 +255,20 @@ export class CustomIdentityComponentStack extends Stack {
254255
role: login_as_guest_function_role,
255256
code: lambda.Code.fromAsset("lambda", {
256257
bundling: {
257-
image: lambda.Runtime.PYTHON_3_10.bundlingImage,
258+
image: lambda.Runtime.PYTHON_3_11.bundlingImage,
258259
command: [
259260
'bash', '-c',
260-
'pip install --platform manylinux2010_x86_64 --only-binary=:all: -r requirements.txt -t /asset-output && cp -ru . /asset-output'
261+
'pip install --platform manylinux2014_x86_64 --only-binary=:all: -r requirements.txt -t /asset-output && cp -ru . /asset-output'
261262
],
262263
},}),
263-
runtime: lambda.Runtime.PYTHON_3_10,
264+
runtime: lambda.Runtime.PYTHON_3_11,
264265
handler: 'login_as_guest.lambda_handler',
265266
timeout: Duration.seconds(15),
266267
tracing: lambda.Tracing.ACTIVE,
267268
memorySize: 2048,
268269
environment: {
269270
"ISSUER_URL": "https://"+distribution.domainName,
271+
"POWERTOOLS_SERVICE_NAME": "CustomIdentityComponentApi",
270272
"SECRET_KEY_ID": secret.secretName,
271273
"USER_TABLE": user_table.tableName
272274
}
@@ -300,19 +302,20 @@ export class CustomIdentityComponentStack extends Stack {
300302
role: refresh_access_token_function_role,
301303
code: lambda.Code.fromAsset("lambda", {
302304
bundling: {
303-
image: lambda.Runtime.PYTHON_3_10.bundlingImage,
305+
image: lambda.Runtime.PYTHON_3_11.bundlingImage,
304306
command: [
305307
'bash', '-c',
306-
'pip install --platform manylinux2010_x86_64 --only-binary=:all: -r requirements.txt -t /asset-output && cp -ru . /asset-output'
308+
'pip install --platform manylinux2014_x86_64 --only-binary=:all: -r requirements.txt -t /asset-output && cp -ru . /asset-output'
307309
],
308310
},}),
309-
runtime: lambda.Runtime.PYTHON_3_10,
311+
runtime: lambda.Runtime.PYTHON_3_11,
310312
handler: 'refresh_access_token.lambda_handler',
311313
timeout: Duration.seconds(15),
312314
tracing: lambda.Tracing.ACTIVE,
313315
memorySize: 2048,
314316
environment: {
315317
"ISSUER_URL": "https://"+distribution.domainName,
318+
"POWERTOOLS_SERVICE_NAME": "CustomIdentityComponentApi",
316319
"SECRET_KEY_ID": secret.secretName,
317320
"USER_TABLE": user_table.tableName
318321
}
@@ -380,19 +383,20 @@ export class CustomIdentityComponentStack extends Stack {
380383
role: loginWithAppleIdFunctionRole,
381384
code: lambda.Code.fromAsset("lambda", {
382385
bundling: {
383-
image: lambda.Runtime.PYTHON_3_10.bundlingImage,
386+
image: lambda.Runtime.PYTHON_3_11.bundlingImage,
384387
command: [
385388
'bash', '-c',
386-
'pip install --platform manylinux2010_x86_64 --only-binary=:all: -r requirements.txt -t /asset-output && cp -ru . /asset-output'
389+
'pip install --platform manylinux2014_x86_64 --only-binary=:all: -r requirements.txt -t /asset-output && cp -ru . /asset-output'
387390
],
388391
},}),
389-
runtime: lambda.Runtime.PYTHON_3_10,
392+
runtime: lambda.Runtime.PYTHON_3_11,
390393
handler: 'login_with_apple_id.lambda_handler',
391394
timeout: Duration.seconds(15),
392395
tracing: lambda.Tracing.ACTIVE,
393396
memorySize: 2048,
394397
environment: {
395398
"ISSUER_URL": "https://"+distribution.domainName,
399+
"POWERTOOLS_SERVICE_NAME": "CustomIdentityComponentApi",
396400
"SECRET_KEY_ID": secret.secretName,
397401
"USER_TABLE": user_table.tableName,
398402
"APPLE_APP_ID": appId,
@@ -440,19 +444,20 @@ export class CustomIdentityComponentStack extends Stack {
440444
role: loginWithSteamIdFunctionRole,
441445
code: lambda.Code.fromAsset("lambda", {
442446
bundling: {
443-
image: lambda.Runtime.PYTHON_3_10.bundlingImage,
447+
image: lambda.Runtime.PYTHON_3_11.bundlingImage,
444448
command: [
445449
'bash', '-c',
446-
'pip install --platform manylinux2010_x86_64 --only-binary=:all: -r requirements.txt -t /asset-output && cp -ru . /asset-output'
450+
'pip install --platform manylinux2014_x86_64 --only-binary=:all: -r requirements.txt -t /asset-output && cp -ru . /asset-output'
447451
],
448452
},}),
449-
runtime: lambda.Runtime.PYTHON_3_10,
453+
runtime: lambda.Runtime.PYTHON_3_11,
450454
handler: 'login_with_steam.lambda_handler',
451455
timeout: Duration.seconds(15),
452456
tracing: lambda.Tracing.ACTIVE,
453457
memorySize: 2048,
454458
environment: {
455459
"ISSUER_URL": "https://"+distribution.domainName,
460+
"POWERTOOLS_SERVICE_NAME": "CustomIdentityComponentApi",
456461
"SECRET_KEY_ID": privateKeySecret.secretName,
457462
"USER_TABLE": user_table.tableName,
458463
"STEAM_APP_ID": appId,
@@ -510,19 +515,20 @@ export class CustomIdentityComponentStack extends Stack {
510515
role: loginWithGooglePlayFunctionRole,
511516
code: lambda.Code.fromAsset("lambda", {
512517
bundling: {
513-
image: lambda.Runtime.PYTHON_3_10.bundlingImage,
518+
image: lambda.Runtime.PYTHON_3_11.bundlingImage,
514519
command: [
515520
'bash', '-c',
516-
'pip install --platform manylinux2010_x86_64 --only-binary=:all: -r requirements.txt -t /asset-output && cp -ru . /asset-output'
521+
'pip install --platform manylinux2014_x86_64 --only-binary=:all: -r requirements.txt -t /asset-output && cp -ru . /asset-output'
517522
],
518523
},}),
519-
runtime: lambda.Runtime.PYTHON_3_10,
524+
runtime: lambda.Runtime.PYTHON_3_11,
520525
handler: 'login_with_google_play.lambda_handler',
521526
timeout: Duration.seconds(15),
522527
tracing: lambda.Tracing.ACTIVE,
523528
memorySize: 2048,
524529
environment: {
525530
"ISSUER_URL": "https://"+distribution.domainName,
531+
"POWERTOOLS_SERVICE_NAME": "CustomIdentityComponentApi",
526532
"SECRET_KEY_ID": privateKeySecret.secretName,
527533
"USER_TABLE": user_table.tableName,
528534
"GOOGLE_PLAY_CLIENT_ID": googlePlayClientId,
@@ -579,19 +585,20 @@ export class CustomIdentityComponentStack extends Stack {
579585
role: loginWithFacebookFunctionRole,
580586
code: lambda.Code.fromAsset("lambda", {
581587
bundling: {
582-
image: lambda.Runtime.PYTHON_3_10.bundlingImage,
588+
image: lambda.Runtime.PYTHON_3_11.bundlingImage,
583589
command: [
584590
'bash', '-c',
585-
'pip install --platform manylinux2010_x86_64 --only-binary=:all: -r requirements.txt -t /asset-output && cp -ru . /asset-output'
591+
'pip install --platform manylinux2014_x86_64 --only-binary=:all: -r requirements.txt -t /asset-output && cp -ru . /asset-output'
586592
],
587593
},}),
588-
runtime: lambda.Runtime.PYTHON_3_10,
594+
runtime: lambda.Runtime.PYTHON_3_11,
589595
handler: 'login_with_facebook.lambda_handler',
590596
timeout: Duration.seconds(15),
591597
tracing: lambda.Tracing.ACTIVE,
592598
memorySize: 2048,
593599
environment: {
594600
"ISSUER_URL": "https://"+distribution.domainName,
601+
"POWERTOOLS_SERVICE_NAME": "CustomIdentityComponentApi",
595602
"SECRET_KEY_ID": secret.secretName,
596603
"USER_TABLE": user_table.tableName,
597604
"FACEBOOK_APP_ID" : appId,

CustomIdentityComponent/package-lock.json

Lines changed: 38 additions & 40 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CustomIdentityComponent/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"typescript": "~3.9.7"
2121
},
2222
"dependencies": {
23-
"aws-cdk-lib": "^2.78.0",
23+
"aws-cdk-lib": "^2.97.0",
2424
"cdk": "^2.81.0-alpha.0",
2525
"cdk-nag": "^2.27.24",
2626
"constructs": "^10.0.0",

0 commit comments

Comments
 (0)