Skip to content

(aws-lambda): new Architectures prop causes problems with ambda version prop #16814

@matthias-pichler

Description

@matthias-pichler

What is the problem?

I added the new architectures prop to a lambda function that has a currentVersion and synthesis fails with

/builds/warrify/services/receipts/aws/node_modules/@aws-cdk/aws-lambda/lib/function-hash.ts:87
    throw new Error(`The following properties are not recognized as version properties: [${unclassified}].`
          ^
Error: Resolution error: Resolution error: The following properties are not recognized as version properties: [Architectures]. See the README of the aws-lambda module to learn more about this and to fix it..

I also have the "@aws-cdk/aws-lambda:recognizeVersionProps": true feature flag enabled

Reproduction Steps

const fn = new lambda.Function(this, 'Function', {
  code: lambda.Code.fromAsset(path.join(__dirname, 'my-lambda-handler')),
  handler: 'index.handler',
  runtime: lambda.Runtime. NODEJS_14_X,
  architectures: [ Architecture.ARM_64 ],
});

const alias = new lambda.Alias(this, "Alias", {
      aliasName: "current",
      version: fn.currentVersion,
    });

What did you expect to happen?

Architectures should be recognized correctly

What actually happened?

The synthesis failed

CDK CLI Version

1.126.0

Framework Version

1.126.0

Node.js Version

16.9.0

OS

macOS

Language

Typescript

Language Version

4.4.3

Other information

No response

Metadata

Metadata

Assignees

Labels

@aws-cdk/aws-lambdaRelated to AWS LambdabugThis issue is a bug.effort/smallSmall work item – less than a day of effortp1

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions