Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(vpcV2): support custom route and subnet #30538

Merged
merged 164 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from 129 commits
Commits
Show all changes
164 commits
Select commit Hold shift + click to select a range
f13a0c2
initial lib for VPC V2 alpha construct
shikha372 May 16, 2024
5554383
implementation of ipam
shikha372 May 30, 2024
095c867
adding support for secondary IP address
shikha372 Jun 6, 2024
739ad59
add IPAM private scope
shikha372 Jun 6, 2024
b0717be
Add Route-related constructs
Jun 7, 2024
c9a25bf
adding subnet, test and example stack
shikha372 Jun 10, 2024
720a624
Merge branch 'vpc_full_control' of https://github.com/shikha372/aws-c…
shikha372 Jun 10, 2024
3684c21
fixing vpc integ tests with successful deployment
shikha372 Jun 11, 2024
b239806
Tweak Route and RouteTable
Jun 11, 2024
3d83e82
Merge changes
Jun 11, 2024
2f4ca11
Fix export
Jun 11, 2024
bdcf3c5
barebone implementation of subnetV2
shikha372 Jun 11, 2024
3ea72ae
Merge branch 'vpc_full_control' of https://github.com/shikha372/aws-c…
shikha372 Jun 11, 2024
6b0b6d5
re-introduce reverted merge changes
shikha372 Jun 11, 2024
e688a9a
implementing isolated subnet by default
shikha372 Jun 11, 2024
6d94634
Move route things to their own file
Jun 12, 2024
3dfe18f
fixing ipam default scope implementation
shikha372 Jun 12, 2024
401de75
resolving merge conflicts
shikha372 Jun 12, 2024
adb7aa8
resolving merge conflicts
shikha372 Jun 12, 2024
6a0c297
Update target type
Jun 12, 2024
0335f34
fixing ipam public and private
shikha372 Jun 12, 2024
e7cd0e9
copying vpcbase class to plugin IVPC
shikha372 Jun 12, 2024
1d0e247
add validation for ipv6 in subnet
shikha372 Jun 13, 2024
4c22ec0
adding validation for RFC 1918
shikha372 Jun 13, 2024
97df8ec
Test changes for route and routetable
Jun 13, 2024
9b869b6
fix RFC validation
shikha372 Jun 13, 2024
974acb7
fix RFC validation
shikha372 Jun 13, 2024
1d60d37
fix RFC validation
shikha372 Jun 13, 2024
306cd28
fix RFC validation
shikha372 Jun 13, 2024
f84f92f
fix integ test
shikha372 Jun 13, 2024
f93053b
cleaned up SubnetV2 construct
samson-keung Jun 14, 2024
ff41493
type to support subnet filter
shikha372 Jun 14, 2024
0df6881
Merge branch 'vpc_full_control' of https://github.com/shikha372/aws-c…
shikha372 Jun 14, 2024
462dae2
type to support subnet filter
shikha372 Jun 14, 2024
7b9885f
removing non-required implementations from subnet utils
shikha372 Jun 14, 2024
cd37f69
addressing last feedback comments
shikha372 Jun 14, 2024
0390ebc
Subnet clean up
samson-keung Jun 17, 2024
6b60f3e
SubnetV2 fix build
samson-keung Jun 17, 2024
db1b99f
Add tests for each route target type
Jun 17, 2024
d6351e9
SubnetV2 fix invalid ipv6 value
samson-keung Jun 18, 2024
0ef7116
Work on integ test
Jun 18, 2024
2c8dcf4
Merge branch 'vpc_full_control' into vpc_full_control-leo
Jun 18, 2024
f645905
Update changes
Jun 18, 2024
ea0502e
Rework integ tests
Jun 20, 2024
d8e17cd
SubnetV2 ipv6 support
samson-keung Jun 20, 2024
50938f9
Merge branch 'vpc_full_control' into vpc_full_control-leo
Jun 20, 2024
cd5c5e2
integrate VPC ipv6 cidr with Subnet ipv6
samson-keung Jun 20, 2024
6c78baa
More changes to integ test
Jun 20, 2024
d5d89a9
Merge branch 'vpc_full_control' into vpc_full_control-leo
Jun 20, 2024
5763f9b
linting fixes and variable casing fix
samson-keung Jun 20, 2024
976e33f
Make integ test actually pass
Jun 21, 2024
5112dcc
Merge branch 'vpc_full_control-leo' into vpc_full_control
Jun 21, 2024
9eb4b63
Remove print statements
Jun 21, 2024
ce665de
Ipam support ready for Vpc and Subnet
samson-keung Jun 22, 2024
4329279
Ipam scope fix
samson-keung Jun 22, 2024
0931537
linting fixes on route integ tests
samson-keung Jun 22, 2024
e2b420b
adding unit and integ tests
shikha372 Jun 24, 2024
b1dcbf7
resolving conflicts
shikha372 Jun 24, 2024
149710e
Resolve changes
Jun 24, 2024
d71c236
resolving conflicts
shikha372 Jun 24, 2024
8f968c4
Merge up to date
Jun 24, 2024
a394652
New changes to integ test
Jun 24, 2024
ec4985b
Merge branch 'abstractions/vpc_full_control' into vpc_full_control
shikha372 Jun 25, 2024
eca121a
adding ipam amazon ipv6
shikha372 Jun 25, 2024
0a6b24e
dry run snapshot
shikha372 Jun 25, 2024
d80a245
Integ test to get NAT Gateway to work
Jun 25, 2024
e88fed4
Merge with current changes
Jun 25, 2024
9260a81
Fix IPAM scope
samson-keung Jun 25, 2024
446664d
Begin work on EIGW unit test
Jun 25, 2024
a417a82
Unit test for EIGW + rename IRouter to IRouteTarget
Jun 25, 2024
460be60
Unit tests for VPN GW and IGW
Jun 25, 2024
7643e4a
Make VpcCidr dependOn IpamPoolCidr
samson-keung Jun 26, 2024
20241d6
successful run of ipamIpv6
shikha372 Jun 26, 2024
1bcfd8b
adding subnet range validation within VPC
shikha372 Jun 26, 2024
1ea70b8
adding cross validation for ipv4 address in subnet
shikha372 Jun 27, 2024
e50c5b9
Unit tests and integ for NAT GW + private NAT GW
Jun 27, 2024
683ac22
Unit and integ tests for VPC Peering Connection + docstrings for rout…
Jun 27, 2024
a1ddc1b
Add docstrings
Jul 2, 2024
bad7ffc
Network interface unit test and comment out out-of-scope constructs
Jul 2, 2024
807f2b7
code clean up and initial version of README
samson-keung Jul 3, 2024
e69c631
Start on README and add unit tests for GatewayVPCEndpoint
Jul 3, 2024
cc22fe3
Update README with routing information
Jul 3, 2024
510c532
add ipv6 cross subnet validation
shikha372 Jul 4, 2024
7d756ce
Merge branch 'vpc_full_control' of https://github.com/shikha372/aws-c…
shikha372 Jul 4, 2024
debd9e2
Resolving conflicts
shikha372 Jul 4, 2024
ec295bb
successful build
shikha372 Jul 4, 2024
4d4aea2
remove submodule
shikha372 Jul 4, 2024
3d95f27
fix some linting
shikha372 Jul 4, 2024
043941c
refactor IPAM class with docstrings
shikha372 Jul 5, 2024
b001ae6
complete unit test for ipam class
shikha372 Jul 5, 2024
bcb093c
Completing unit tests for class VPC
shikha372 Jul 8, 2024
0773612
completing tests for subnet
shikha372 Jul 9, 2024
f0d50b6
adding docstring for subnet class and fix lint
shikha372 Jul 9, 2024
d4da323
Add missing docstrings
Jul 9, 2024
40bf736
Merge changes
Jul 9, 2024
68e3dc0
fix aws-lints and docstring
shikha372 Jul 9, 2024
94aba85
Merge branch 'main' into vpc_full_control
shikha372 Jul 10, 2024
f57cad1
successful build
shikha372 Jul 10, 2024
d5def44
Resolving conflicts
shikha372 Jul 4, 2024
706db15
successful build
shikha372 Jul 4, 2024
c709f67
remove submodule
shikha372 Jul 4, 2024
2ddbf2d
fix some linting
shikha372 Jul 4, 2024
ecae39f
refactor IPAM class with docstrings
shikha372 Jul 5, 2024
bb3c6ea
complete unit test for ipam class
shikha372 Jul 5, 2024
1b9fea1
Completing unit tests for class VPC
shikha372 Jul 8, 2024
923fee2
completing tests for subnet
shikha372 Jul 9, 2024
0101b3c
adding docstring for subnet class and fix lint
shikha372 Jul 9, 2024
db08374
fixing lints and docstring
shikha372 Jul 9, 2024
94da321
Merge branch 'vpc_full_control' of https://github.com/shikha372/aws-c…
Jul 10, 2024
802f788
modify coverage and integ test for successful test
shikha372 Jul 10, 2024
784089a
Merge branch 'vpc_full_control' of https://github.com/shikha372/aws-c…
shikha372 Jul 10, 2024
13376e8
revert evalualte expression
shikha372 Jul 10, 2024
fcdf45b
revert evalualte expression
shikha372 Jul 10, 2024
bff52ec
fix integ test snapshots
shikha372 Jul 10, 2024
9e41b97
trying to fix build
shikha372 Jul 10, 2024
af8c192
remove package lock json file
shikha372 Jul 10, 2024
c80ba60
fix build
shikha372 Jul 10, 2024
d151c4c
update subnetV2 integ snapshot
shikha372 Jul 11, 2024
7e656d9
update VpcV2 integ snapshot
shikha372 Jul 11, 2024
60b6b1a
Merge branch 'main' into vpc_full_control
shikha372 Jul 11, 2024
7656489
Fix route linting issues
Jul 12, 2024
2d7e8a3
fixing aws lints for vpc and subnet class
shikha372 Jul 12, 2024
f5e11f0
Merge branch 'vpc_full_control' of https://github.com/shikha372/aws-c…
shikha372 Jul 12, 2024
2fdc76b
fixing aws lints for vpc and subnet class
shikha372 Jul 12, 2024
d46c472
Fix failing unit tests
Jul 12, 2024
d1d809d
Merge branch 'vpc_full_control' of https://github.com/shikha372/aws-c…
shikha372 Jul 12, 2024
58a0aea
fix integ snapshots for route
shikha372 Jul 12, 2024
b4c2812
Update packages/@aws-cdk/aws-vpcv2-alpha/lib/util.ts
shikha372 Jul 22, 2024
c6a71d2
fixing last commit suggestion
shikha372 Jul 23, 2024
e9b7b9b
fixing ipam class and some changes in test file according to new defi…
shikha372 Aug 1, 2024
686dc87
refactoring vpc and subnet class
shikha372 Aug 1, 2024
50780af
updating test with latest changes
shikha372 Aug 1, 2024
3230063
correcting go repo name
shikha372 Aug 1, 2024
a3b3cd8
Update subnet-v2.ts
shikha372 Aug 1, 2024
a0fbfd6
updating subnet functions to be internal
shikha372 Aug 1, 2024
02cb3ab
Merge branch 'vpc_full_control' of https://github.com/shikha372/aws-c…
shikha372 Aug 1, 2024
b30c5ca
refactoring ipam
shikha372 Aug 1, 2024
841928e
Update ipam.ts
shikha372 Aug 1, 2024
a84a9b3
Delete packages/@aws-cdk/aws-vpcv2-alpha/lib/ipam-v2.ts
shikha372 Aug 1, 2024
111ae3a
marking subnet functions internal
shikha372 Aug 1, 2024
21c5cbd
refactoring route class
shikha372 Aug 1, 2024
b3f45d0
Merge branch 'main' into vpc_full_control
moelasmar Aug 1, 2024
3b52d27
fix linting,cleanup and updating test files
shikha372 Aug 1, 2024
cb4e222
Merge branch 'vpc_full_control' of https://github.com/shikha372/aws-c…
shikha372 Aug 1, 2024
82cf3bb
fixing try catch in subnet
shikha372 Aug 1, 2024
39a261b
cleanup
shikha372 Aug 1, 2024
4826957
fix try catch
shikha372 Aug 1, 2024
6d4d856
fix readme,unit test and integ test snapshots
shikha372 Aug 1, 2024
086958e
fix ipam and integ test snapshots
shikha372 Aug 1, 2024
2f35dc1
correcting docstrings
shikha372 Aug 1, 2024
429e6eb
adding list of scopes under ipam
shikha372 Aug 1, 2024
c9e0251
adding ipam scope type
shikha372 Aug 1, 2024
7bcacc4
refactor according to previous comments
shikha372 Aug 2, 2024
255b94c
refactor according to previous comments
shikha372 Aug 2, 2024
24d2c15
refactor according to previous comments
shikha372 Aug 2, 2024
0b7a56f
making ipam props private
shikha372 Aug 6, 2024
daa15c7
adding name property for secondary ip address
shikha372 Aug 6, 2024
e2ddd32
renaming module from vpc v2 to ec2
shikha372 Aug 7, 2024
b789ee8
refactoring vpc for secondary address
shikha372 Aug 7, 2024
3d7346b
refactoring vpc for secondary address
shikha372 Aug 7, 2024
7849e02
refactoring route class
shikha372 Aug 7, 2024
ace34be
Merge branch 'main' into vpc_full_control
shikha372 Aug 7, 2024
94f2293
fix: README
shikha372 Aug 7, 2024
b717d17
Merge branch 'vpc_full_control' of https://github.com/shikha372/aws-c…
shikha372 Aug 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/@aws-cdk/aws-vpcv2-alpha/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
const baseConfig = require('@aws-cdk/cdk-build-tools/config/eslintrc');
baseConfig.parserOptions.project = __dirname + '/tsconfig.json';
baseConfig.rules['import/order'] = 'off';
module.exports = baseConfig;
23 changes: 23 additions & 0 deletions packages/@aws-cdk/aws-vpcv2-alpha/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
*.js
*.js.map
*.d.ts
tsconfig.json
node_modules
*.generated.ts
dist
.jsii

