Skip to content

Conversation

@dyonatamachado
Copy link

The Problem

The publish-layer command was using a hardcoded "x64" architecture path to locate the artifact.xml file generated by dotnet store. This caused a failure when attempting to publish a layer for other architectures, such as arm64, because the file was not found at the expected path.

The Solution

This change fixes the issue by dynamically determining the architecture directory. Instead of using a hardcoded "x64", the code now uses the value from the --function-architecture argument, retrieved via the GetStringValueOrDefault method. If no architecture is provided, it defaults to "x64" to ensure backward compatibility.

How the Change Was Tested

The fix was validated on a Windows x86_64 host, using a Docker container with the mcr.microsoft.com/dotnet/sdk:8.0 image for the linux/arm64 platform. The following steps were performed inside the container:

  1. The Amazon.Lambda.Tools tool was built and installed from the modified source code.
  2. The dotnet lambda publish-layer command was executed with the --function-architecture arm64 argument.
  3. The command completed successfully, publishing the layer for the arm64 architecture as expected.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants