aws / aws/aws-cdk

[aws-ec2] L2 Construct - VpcPeeringConnection

Open
#9,338 3 comments 10 reactions 0 assignees View on GitHub
@aws-cdk/aws-ec2 effort/large feature-request p2
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

![image](https://user-images.githubusercontent.com/15084045/89971966-9703c300-dc97-11ea-94ed-be319f363908.png)

- 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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.