Skip to content

Commit 187f67b

Browse files
feat(apigatewayv2): graduate to stable 🚀 (#28094)
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*
1 parent cd12ce4 commit 187f67b

File tree

227 files changed

+63698
-59
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

227 files changed

+63698
-59
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/* eslint-disable no-console */
2+
3+
export const handler = async (event: AWSLambda.APIGatewayProxyEventV2) => {
4+
const key = event.headers['x-api-key'];
5+
6+
return {
7+
isAuthorized: key === '123',
8+
};
9+
};

packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2-authorizers/test/http/integ.iam.js.snapshot/IntegApiGatewayV2Iam.assets.json

+19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,244 @@
1+
{
2+
"Resources": {
3+
"User00B015A1": {
4+
"Type": "AWS::IAM::User"
5+
},
6+
"UserDefaultPolicy1F97781E": {
7+
"Type": "AWS::IAM::Policy",
8+
"Properties": {
9+
"PolicyDocument": {
10+
"Statement": [
11+
{
12+
"Action": "execute-api:Invoke",
13+
"Effect": "Allow",
14+
"Resource": [
15+
{
16+
"Fn::Join": [
17+
"",
18+
[
19+
"arn:",
20+
{
21+
"Ref": "AWS::Partition"
22+
},
23+
":execute-api:",
24+
{
25+
"Ref": "AWS::Region"
26+
},
27+
":",
28+
{
29+
"Ref": "AWS::AccountId"
30+
},
31+
":",
32+
{
33+
"Ref": "HttpApiF5A9A8A7"
34+
},
35+
"/*/*/books/*"
36+
]
37+
]
38+
},
39+
{
40+
"Fn::Join": [
41+
"",
42+
[
43+
"arn:",
44+
{
45+
"Ref": "AWS::Partition"
46+
},
47+
":execute-api:",
48+
{
49+
"Ref": "AWS::Region"
50+
},
51+
":",
52+
{
53+
"Ref": "AWS::AccountId"
54+
},
55+
":",
56+
{
57+
"Ref": "HttpApiF5A9A8A7"
58+
},
59+
"/*/*/foo"
60+
]
61+
]
62+
}
63+
]
64+
}
65+
],
66+
"Version": "2012-10-17"
67+
},
68+
"PolicyName": "UserDefaultPolicy1F97781E",
69+
"Users": [
70+
{
71+
"Ref": "User00B015A1"
72+
}
73+
]
74+
}
75+
},
76+
"UserAccessEC42ADF7": {
77+
"Type": "AWS::IAM::AccessKey",
78+
"Properties": {
79+
"UserName": {
80+
"Ref": "User00B015A1"
81+
}
82+
}
83+
},
84+
"HttpApiF5A9A8A7": {
85+
"Type": "AWS::ApiGatewayV2::Api",
86+
"Properties": {
87+
"Name": "HttpApi",
88+
"ProtocolType": "HTTP"
89+
}
90+
},
91+
"HttpApiDefaultStage3EEB07D6": {
92+
"Type": "AWS::ApiGatewayV2::Stage",
93+
"Properties": {
94+
"ApiId": {
95+
"Ref": "HttpApiF5A9A8A7"
96+
},
97+
"StageName": "$default",
98+
"AutoDeploy": true
99+
}
100+
},
101+
"HttpApiANYfooexamplecom903F7A9F": {
102+
"Type": "AWS::ApiGatewayV2::Integration",
103+
"Properties": {
104+
"ApiId": {
105+
"Ref": "HttpApiF5A9A8A7"
106+
},
107+
"IntegrationType": "HTTP_PROXY",
108+
"IntegrationMethod": "GET",
109+
"IntegrationUri": "https://www.example.com/",
110+
"PayloadFormatVersion": "1.0"
111+
}
112+
},
113+
"HttpApiANYfooD178456F": {
114+
"Type": "AWS::ApiGatewayV2::Route",
115+
"Properties": {
116+
"ApiId": {
117+
"Ref": "HttpApiF5A9A8A7"
118+
},
119+
"RouteKey": "ANY /foo",
120+
"AuthorizationType": "AWS_IAM",
121+
"Target": {
122+
"Fn::Join": [
123+
"",
124+
[
125+
"integrations/",
126+
{
127+
"Ref": "HttpApiANYfooexamplecom903F7A9F"
128+
}
129+
]
130+
]
131+
}
132+
}
133+
},
134+
"HttpApiANYbooksbookexamplecom5C333C98": {
135+
"Type": "AWS::ApiGatewayV2::Integration",
136+
"Properties": {
137+
"ApiId": {
138+
"Ref": "HttpApiF5A9A8A7"
139+
},
140+
"IntegrationType": "HTTP_PROXY",
141+
"IntegrationMethod": "GET",
142+
"IntegrationUri": "https://www.example.com/",
143+
"PayloadFormatVersion": "1.0"
144+
}
145+
},
146+
"HttpApiANYbooksbook2F78361C": {
147+
"Type": "AWS::ApiGatewayV2::Route",
148+
"Properties": {
149+
"ApiId": {
150+
"Ref": "HttpApiF5A9A8A7"
151+
},
152+
"RouteKey": "ANY /books/{book}",
153+
"AuthorizationType": "AWS_IAM",
154+
"Target": {
155+
"Fn::Join": [
156+
"",
157+
[
158+
"integrations/",
159+
{
160+
"Ref": "HttpApiANYbooksbookexamplecom5C333C98"
161+
}
162+
]
163+
]
164+
}
165+
}
166+
}
167+
},
168+
"Outputs": {
169+
"API": {
170+
"Value": {
171+
"Fn::Join": [
172+
"",
173+
[
174+
"https://",
175+
{
176+
"Ref": "HttpApiF5A9A8A7"
177+
},
178+
".execute-api.",
179+
{
180+
"Ref": "AWS::Region"
181+
},
182+
".",
183+
{
184+
"Ref": "AWS::URLSuffix"
185+
},
186+
"/"
187+
]
188+
]
189+
}
190+
},
191+
"TESTACCESSKEYID": {
192+
"Value": {
193+
"Ref": "UserAccessEC42ADF7"
194+
}
195+
},
196+
"TESTSECRETACCESSKEY": {
197+
"Value": {
198+
"Fn::GetAtt": [
199+
"UserAccessEC42ADF7",
200+
"SecretAccessKey"
201+
]
202+
}
203+
},
204+
"TESTREGION": {
205+
"Value": {
206+
"Ref": "AWS::Region"
207+
}
208+
}
209+
},
210+
"Parameters": {
211+
"BootstrapVersion": {
212+
"Type": "AWS::SSM::Parameter::Value<String>",
213+
"Default": "/cdk-bootstrap/hnb659fds/version",
214+
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
215+
}
216+
},
217+
"Rules": {
218+
"CheckBootstrapVersion": {
219+
"Assertions": [
220+
{
221+
"Assert": {
222+
"Fn::Not": [
223+
{
224+
"Fn::Contains": [
225+
[
226+
"1",
227+
"2",
228+
"3",
229+
"4",
230+
"5"
231+
],
232+
{
233+
"Ref": "BootstrapVersion"
234+
}
235+
]
236+
}
237+
]
238+
},
239+
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
240+
}
241+
]
242+
}
243+
}
244+
}

packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2-authorizers/test/http/integ.iam.js.snapshot/cdk.out

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2-authorizers/test/http/integ.iam.js.snapshot/integ.json

+14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)