.LAST_BUILD
.nyc_output
coverage
nyc.config.js
.LAST_PACKAGE
*.snk
!.eslintrc.js
!jest.config.js

junit.xml
!**/*.snapshot/**/asset.*/*.js
!**/*.snapshot/**/asset.*/*.d.ts

!**/*.snapshot/**/asset.*/**
28 changes: 28 additions & 0 deletions packages/@aws-cdk/aws-vpcv2-alpha/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Don't include original .ts files when doing `npm pack`
*.ts
!*.d.ts
coverage
.nyc_output
*.tgz

dist
.LAST_PACKAGE
.LAST_BUILD
!*.js

# Include .jsii
!.jsii

*.snk

*.tsbuildinfo

tsconfig.json
.eslintrc.js
jest.config.js

# exclude cdk artifacts
**/cdk.out
junit.xml
!*.lit.ts
**/*.snapshot
201 changes: 201 additions & 0 deletions packages/@aws-cdk/aws-vpcv2-alpha/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

1. Definitions.

"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.

"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.

"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.

"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.

"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.

"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.

"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).

"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.

"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."

"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.

2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.

3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.

4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:

(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and

(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and

(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and

(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.

You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.

5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.

6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.

7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.

8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.

9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.

END OF TERMS AND CONDITIONS

APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2018-2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
2 changes: 2 additions & 0 deletions packages/@aws-cdk/aws-vpcv2-alpha/NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
AWS Cloud Development Kit (AWS CDK)
Copyright 2018-2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Loading
Loading