Skip to content

Commit

Permalink
Merge pull request #10 from BMorinDrifter/python3.11
Browse files Browse the repository at this point in the history
Update to Python 3.11 and set POWERTOOLS_SERVICE_NAME for Python Lambda functions
  • Loading branch information
juhoaws authored Sep 25, 2023
2 parents a8bc8b1 + 355d18b commit adc5b5e
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 62 deletions.
49 changes: 28 additions & 21 deletions CustomIdentityComponent/lib/custom_identity_component-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,19 +101,20 @@ export class CustomIdentityComponentStack extends Stack {
role: generate_keys_function_role,
code: lambda.Code.fromAsset("lambda", {
bundling: {
image: lambda.Runtime.PYTHON_3_10.bundlingImage,
image: lambda.Runtime.PYTHON_3_11.bundlingImage,
command: [
'bash', '-c',
'pip install --platform manylinux2010_x86_64 --only-binary=:all: -r requirements.txt -t /asset-output && cp -ru . /asset-output'
'pip install --platform manylinux2014_x86_64 --only-binary=:all: -r requirements.txt -t /asset-output && cp -ru . /asset-output'
],
},}),
runtime: lambda.Runtime.PYTHON_3_10,
runtime: lambda.Runtime.PYTHON_3_11,
handler: 'generate_keys.lambda_handler',
timeout: Duration.seconds(300),
memorySize: 2048,
environment: {
"ISSUER_BUCKET": issuer_bucket.bucketName,
"ISSUER_ENDPOINT": "https://"+distribution.domainName,
"POWERTOOLS_SERVICE_NAME": "CustomIdentityComponentApi",
"SECRET_KEY_ID": secret.secretName,
}
});
Expand Down Expand Up @@ -254,19 +255,20 @@ export class CustomIdentityComponentStack extends Stack {
role: login_as_guest_function_role,
code: lambda.Code.fromAsset("lambda", {
bundling: {
image: lambda.Runtime.PYTHON_3_10.bundlingImage,
image: lambda.Runtime.PYTHON_3_11.bundlingImage,
command: [
'bash', '-c',
'pip install --platform manylinux2010_x86_64 --only-binary=:all: -r requirements.txt -t /asset-output && cp -ru . /asset-output'
'pip install --platform manylinux2014_x86_64 --only-binary=:all: -r requirements.txt -t /asset-output && cp -ru . /asset-output'
],
},}),
runtime: lambda.Runtime.PYTHON_3_10,
runtime: lambda.Runtime.PYTHON_3_11,
handler: 'login_as_guest.lambda_handler',
timeout: Duration.seconds(15),
tracing: lambda.Tracing.ACTIVE,
memorySize: 2048,
environment: {
"ISSUER_URL": "https://"+distribution.domainName,
"POWERTOOLS_SERVICE_NAME": "CustomIdentityComponentApi",
"SECRET_KEY_ID": secret.secretName,
"USER_TABLE": user_table.tableName
}
Expand Down Expand Up @@ -300,19 +302,20 @@ export class CustomIdentityComponentStack extends Stack {
role: refresh_access_token_function_role,
code: lambda.Code.fromAsset("lambda", {
bundling: {
image: lambda.Runtime.PYTHON_3_10.bundlingImage,
image: lambda.Runtime.PYTHON_3_11.bundlingImage,
command: [
'bash', '-c',
'pip install --platform manylinux2010_x86_64 --only-binary=:all: -r requirements.txt -t /asset-output && cp -ru . /asset-output'
'pip install --platform manylinux2014_x86_64 --only-binary=:all: -r requirements.txt -t /asset-output && cp -ru . /asset-output'
],
},}),
runtime: lambda.Runtime.PYTHON_3_10,
runtime: lambda.Runtime.PYTHON_3_11,
handler: 'refresh_access_token.lambda_handler',
timeout: Duration.seconds(15),
tracing: lambda.Tracing.ACTIVE,
memorySize: 2048,
environment: {
"ISSUER_URL": "https://"+distribution.domainName,
"POWERTOOLS_SERVICE_NAME": "CustomIdentityComponentApi",
"SECRET_KEY_ID": secret.secretName,
"USER_TABLE": user_table.tableName
}
Expand Down Expand Up @@ -380,19 +383,20 @@ export class CustomIdentityComponentStack extends Stack {
role: loginWithAppleIdFunctionRole,
code: lambda.Code.fromAsset("lambda", {
bundling: {
image: lambda.Runtime.PYTHON_3_10.bundlingImage,
image: lambda.Runtime.PYTHON_3_11.bundlingImage,
command: [
'bash', '-c',
'pip install --platform manylinux2010_x86_64 --only-binary=:all: -r requirements.txt -t /asset-output && cp -ru . /asset-output'
'pip install --platform manylinux2014_x86_64 --only-binary=:all: -r requirements.txt -t /asset-output && cp -ru . /asset-output'
],
},}),
runtime: lambda.Runtime.PYTHON_3_10,
runtime: lambda.Runtime.PYTHON_3_11,
handler: 'login_with_apple_id.lambda_handler',
timeout: Duration.seconds(15),
tracing: lambda.Tracing.ACTIVE,
memorySize: 2048,
environment: {
"ISSUER_URL": "https://"+distribution.domainName,
"POWERTOOLS_SERVICE_NAME": "CustomIdentityComponentApi",
"SECRET_KEY_ID": secret.secretName,
"USER_TABLE": user_table.tableName,
"APPLE_APP_ID": appId,
Expand Down Expand Up @@ -440,19 +444,20 @@ export class CustomIdentityComponentStack extends Stack {
role: loginWithSteamIdFunctionRole,
code: lambda.Code.fromAsset("lambda", {
bundling: {
image: lambda.Runtime.PYTHON_3_10.bundlingImage,
image: lambda.Runtime.PYTHON_3_11.bundlingImage,
command: [
'bash', '-c',
'pip install --platform manylinux2010_x86_64 --only-binary=:all: -r requirements.txt -t /asset-output && cp -ru . /asset-output'
'pip install --platform manylinux2014_x86_64 --only-binary=:all: -r requirements.txt -t /asset-output && cp -ru . /asset-output'
],
},}),
runtime: lambda.Runtime.PYTHON_3_10,
runtime: lambda.Runtime.PYTHON_3_11,
handler: 'login_with_steam.lambda_handler',
timeout: Duration.seconds(15),
tracing: lambda.Tracing.ACTIVE,
memorySize: 2048,
environment: {
"ISSUER_URL": "https://"+distribution.domainName,
"POWERTOOLS_SERVICE_NAME": "CustomIdentityComponentApi",
"SECRET_KEY_ID": privateKeySecret.secretName,
"USER_TABLE": user_table.tableName,
"STEAM_APP_ID": appId,
Expand Down Expand Up @@ -510,19 +515,20 @@ export class CustomIdentityComponentStack extends Stack {
role: loginWithGooglePlayFunctionRole,
code: lambda.Code.fromAsset("lambda", {
bundling: {
image: lambda.Runtime.PYTHON_3_10.bundlingImage,
image: lambda.Runtime.PYTHON_3_11.bundlingImage,
command: [
'bash', '-c',
'pip install --platform manylinux2010_x86_64 --only-binary=:all: -r requirements.txt -t /asset-output && cp -ru . /asset-output'
'pip install --platform manylinux2014_x86_64 --only-binary=:all: -r requirements.txt -t /asset-output && cp -ru . /asset-output'
],
},}),
runtime: lambda.Runtime.PYTHON_3_10,
runtime: lambda.Runtime.PYTHON_3_11,
handler: 'login_with_google_play.lambda_handler',
timeout: Duration.seconds(15),
tracing: lambda.Tracing.ACTIVE,
memorySize: 2048,
environment: {
"ISSUER_URL": "https://"+distribution.domainName,
"POWERTOOLS_SERVICE_NAME": "CustomIdentityComponentApi",
"SECRET_KEY_ID": privateKeySecret.secretName,
"USER_TABLE": user_table.tableName,
"GOOGLE_PLAY_CLIENT_ID": googlePlayClientId,
Expand Down Expand Up @@ -579,19 +585,20 @@ export class CustomIdentityComponentStack extends Stack {
role: loginWithFacebookFunctionRole,
code: lambda.Code.fromAsset("lambda", {
bundling: {
image: lambda.Runtime.PYTHON_3_10.bundlingImage,
image: lambda.Runtime.PYTHON_3_11.bundlingImage,
command: [
'bash', '-c',
'pip install --platform manylinux2010_x86_64 --only-binary=:all: -r requirements.txt -t /asset-output && cp -ru . /asset-output'
'pip install --platform manylinux2014_x86_64 --only-binary=:all: -r requirements.txt -t /asset-output && cp -ru . /asset-output'
],
},}),
runtime: lambda.Runtime.PYTHON_3_10,
runtime: lambda.Runtime.PYTHON_3_11,
handler: 'login_with_facebook.lambda_handler',
timeout: Duration.seconds(15),
tracing: lambda.Tracing.ACTIVE,
memorySize: 2048,
environment: {
"ISSUER_URL": "https://"+distribution.domainName,
"POWERTOOLS_SERVICE_NAME": "CustomIdentityComponentApi",
"SECRET_KEY_ID": secret.secretName,
"USER_TABLE": user_table.tableName,
"FACEBOOK_APP_ID" : appId,
Expand Down
78 changes: 38 additions & 40 deletions CustomIdentityComponent/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion CustomIdentityComponent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"typescript": "~3.9.7"
},
"dependencies": {
"aws-cdk-lib": "^2.78.0",
"aws-cdk-lib": "^2.97.0",
"cdk": "^2.81.0-alpha.0",
"cdk-nag": "^2.27.24",
"constructs": "^10.0.0",
Expand Down

0 comments on commit adc5b5e

Please sign in to comment.