Allow `sync --watch` to watch files outside the Lambda function CodeUri
- Dominant language
- Python
- Stars
- 6.7k
- Forks
- 1.2k
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 52
Description
### Describe your idea/feature/enhancement
When Lambda function code resides outside the `CodeUri`, changes are not synced. For example, using the following directory structure for a go1.x Lambda function, where `cmd/main.go` is the Lambda entrypoint and `mypackage` has additional code, changes in `mypackage` do not trigger a sync event.
```
.
├── cmd
│ └── main.go
├── mypackage
│ └── mypackage.go
├── go.mod
├── go.sum
└── template.yml
```
```yml
# template.yml
...
Resources:
MyFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: cmd
Handler: main
Runtime: go1.x
...
```
In this example, `CodeUri` cannot be set to `./` because the CLI will raise the exception `aws_lambda_builders.workflows.go_modules.builder.BuilderError: Builder Failed: no Go files in `
### Proposal
Add an option accepting multiple values to specify arbitrary additional paths to watch.
```sh
sam sync --stack-name MyStack --watch --watch-paths mypackage,go.mod
or
sam sync --stack-name MyStack --watch --watch-path mypackage --watch-path go.mod
```
### Additional Details
Contributor guide
Assessment
This issue has not been assessed yet.