-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(apigatewayv2): Change defaultStage
to an IHttpStage
#14787
Comments
Edit: You can cast the default stage as an const httpApi = new apigw.HttpApi(this, "MyHttpApi")
let defaultStage = httpApi.defaultStage as apigw.IHttpStage;
defaultStage.metricCount() This is where the CDK creates the default aws-cdk/packages/@aws-cdk/aws-apigatewayv2/lib/http/api.ts Lines 430 to 435 in ae24d8a
However, since the property is declared as an
HttpStage which prevents you from being able to access the methods.
I don't see why the property can't directly return the |
I'll be closing this now because the workaround I posted above is pretty simple. If anyone would like to revisit changing the |
|
@peterwoodworth Personally I would not close it and label it as |
you're right, relabeled as a feature request |
defaultStage
defaultStage
to an IHttpStage
|
❓ General Issue
The Question
Via #14541 the
metricXXX
method moved fromIStage
toIHttpStage
. ThedefaultStage
of aHttpApi
returns aIStage
, so the methods are not available.Question: How to access the methods of the default stage?
Environment
> 1.103.0
Other information
When casting
api.defaultStage! as IHttpStage;
and calling themetricXXX
methods generate the expected code, so I guess thedefaultStage
could returnIHttpStage
directly?The text was updated successfully, but these errors were encountered: