Hi, I'm using awsx.apigateway.API and would like t...
# aws
c
Hi, I'm using awsx.apigateway.API and would like to enable cloudwatch logging for a stage (not access logging). Is that possible somehow? I can't seem to find how to configure it. This is where it's configurable in the console:
l
Is it the loggingLevel properties of StageRouteSettings and StageDefaultRouteSettings?
That applies only to WebSocket APIs?
c
Not sure I understand. This is my current setup. Can you point to where I should attempt to set those?
Copy code
const api = new awsx.apigateway.API(`${stackName}-web-api`, {        
        routes: [{
            path: "{proxy+}",
            method: "ANY",
            eventHandler: lambda,
            apiKeyRequired: true,            
        }],
        restApiArgs: {
            endpointConfiguration: {
                types: "REGIONAL"
            }
        },        
        stageName: environmentType
    });
l
Everything in awsx is a wrapper around the equivalent aws resources, with opinionated defaults, simpler APIs, etc. It may be that the features you need are not exposed through awsx. Compare the awsx and aws implementations. See if the code you need is in aws and not awsx. If it's in aws only, you'll need to rewrite using the aws resources instead of the awsx ones. You can copy the code out of awsx for a quick start.