Skip to content

Commit

Permalink
fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Niranjan Jayakar committed Oct 7, 2021
1 parent 736f2a4 commit b19e14b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-lambda/lib/function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -665,10 +665,10 @@ export class Function extends FunctionBase {
if (props.architecture && props.architectures !== undefined) {
throw new Error('Either architecture or architectures must be specified but not both.');
}
if (props.architectures && props.architectures.length > 0) {
if (props.architectures && props.architectures.length > 1) {
throw new Error('Only one architecture must be specified.');
}
const architecture = props.architecture ?? props.architectures?.at(0);
const architecture = props.architecture ?? (props.architectures && props.architectures[0]);

const resource: CfnFunction = new CfnFunction(this, 'Resource', {
functionName: this.physicalName,
Expand Down

0 comments on commit b19e14b

Please sign in to comment.