Skip to content

Commit

Permalink
fix(apigateway): remove deprecated apigatewayv2 from aws-apigateway m…
Browse files Browse the repository at this point in the history
…odule (#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*
  • Loading branch information
GavinZZ authored Nov 26, 2024
1 parent 7cc5f30 commit 4db9565
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2,936 deletions.
11 changes: 7 additions & 4 deletions packages/aws-cdk-lib/aws-apigateway/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1641,10 +1641,13 @@ const latencyMethodMetric = method.metricLatency(stage);

## APIGateway v2

APIGateway v2 APIs are now moved to its own package named `aws-apigatewayv2`. For backwards compatibility, existing
APIGateway v2 "CFN resources" (such as `CfnApi`) that were previously exported as part of this package, are still
exported from here and have been marked deprecated. However, updates to these CloudFormation resources, such as new
properties and new resource types will not be available.
APIGateway v2 APIs are now moved to its own package named `aws-apigatewayv2`. Previously, these APIs were marked
deprecated but retained for backwards compatibility. The deprecated usage of APIGateway v2 APIs within this module
`aws-apigateway` has now been removed from the codebase.

The reason for the removal of these deprecated Constructs is that CloudFormation team is releasing AWS resources
like `AWS::APIGateway::DomainNameV2` and this would cause compatibility issue with the deprecated `CfnDomainNameV2`
resource defined in `apigatewayv2.ts` file during the L1 generation.

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

Expand Down
Loading

0 comments on commit 4db9565

Please sign in to comment.