aws / aws/aws-cdk

aws-ec2: support subnet group names on fromVpcAttributes

Open
#31,880 3 comments 0 reactions 0 assignees View on GitHub
@aws-cdk/aws-ec2 effort/small feature-request p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Describe the feature

When importing a VPC I'd like to support names for subnets.

### Use Case

When multiple subnet groups for one network type (for example ISOLATED) exist I want to select a certain group using subnet selection.

### Proposed Solution

extend fromVpcAttributes -> VpcAttributes so an import can look like this:

```typescript
Vpc.fromVpcAttributes(this, 'Vpc', {
vpcId: 'vpc-id',
isolatedSubnetNames: [
{ subnetGroupName: 'Database', subnetId: 'subnet-database-1' },
{ subnetGroupName: 'Database', subnetId: 'subnet-database-2' },
{ subnetGroupName: 'App', subnetId: 'subnet-app-1' },
{ subnetGroupName: 'App', subnetId: 'subnet-app-2' },
],
});
```

### Other Information

Right now it's only possible to import up to 3 different subnet groups, however there are instances where I want to have more subnet groups.

### Acknowledgements

- [ ] I may be able to implement this feature request
- [ ] This feature might incur a breaking change

### CDK version used

2.163.1

### Environment details (OS name and version, etc.)

-

Contributor guide

Open the contributing guide

Research direction

Start at Vpc.fromVpcAttributes and the VpcAttributes definition, then trace how imported subnet groups are represented and selected. Determine how named subnet groups should coexist with the current limit of three groups. Done means an imported VPC can accept the proposed isolatedSubnetNames shape and select subnets by subnetGroupName without breaking existing imports.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cloud, networking
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.