[aws-ec2] L2 Construct - VpcPeeringConnection
- Dominant language
- TypeScript
- Stars
- 12.9k
- Forks
- 4.6k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 83
Description
L2 Construct for `ec2.CfnVpcPeeringConnection`
### Use Case

- To construct a new vpc peering connection.
- To import an existing one.
```
import * as ec2 from '@aws-cdk/aws-ec2'
const vpcPeeringConnection = ec2.VpcPeeringConnection.fromVpcPeeringConnectionAttributes(this, 'vpcPeeringConnection', {
vpcPeeringConnectionId: 'pcx-01234567890abcdef',
});
const vpc: ec2.Vpc = ...
const routes = vpc.privateSubnets
.map((_) => _.routeTable.routeTableId)
.map((routeTableId, index) => {
return new ec2.CfnRoute(this, `route-${index}`, {
destinationCidrBlock: '192.168.0.0/24',
routeTableId,
vpcPeeringConnectionId: vpcPeeringConnection.vpcPeeringConnectionId,
})
})
```
### Proposed Solution
I'll make a pull request.
### Other
* [x] :wave: I may be able to implement this feature request
* [ ] :warning: This feature might incur a breaking change
---
This is a :rocket: Feature Request
Contributor guide
Research direction
Start by reading the existing AWS CDK EC2 L2 constructs and the ec2.CfnVpcPeeringConnection resource. Use the issue's creation and import examples as the acceptance criteria: the construct should support both operations and expose vpcPeeringConnectionId for routes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, typescript
- Domain
- cloud, infrastructure
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100