Skip to content

Enabling IPv6 on Resources and VPCs #894

@yandy-r

Description

@yandy-r

Hi,

I'm just starting out to play with the SDK, please forgive if I a missing something. First off, I'd like to probably point out how great this product is and I see a bright future for it. It's in the early stages and I understand things will be missing. This is not a complaint, just something I noticed while attempting to create an IPv6 enabled app.

It seems like the ability to map an amazonProvidedIpv6CidrBlock is missing within the @aws-cdk/aws-ec2 VpcNetwork construct as well as within the SubnetConfiguration interface.

Something along the lines of the below would be helpful.

import * as ec2 from "@aws-cdk/aws-ec2";

new ec2.VpcNetwork(this, name, {
// other attributes
  amazonProvidedIpv6CidrBlock: true,
// other attributes
}

Other values left out on purpose just to keep this concise.

From the subnetConfiguration[] it would be helpful to have.

import * as ec2 from "@aws-cdk/aws-ec2";

new ec2.VpcNetwork(this, name, {
// other attributes
  subnetConfiguration: [
    {
      name: "pub",
      cidrMask: 22,
      ipv6Cidr: true,
      mapIPv6OnLaunch: true,
      subnetType: ec2.SubnetType.Public
    }
  ]
// other attributes
}

The ipv6Cidr could be a boolean since all subnet cidrs must be /64 and then the obvious addition to map IPv6 address to instances within those subnet .

To get the amazonProvidedIpv6CidrBlock within the created VpcNetwork I had to do something like this, and in testing, it seems to work. Though going through the documentation, it's advised to use native constructs, which I'd agree completely.

this.vpc = new ec2.VpcNetwork(this, `${name}Vpc`, args);
new ec2.cloudformation.VPCCidrBlockResource(
  this,
  `CidrRes`,
  {
    vpcId: this.vpc.vpcId,
    amazonProvidedIpv6CidrBlock: true
  }
);

Metadata

Metadata

Assignees

Labels

@aws-cdk/aws-ec2Related to Amazon Elastic Compute Cloudeffort/largeLarge work item – several weeks of effortfeature-requestA feature should be added or improved.feature/enhancementA new API to make things easier or more intuitive. A catch-all for general feature requests.p1

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions