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

(@aws-cdk/aws-ec2): Proposed, Separate the "vpc" construct to each resource such as subnets, routes, nat-gateway. #14318

Closed
wsscc2021 opened this issue Apr 22, 2021 · 2 comments
Assignees
Labels
@aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged.

Comments

@wsscc2021
Copy link

Proposed

Separate the "vpc" construct to each resource such as subnets, routes, nat-gateway.

Reason

The "vpc" construct is abstract to 3-tier architecture include aws resources such as vpc and subnet and nat-gateway and etc.
so if it use, can easily write code to provisioning 3-tier architecture and useful to mostly architecture.
However, I sometimes need to special architecture due to business constraint. in this case, it is difficult to modify detailed settings such as subnets and NATs.
so I hope separate the "vpc" construct to each resource such as subnets, routes, nat-gateway and get a tenderness by de-couple each resource dependency.

Proposed Solution

for example,

construct name description
vpc Create only "vpc"
eip Create only eip
nat-gateway Create only nat-gateway
subnets Create only subnets (there is already.)
... ...
vpc = aws_ec2.vpc(self, "vpc"
    cidr_block="10.0.0.0/16",
    enable_dns_hostnames=True,
    enable_dns_support=True,
)

subnet['public'][0] = aws_ec2.Subnets(
    self, "public0",
    cidr_block="10.0.0.0/24",
    vpc_id=vpc.id,
    availability_zone="us-east-1a",
    map_public_ip_on_launch=True
)
subnet['public'][1] = aws_ec2.Subnets(
    self, "public1",
    cidr_block="10.0.1.0/24",
    vpc_id=self.vpc.id,
    availability_zone="us-east-1b",
    map_public_ip_on_launch=True
)
subnet['private'][0] = aws_ec2.Subnets(
    self, "private0",
    cidr_block="10.0.2.0/24",
    vpc_id=self.vpc.id,
    availability_zone="us-east-1a",
    map_public_ip_on_launch=True
)
subnet['private'][1] = aws_ec2.Subnets(
    self, "private1",
    cidr_block="10.0.3.0/24",
    vpc_id=self.vpc.id,
    availability_zone="us-east-1b"
)
...
@wsscc2021 wsscc2021 added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Apr 22, 2021
@github-actions github-actions bot added the @aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud label Apr 22, 2021
@rix0rrr
Copy link
Contributor

rix0rrr commented May 10, 2021

Feels like a duplicate of #5927.

@rix0rrr rix0rrr closed this as completed May 10, 2021
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

No branches or pull requests

2 participants