SAM: enable sam build cache by optionally building entire lambda template
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 807
- Avg merge
- 10h 12m
- Merged PRs (30d)
- 7
Description
**Is your feature request related to a problem? Please describe.**
If you specify a specific resource within `sam` with cache enabled
```shell
sam build MyHandler --cached
```
`sam` will not persist a `build.toml` which means it can not make use of cached builds on subsequent builds.
VSCode always requires you to select a specific resource and it always provides it to the `sam build` command and thus we cannot make use of cache.
**Describe the solution you'd like**
An option to build entire template rather than just such that we can make use of cache builds for faster workflow.
**Additional context**
This behaviour of sam isn't documented so I have linked to the code where its disabled
https://github.com/aws/aws-sam-cli/blob/ac47ffcc72fb690f3ecb4421f1a3e76246964002/samcli/lib/build/app_builder.py#L207
From sam comments:
```
is_building_specific_resource : boolean
Whether customer requested to build a specific resource alone in isolation,
by specifying function_identifier to the build command.
Ex: sam build MyServerlessFunction
```
Contributor guide
Research direction
Start with the linked samcli/lib/build/app_builder.py#L207 code and compare the behavior of `sam build MyHandler --cached` with a whole-template build. Trace how the AWS Toolkit for VS Code supplies the selected resource, then define the option so a whole-template build can persist and reuse build.toml; verify the requested cached workflow end to end.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, typescript, vscode
- Domain
- build-system, devtools
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100