Skip to content

Commit 4db9565

Browse files
authored
fix(apigateway): remove deprecated apigatewayv2 from aws-apigateway module (#32297)
### Issue # (if applicable) Closes #32296 ### Reason for this change As a summary, CDK `aws-apigateway` module had a legacy file called `apigatewayv2.ts` which includes CDK L1 Constructs from API Gateway V2 resource like `CfnDomainNameV2`. We've already moved everything here to aws-apigatewayv2 module. However, we had to keep the legacy file for backward compatibility issue and every Constructs in the file were marked as `deprecated` 5 years ago. Now API Gateway team has released a new AWS resource called DomainNameV2 in API Gateway. The default CDK generated name would be CfnDomainNameV2 in aws-apigateway module but this name collides with the legacy CfnDomainNameV2 Construct from apigatewayv2.ts file (supposedly for APIGatewayV2). This is causing the L1 generation tool to fail because the new resource by API Gateway is also caused `CfnDomainNameV2`. ### Description of changes Delete the deprecated `apigatewayv2.ts` file entirely. ### Description of how you validated changes Existing users on upgrade won't be able to deploy their template without knowing the change because the property for the `APIGateway::DomainNameV2` resource is different from `APIGatewayV2::DomainName` resource, so the template would be non-deployable. Verified that if existing users who use `CfnDomainNameV2` from `aws-apigateway` module and update to use the same Construct from `aws-apigatewayv2` module, it will generate the exact same output CFN template so it won't cause any resource replacement or downtime. There's only 76 users who used `CfnApiV2` from `aws-apigateway` module based on Analytics. All these users were on CDK V1 so if they choose to upgrade to latest version, they need to fix a bunch of breaking changes anyway. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) BREAKING CHANGE: We will be removing deprecated `APIGatewayV2` constructs from `aws-apigateway` module. *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 7cc5f30 commit 4db9565

File tree

3 files changed

+8
-2936
lines changed

3 files changed

+8
-2936
lines changed

packages/aws-cdk-lib/aws-apigateway/README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1641,10 +1641,13 @@ const latencyMethodMetric = method.metricLatency(stage);
16411641

16421642
## APIGateway v2
16431643

1644-
APIGateway v2 APIs are now moved to its own package named `aws-apigatewayv2`. For backwards compatibility, existing
1645-
APIGateway v2 "CFN resources" (such as `CfnApi`) that were previously exported as part of this package, are still
1646-
exported from here and have been marked deprecated. However, updates to these CloudFormation resources, such as new
1647-
properties and new resource types will not be available.
1644+
APIGateway v2 APIs are now moved to its own package named `aws-apigatewayv2`. Previously, these APIs were marked
1645+
deprecated but retained for backwards compatibility. The deprecated usage of APIGateway v2 APIs within this module
1646+
`aws-apigateway` has now been removed from the codebase.
1647+
1648+
The reason for the removal of these deprecated Constructs is that CloudFormation team is releasing AWS resources
1649+
like `AWS::APIGateway::DomainNameV2` and this would cause compatibility issue with the deprecated `CfnDomainNameV2`
1650+
resource defined in `apigatewayv2.ts` file during the L1 generation.
16481651

16491652
Move to using `aws-apigatewayv2` to get the latest APIs and updates.
16501653

0 commit comments

Comments
 (0)