aws / aws/aws-cdk

(aws-ec2): vpcIpv6CidrBlocks missing from interface IVpc

Open
#19,525 4 comments 6 reactions 1 assignee Claimed by @shikha372 View on GitHub
@aws-cdk/aws-ec2 effort/small feature-request p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
1d 19h
Merged PRs (30d)
71

Description

### What is the problem?

When looking up an existing VPC with `Vpc.fromLookup(this, 'VPCexample', { vpcName: 'foobar' })`, there appears not to be any way to actually get the IPv6 CIDR blocks associated with the VPC as the interface `IVpc` is missing the appropiate property `vpcIpv6CidrBlocks` that is available in the `Vpc` construct.

The `vpcCidrBlock` property only contains IPv4 addresses.

We tried to use an escape hatch with
```
const cfnVPC = VPC as CfnVPC
```
but this was unsuccessful as there is not enough overlap:
> Conversion of type 'IVpc' to type 'CfnVPC' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
Type 'IVpc' is missing the following properties from type 'CfnVPC': attrCidrBlock, attrCidrBlockAssociations, attrDefaultNetworkAcl, attrDefaultSecurityGroup, and 34 more.

### Reproduction Steps

* (Manually) Create a VPC with an (Amazon managed) IPv6 CIDR Block attached
* Lookup the VPC with:
`const VPC = Vpc.fromLookup(this, 'exampleVPC', { vpcName: '' }) `
* Get the IPv6 CIDR blocks with
`console.log(VPC.vpcIpv6CidrBlocks)`-> This fails
* Get the CIDR Blocks with
`console.log(VPC.vpcCidrBlock)`-> This only shows IPv4

### What did you expect to happen?

I did expect to find out the attached IPv6 CIDR block of a VPC.

### What actually happened?

See above Reproduction steps.

### CDK CLI Version

2.15.0 (build 151055e)

### Framework Version

_No response_

### Node.js Version

16.11.26

### OS

Linux & OSX

### Language

Typescript

### Language Version

_No response_

### Other information

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.