Amazon.CDK.AWS.Apigatewayv2.HttpApi: missing field RouteSelectionExpression in HttpApiProps which is available in CfnApi (CDK .NET) #31104
Labels
@aws-cdk/aws-apigatewayv2
Related to Amazon API Gateway v2
effort/medium
Medium work item – several days of effort
feature-request
A feature should be added or improved.
p2
Describe the feature
When creating an
HttpApi
from the namespaceAmazon.CDK.AWS.Apigatewayv2
, there is no option to set theRouteSelectionExpression
. This property is missing inHttpApiProps
.When creating the api with the L1 construct
CfnApi
from the namespaceAmazon.CDK.AWS.Apigatewayv2
, it is possible to set this property. This property is present inCfnApiProps
.Use Case
Being able to use an L2 construct for creating an
HttpApi
when setting the propertyRouteSelectionExpression
is required instead of falling back to using the L1 constructCfnApi
. This enables using other related L2 constructs as well instead of also falling back to L1 constructs.Proposed Solution
Add the property
RouteSelectionExpression
toHttpApiProps
of the L2 construct ofHttpApi
.Other Information
Possible workarounds until the proposed feature is implemented below.
Workaround 1
Create the API using the L1 construct and set the property
RouteSelectionExpression
:Workaround 2
Create the API using an L2 construct and set the
RouteSelectionExpression
through theCfnApi
constructed by the L2 construct:L2 Construct
HttpApi
CDK .NET ReferenceHttpApiProps
CDK .NET ReferenceL1 Construct
CfnApi
CDK .NET ReferenceCfnApiProps
CDK .NET ReferenceAWS CDK 2.151.0 API Reference
CfnApi
AWS CDK 2.151.0 API ReferenceAcknowledgements
CDK version used
2.151.0
Environment details (OS name and version, etc.)
Windows 11
The text was updated successfully, but these errors were encountered: