-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Hi
Happy new year! It's me again :-).
I tried to use arm functions, but the lambdas are created with the x86 layers.
What I tried:
new PhpFpmFunction(this, 'Function',{
.....
phpVersion: '8.1',
architecture: Architecture.ARM_64,
});
and the created lambda has the x86 layer.
I think the problem is that in in defaults.ts platform is hardcoded to x86 and in PhpFunction.ts (https://github.com/brefphp/constructs/blob/main/src/function/PhpFunction.ts#L47) the value from the defaults.ts is used to lookup the layer ARN without allowing to overwrite it.
Also the "official" property in FunctionProps in the cdk is called architecture (https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.FunctionProps.html#architecture). Would probably make sense to use the same name here.
The good news is, if I use the above code and manually change the layer to the arm layer, things work perfectly.