Skip to content

Commit

Permalink
Force the platform on docker bundling
Browse files Browse the repository at this point in the history
  • Loading branch information
raykrueger committed Oct 7, 2024
1 parent 0357116 commit 50ecf54
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Runtime } from 'aws-cdk-lib/aws-lambda';
import { Architecture, Runtime } from 'aws-cdk-lib/aws-lambda';

export class Constants {
static readonly LAMBDA_RUNTIME = Runtime.PYTHON_3_12;
static readonly LAMBDA_ARCH = Architecture.ARM_64;
}
1 change: 1 addition & 0 deletions src/discord-state-machine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export class DiscordStateMachine extends Construct {
code: Code.fromAsset(path.join(__dirname, '../resources/functions/discord'), {
bundling: {
image: Constants.LAMBDA_RUNTIME.bundlingImage,
platform: Constants.LAMBDA_ARCH.dockerPlatform,
command: [
'bash', '-c',
'pip install -r requirements.txt -t /asset-output && cp -au . /asset-output',
Expand Down
1 change: 1 addition & 0 deletions src/discord.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export class DiscordBotConstruct extends Construct {
code: Code.fromAsset(path.join(__dirname, '../resources/functions/discord'), {
bundling: {
image: Constants.LAMBDA_RUNTIME.bundlingImage,
platform: Constants.LAMBDA_ARCH.dockerPlatform,
command: [
'bash', '-c',
'pip install -r requirements.txt -t /asset-output && cp -au . /asset-output',
Expand Down
1 change: 1 addition & 0 deletions src/discord_bot_custom_resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export class DiscordBotCustomResource extends Construct {
const code = Code.fromAsset(path.join(__dirname, '../resources/functions/discord_provider'), {
bundling: {
image: Constants.LAMBDA_RUNTIME.bundlingImage,
platform: Constants.LAMBDA_ARCH.dockerPlatform,
command: [
'bash', '-c',
'pip install -r requirements.txt -t /asset-output && cp -au . /asset-output',
Expand Down

0 comments on commit 50ecf54

Please sign in to comment.