chalice
chalice copied to clipboard
Support for AccessLogSetting and TracingEnabled from AWS::Serverless::Api
Currently Chalice allows for an xray key that according to the documentation is:
A boolean that turns on AWS XRay’s Active tracing configuration. This will turn on XRay for both Lambda functions and API Gateway stages.
What it actually does is to enable tracing only for the functions but not the API Gateway. The generated CloudFormation template has a "Tracing": "Active" property in the AWS::Serverless::Function resource but doesn't have the TracingEnabled needed in the AWS::Serverless::Api resources to enable tracing.
Also the access logs are not implemented at all and would be great to have them to implement best observability practices. AWS::Serverless::Api exposes a AccessLogSetting property that would allow to set CloudWatch access logging on the stage.
Looks like this is a bug with the cloudformation/terraform packaging. The chalice deploy backend does create an API Gateway with tracing enabled (source), so I think this was just a miss on our end.
The AccessLogSetting would likely be a separate config option.
Just for the sake of those who stumble upon this issue, in the meantime that the feature/bug is implemented you can enable both settings via CloudFormation template merge; at the time of opening this issue I wasn't aware of it yet but it worked.
I use chalice with cdk and i use cdk deploy without chalice package, so this issue is super important for me as i need manually go and update each apigateway to use xray or write a script for this. Any updates?