Skip to content
This repository was archived by the owner on Apr 5, 2025. It is now read-only.

Commit 52984d6

Browse files
chore: apply feedback from code review
Co-authored-by: Heitor Lessa <[email protected]>
1 parent f731656 commit 52984d6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/lambda-powertools-layer.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export class LambdaPowertoolsLayer extends lambda.LayerVersion {
4343
* There are multiple combinations between version and extras package that results in different suffix for the installation.
4444
* With and without version, with and without extras flag.
4545
* We construct one suffix here because it is easier to do in code than inside the Dockerfile with bash commands.
46-
* For example, if we set extras=true and version=1.22.0 we get '[extras]==1.22.0'.
46+
* For example, if we set `includeExtras=true` and `version=1.22.0` we get '[all]==1.22.0'.
4747
*
4848
*/
4949
static constructBuildArgs(
@@ -88,7 +88,8 @@ export class LambdaPowertoolsLayer extends lambda.LayerVersion {
8888
props?.version,
8989
),
9090
},
91-
platform: getPlatformNameFromArchitectures(compatibleArchitectures),
91+
// supports cross-platform docker build
92+
platform: getDockerPlatformNameFromArchitectures(compatibleArchitectures),
9293
}),
9394
layerVersionName: props?.layerVersionName ? props?.layerVersionName : undefined,
9495
license: 'MIT-0',
@@ -131,7 +132,7 @@ function getLanguageNameFromRuntimeFamily(runtimeFamily: lambda.RuntimeFamily):
131132
}
132133
}
133134

134-
function getPlatformNameFromArchitectures(architectures: lambda.Architecture[]): string {
135+
function getDockerPlatformNameFromArchitectures(architectures: lambda.Architecture[]): string {
135136
if (architectures.length == 1) {
136137
return architectures[0].dockerPlatform;
137138
} else {

0 commit comments

Comments
 (0)