Skip to content

Allow users to use a path in 'Handler' for Go lambdas #2844

@JadenSimon

Description

@JadenSimon

Describe your idea/feature/enhancement

SAM CLI should extract a path from the Handler property in SAM templates and use that as the CodeUri.
Other languages support this, so you could write:

Handler: "my/path/to/handler/app.handler"

Without a CodeUri and it will run fine.

While for Go you must always put the path to your source code in CodeUri:

CodeUri: "my/path/to/handler"
Handler: "mybinary" # this just refers to the compiled binary name, so it can be anything

Otherwise SAM CLI will fail to build.

Proposal

Add a special case for Go (or any other compiled language) to get the working directory from the Handler property before building. This gives flexibility in what both fields may refer to, i.e. CodeUri might refer to the location of the manifest file and Handler is the relative path to the lambda function.

Metadata

Metadata

Assignees

No one assigned

    Labels

    stage/pm-reviewWaiting for review by our Product Manager, please don't work on this yettype/featureFeature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions