AWS CDK Amazon API Gateway V2 (Alpha)

raw JSON →
2.114.1a0 verified Fri May 01 auth: no python deprecated

Deprecated AWS CDK module for Amazon API Gateway V2 (HTTP and WebSocket APIs). All constructs are now available under aws-cdk-lib/aws-apigatewayv2 as of CDK v2. This alpha module is frozen at version 2.114.1a0 and receives no updates. Users must migrate to the stable module.

pip install aws-cdk-aws-apigatewayv2-alpha==2.114.1a0
error ModuleNotFoundError: No module named 'aws_cdk.aws_apigatewayv2_alpha'
cause The alpha package is no longer installed or is incompatible with the current CDK version.
fix
Install aws-cdk-lib (stable) and use imports from aws_cdk.aws_apigatewayv2.
error ImportError: cannot import name 'HttpApi' from 'aws_cdk.aws_apigatewayv2_alpha'
cause The alpha package has been removed or the import path is incorrect.
fix
Use 'from aws_cdk.aws_apigatewayv2 import HttpApi' from the stable aws-cdk-lib.
error AttributeError: 'HttpApi' object has no attribute 'add_routes'
cause Method names may differ between alpha and stable modules.
fix
Refer to the stable CDK API documentation; e.g., use 'add_routes' or configure routes via the HttpApi constructor.
breaking Complete module deprecation: aws-cdk-aws-apigatewayv2-alpha is no longer maintained. All constructs have moved to aws-cdk-lib/aws-apigatewayv2.
fix Replace all imports from aws_cdk.aws_apigatewayv2_alpha with aws_cdk.aws_apigatewayv2 from aws-cdk-lib.
breaking Removal of alpha-specific classes: e.g., HttpMethod, VpcLink (if any) may have different names or parameters in the stable module.
fix Review the stable CDK docs for aws-apigatewayv2 to adapt any custom constructs.
deprecated The alpha package will not receive security updates or bug fixes.
fix Migrate to aws-cdk-lib/aws-apigatewayv2 immediately.
gotcha Do not mix imports from both alpha and stable modules in the same stack; it can cause construct ID conflicts or version mismatches.
fix Use only aws-cdk-lib/aws-apigatewayv2 for all API Gateway V2 resources.

Use the stable aws-cdk-lib module instead of the deprecated alpha package.

from aws_cdk import App, Stack
from aws_cdk.aws_apigatewayv2 import HttpApi

app = App()
stack = Stack(app, "MyStack")
HttpApi(stack, "MyHttpApi")
app.synth()