Skip to content

Commit

Permalink
feat(apigatewayv2): graduate to stable 🚀 (#28094)
Browse files Browse the repository at this point in the history
We are excited to graduate the `@aws-cdk/aws-apigatewayv2-alpha`, `@aws-cdk/aws-apigatewayv2-authorizers-alpha`, and `@aws-cdk/aws-apigatewayv2-integrations-alpha` modules to STABLE.

They now live on as:
- `aws-cdk-lib/aws-apigatewayv2`
- `aws-cdk-lib/aws-apigatewayv2-authorizers`
- `aws-cdk-lib/aws-apigatewayv2-integrations`

**Deprecated properties removed**:

- `httpApiId` has been removed in `aws-apigatewayv2`. Use `apiId` instead.
----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
sumupitchayan authored Nov 29, 2023
1 parent cd12ce4 commit 187f67b
Show file tree
Hide file tree
Showing 227 changed files with 63,698 additions and 59 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/* eslint-disable no-console */

export const handler = async (event: AWSLambda.APIGatewayProxyEventV2) => {
const key = event.headers['x-api-key'];

return {
isAuthorized: key === '123',
};
};

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,244 @@
{
"Resources": {
"User00B015A1": {
"Type": "AWS::IAM::User"
},
"UserDefaultPolicy1F97781E": {
"Type": "AWS::IAM::Policy",
"Properties": {
"PolicyDocument": {
"Statement": [
{
"Action": "execute-api:Invoke",
"Effect": "Allow",
"Resource": [
{
"Fn::Join": [
"",
[
"arn:",
{
"Ref": "AWS::Partition"
},
":execute-api:",
{
"Ref": "AWS::Region"
},
":",
{
"Ref": "AWS::AccountId"
},
":",
{
"Ref": "HttpApiF5A9A8A7"
},
"/*/*/books/*"
]
]
},
{
"Fn::Join": [
"",
[
"arn:",
{
"Ref": "AWS::Partition"
},
":execute-api:",
{
"Ref": "AWS::Region"
},
":",
{
"Ref": "AWS::AccountId"
},
":",
{
"Ref": "HttpApiF5A9A8A7"
},
"/*/*/foo"
]
]
}
]
}
],
"Version": "2012-10-17"
},
"PolicyName": "UserDefaultPolicy1F97781E",
"Users": [
{
"Ref": "User00B015A1"
}
]
}
},
"UserAccessEC42ADF7": {
"Type": "AWS::IAM::AccessKey",
"Properties": {
"UserName": {
"Ref": "User00B015A1"
}
}
},
"HttpApiF5A9A8A7": {
"Type": "AWS::ApiGatewayV2::Api",
"Properties": {
"Name": "HttpApi",
"ProtocolType": "HTTP"
}
},
"HttpApiDefaultStage3EEB07D6": {
"Type": "AWS::ApiGatewayV2::Stage",
"Properties": {
"ApiId": {
"Ref": "HttpApiF5A9A8A7"
},
"StageName": "$default",
"AutoDeploy": true
}
},
"HttpApiANYfooexamplecom903F7A9F": {
"Type": "AWS::ApiGatewayV2::Integration",
"Properties": {
"ApiId": {
"Ref": "HttpApiF5A9A8A7"
},
"IntegrationType": "HTTP_PROXY",
"IntegrationMethod": "GET",
"IntegrationUri": "https://www.example.com/",
"PayloadFormatVersion": "1.0"
}
},
"HttpApiANYfooD178456F": {
"Type": "AWS::ApiGatewayV2::Route",
"Properties": {
"ApiId": {
"Ref": "HttpApiF5A9A8A7"
},
"RouteKey": "ANY /foo",
"AuthorizationType": "AWS_IAM",
"Target": {
"Fn::Join": [
"",
[
"integrations/",
{
"Ref": "HttpApiANYfooexamplecom903F7A9F"
}
]
]
}
}
},
"HttpApiANYbooksbookexamplecom5C333C98": {
"Type": "AWS::ApiGatewayV2::Integration",
"Properties": {
"ApiId": {
"Ref": "HttpApiF5A9A8A7"
},
"IntegrationType": "HTTP_PROXY",
"IntegrationMethod": "GET",
"IntegrationUri": "https://www.example.com/",
"PayloadFormatVersion": "1.0"
}
},
"HttpApiANYbooksbook2F78361C": {
"Type": "AWS::ApiGatewayV2::Route",
"Properties": {
"ApiId": {
"Ref": "HttpApiF5A9A8A7"
},
"RouteKey": "ANY /books/{book}",
"AuthorizationType": "AWS_IAM",
"Target": {
"Fn::Join": [
"",
[
"integrations/",
{
"Ref": "HttpApiANYbooksbookexamplecom5C333C98"
}
]
]
}
}
}
},
"Outputs": {
"API": {
"Value": {
"Fn::Join": [
"",
[
"https://",
{
"Ref": "HttpApiF5A9A8A7"
},
".execute-api.",
{
"Ref": "AWS::Region"
},
".",
{
"Ref": "AWS::URLSuffix"
},
"/"
]
]
}
},
"TESTACCESSKEYID": {
"Value": {
"Ref": "UserAccessEC42ADF7"
}
},
"TESTSECRETACCESSKEY": {
"Value": {
"Fn::GetAtt": [
"UserAccessEC42ADF7",
"SecretAccessKey"
]
}
},
"TESTREGION": {
"Value": {
"Ref": "AWS::Region"
}
}
},
"Parameters": {
"BootstrapVersion": {
"Type": "AWS::SSM::Parameter::Value<String>",
"Default": "/cdk-bootstrap/hnb659fds/version",
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
}
},
"Rules": {
"CheckBootstrapVersion": {
"Assertions": [
{
"Assert": {
"Fn::Not": [
{
"Fn::Contains": [
[
"1",
"2",
"3",
"4",
"5"
],
{
"Ref": "BootstrapVersion"
}
]
}
]
},
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
}
]
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 187f67b

Please sign in to comment.