Skip to content

donet8 AOT: cannot dyamically set lambda architecture from cloud formation parameter #302

@cdaley0

Description

@cdaley0

Describe the bug

In my cloudformation json template I have the following parameter in my parameter list:

"LambdaArchitecture": {
  "Type": "String",
  "Default": "arm64",
  "AllowedValues": ["x86_64", "arm64"],
  "Description": "Architecture for lambda functions."
}

And in my AWS::Serverless::Function definitions I set the architecture by referencing this parameter:

"Architectures": [
  {
    "Ref": "LambdaArchitecture"
  }
]

While trying to deploy on my Macbook using dotnet lambda deploy-serverless I get the following error:

"Host machine architecture (Arm64) differs from Lambda architecture (X64). Building Native AOT Lambda functions require the host and lambda architectures to match."

If I hard code the architecture to arm64 I don't get this error.

"Architectures": ["arm64"]

Expected Behavior

The architecture should be set based on the LambdaArchitecture parameter.

Current Behavior

I get an error telling me that the target architecture is set to x86_64 even though I am setting it to arm64 via a cloud formation parameter.

Reproduction Steps

See description

Possible Solution

No response

Additional Information/Context

No response

AWS .NET SDK and/or Package version used

Amazon Lambda Tools for .NET Core applications (5.10.1)

Targeted .NET Platform

.NET 8

Operating System and version

MacOS Monterey

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue is a bug.module/cli-extp2This is a standard priority issuequeued

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions