Go Dependency Error in SAM application when building with AWS Toolkit

Viewed 76

I have a SAM application that has several endpoints (with their own module) and a seperate module in the same project that has helper functions, services etc.

When building the project with sam build, which should build and deploy all endpoints at once, it causes an error in the build process. The dependencies are definitely included in all related go.mod/go.sum files. Here's the error:

Running GoModulesBuilder:Build

Build Failed
Error: GoModulesBuilder:Build - Builder Failed: ..\..\service\matchService.go:10:2: missing go.sum entry for module providing package github.com/aws/aws-sdk-go/aws (imported by testmodule/service); to add:
        go get testmodule/service@v1.0.0
..\..\service\matchService.go:11:2: missing go.sum entry for module providing package github.com/aws/aws-sdk-go/aws/session (imported by testmodule/service); to add:        go get testmodule/service@v1.0.0

If I execute sam build in the endpoint folder directly it works flawless however!

This is the basic folder structure of the project:

/api/matches/endpoint-a/main.go
/api/matches/endpoint-a/go.mod <- requires matchService of "testmodule" which lies in /, also requires aws-sdk-go indirectly
/api/matches/endpoint-a/go.sum
/services/matchService
/go.mod <- requires github.com/aws/aws-sdk-go/aws
/go.sum
/template.yaml <- includest AWS::Serverless::Function for endpoint-a
0 Answers
Related