`chalice logs` command does not work when deploying with CDK
- Dominant language
- Python
- Stars
- 11.1k
- Forks
- 1k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 2
Description
As mentioned in the title, the `chalice logs` command does not show any output when deploying the project with CDK as specified in the [docs](https://aws.github.io/chalice/tutorials/cdk.html).
The lambda is correctly generating logs, both the ones generated by the framework and the ones I add manually via `app.log.error` for example. No CLI option seems to work (`--num-entries`, `--follow`, etc.) and no error message is printed.
I believe this has to do with [this condition](https://github.com/aws/chalice/blob/f4eb00238970d919d28c1507386e16f87ed56292/chalice/cli/__init__.py#L376), that is, that the given `name` is not found in the `deployed.resource_names()`. I would be glad to help. My intuition tells me that this is due to the `DeployedResources` reading from a local deploy file, so it should be able to read from the CloudFormation output, transform it into the appropriate format, and be able to tell the CLI to read it from there, but I'm not very familiar with the code.
Contributor guide
Research direction
Start with chalice/cli/__init__.py around the condition linked in the issue, then trace DeployedResources and resource_names() for CDK deployments described in the CDK documentation. Reproduce a deployment with generated Lambda logs and verify that chalice logs, including --num-entries and --follow, displays them without an error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, python
- Domain
- cli, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100