Is there anyway to access the stage created by the...
# help
m
Is there anyway to access the stage created by the
api
construct so I can set these
AWS::ApiGatewayV2::Stage RouteSettings
properties
Copy code
{
  "DetailedMetricsEnabled" : Boolean,
  "ThrottlingBurstLimit" : Integer,
  "ThrottlingRateLimit" : Double
}
f
Copy code
const api = new sst.Api(...);

api.httpApi.defaultStage
api.httpApi.defaultStage
gives u the HTTP stage created
Let me know if it worked.
m
Thanks @Frank, unfortunately has to resort to
Copy code
// see <https://docs.aws.amazon.com/cdk/latest/guide/cfn_layer.html#cfn_layer_resource>
  const defaultStage = api.httpApi.defaultStage?.node.defaultChild as CfnStage
  defaultStage.defaultRouteSettings = {
    throttlingBurstLimit: 500,
    throttlingRateLimit: 1000,
    detailedMetricsEnabled: true,
  }
f
Yeah that looks right. I don’t think those settings are supported by CDK yet.