Skip to content

Commit caf83f1

Browse files
authored
feat(ec2): add dual stack vpc support (#28480)
Adds parameter to configure a dual stack vpc, `vpcProtocol: ec2.VpcProtocol.DUAL_STACK`. By default a dual stack vpc will: - Create an Amazon provided IPv6 CIDR block (/56) and associate it to the VPC. - Assign a portion of the block to each of the subnets (/64) - Enable autoassigning an IPv6 address for each subnet - **Disable autoassigning public IPv4 addresses** for each subnet - Create an Egress Only Internet Gateway for private subnets - Configure IPv6 routes for IGWs and EIGWs Addresses #894. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent d07deec commit caf83f1

File tree

30 files changed

+40811
-37
lines changed

30 files changed

+40811
-37
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
from http.server import SimpleHTTPRequestHandler
2+
import urllib.request
3+
import json
4+
5+
class MyRequestHandler(SimpleHTTPRequestHandler):
6+
def do_GET(self):
7+
if self.path == '/':
8+
self.send_response(200)
9+
self.send_header('Content-type', 'application/json')
10+
self.end_headers()
11+
12+
try:
13+
# IPv4 request
14+
response = urllib.request.urlopen('http://ipv4.google.com')
15+
status_code = response.getcode()
16+
if (status_code != 200):
17+
raise Exception(f"Received a non-successful status code: {status_code}")
18+
19+
# IPv6 request
20+
response = urllib.request.urlopen('http://ipv6.google.com')
21+
status_code = response.getcode()
22+
if (status_code != 200):
23+
raise Exception(f"Received a non-successful status code: {status_code}")
24+
25+
json_response = {
26+
"status": status_code
27+
}
28+
29+
self.wfile.write(json.dumps(json_response).encode('utf-8'))
30+
except Exception as e:
31+
self.wfile.write(bytes(f"Error: {str(e)}", 'utf-8'))
32+
return
33+
else:
34+
super().do_GET()
35+
36+
if __name__ == '__main__':
37+
from http.server import HTTPServer
38+
server = HTTPServer(('0.0.0.0', 8000), MyRequestHandler)
39+
print('Server started on http://0.0.0.0:8000')
40+
server.serve_forever()

packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.vpc-dual-stack-ec2.js.snapshot/asset.4554b47be6f57b68c6c7a7391dcc73894866d2377fe174883351e7639097f292/__entrypoint__.js

+147
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-ec2/test/integ.vpc-dual-stack-ec2.js.snapshot/asset.4554b47be6f57b68c6c7a7391dcc73894866d2377fe174883351e7639097f292/index.js

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

0 commit comments

Comments
 (0)