Skip to content

Commit eec900e

Browse files
feat(apigatewayv2): dualstack HTTP and WebSocket API (#34054)
### Issue # (if applicable) None ### Reason for this change Cloudformation now supports for configuring ip address type for `AWS::ApiGatewayV2::Api`. https://docs.aws.amazon.com/ja_jp/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-api.html#cfn-apigatewayv2-api-ipaddresstype ### Description of changes - define `IpAddressType` enum - add `ipAddressType` prop to both `HttpApiProps` and `WebSocketApiProps` ### Describe any new or updated permissions being added None ### Description of how you validated changes Add both unit and integ test ### 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) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 9cb2602 commit eec900e

24 files changed

+658
-6
lines changed

Diff for: packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/http/integ.api-dualstack.js.snapshot/DualStackHttpApiIntegDefaultTestDeployAssertCB101E5C.assets.json

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

Diff for: packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/http/integ.api-dualstack.js.snapshot/DualStackHttpApiIntegDefaultTestDeployAssertCB101E5C.template.json

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

Diff for: packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/http/integ.api-dualstack.js.snapshot/DualStackHttpApiStack.assets.json

+20
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,57 @@
1+
{
2+
"Resources": {
3+
"HttpApiF5A9A8A7": {
4+
"Type": "AWS::ApiGatewayV2::Api",
5+
"Properties": {
6+
"IpAddressType": "dualstack",
7+
"Name": "HttpApi",
8+
"ProtocolType": "HTTP",
9+
"RouteSelectionExpression": "${request.method} ${request.path}"
10+
}
11+
},
12+
"HttpApiDefaultStage3EEB07D6": {
13+
"Type": "AWS::ApiGatewayV2::Stage",
14+
"Properties": {
15+
"ApiId": {
16+
"Ref": "HttpApiF5A9A8A7"
17+
},
18+
"AutoDeploy": true,
19+
"StageName": "$default"
20+
}
21+
}
22+
},
23+
"Parameters": {
24+
"BootstrapVersion": {
25+
"Type": "AWS::SSM::Parameter::Value<String>",
26+
"Default": "/cdk-bootstrap/hnb659fds/version",
27+
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
28+
}
29+
},
30+
"Rules": {
31+
"CheckBootstrapVersion": {
32+
"Assertions": [
33+
{
34+
"Assert": {
35+
"Fn::Not": [
36+
{
37+
"Fn::Contains": [
38+
[
39+
"1",
40+
"2",
41+
"3",
42+
"4",
43+
"5"
44+
],
45+
{
46+
"Ref": "BootstrapVersion"
47+
}
48+
]
49+
}
50+
]
51+
},
52+
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
53+
}
54+
]
55+
}
56+
}
57+
}

Diff for: packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/http/integ.api-dualstack.js.snapshot/cdk.out

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

Diff for: packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/http/integ.api-dualstack.js.snapshot/integ.json

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

Diff for: packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/http/integ.api-dualstack.js.snapshot/manifest.json

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

Diff for: packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/http/integ.api-dualstack.js.snapshot/tree.json

+1
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,17 @@
1+
#!/usr/bin/env node
2+
import { IntegTest } from '@aws-cdk/integ-tests-alpha';
3+
import * as cdk from 'aws-cdk-lib';
4+
import * as apigw from 'aws-cdk-lib/aws-apigatewayv2';
5+
6+
const app = new cdk.App();
7+
const stack = new cdk.Stack(app, 'DualStackHttpApiStack');
8+
9+
new apigw.HttpApi(stack, 'HttpApi', {
10+
routeSelectionExpression: true,
11+
ipAddressType: apigw.IpAddressType.DUAL_STACK,
12+
});
13+
14+
new IntegTest(app, 'DualStackHttpApiInteg', {
15+
testCases: [stack],
16+
});
17+

Diff for: packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/websocket/integ.api-dualstack.js.snapshot/DualStackWebsocketApiIntegDefaultTestDeployAssert8B7A150B.assets.json

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

Diff for: packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/websocket/integ.api-dualstack.js.snapshot/DualStackWebsocketApiIntegDefaultTestDeployAssert8B7A150B.template.json

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

Diff for: packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2/test/websocket/integ.api-dualstack.js.snapshot/DualStackWebsocketApiStack.assets.json

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

0 commit comments

Comments
 (0)