Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(aws-ec2): vpcIpv6CidrBlocks missing from interface IVpc #19525

Closed
5nafu opened this issue Mar 23, 2022 · 2 comments
Closed

(aws-ec2): vpcIpv6CidrBlocks missing from interface IVpc #19525

5nafu opened this issue Mar 23, 2022 · 2 comments
Labels
@aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2

Comments

@5nafu
Copy link

5nafu commented Mar 23, 2022

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: '<whatever>' })
  • 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

@5nafu 5nafu added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Mar 23, 2022
@github-actions github-actions bot added the @aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud label Mar 23, 2022
@corymhall
Copy link
Contributor

I think this should be easy to add. We will just need to add this to the vpc context provider.

I am unassigning and marking this issue as p2, which means that we are unable to work on this immediately.

We use +1s to help prioritize our work, and are happy to revaluate this issue based on community feedback. You can reach out to the cdk.dev community on Slack to solicit support for reprioritization.

@corymhall corymhall added feature-request A feature should be added or improved. p2 effort/small Small work item – less than a day of effort and removed needs-triage This issue or PR still needs to be triaged. bug This issue is a bug. labels Mar 23, 2022
@corymhall corymhall removed their assignment Mar 23, 2022
mergify bot pushed a commit that referenced this issue Oct 26, 2022
This PR adds dual-stack mode support to RDS instances and clusters.

### Aurora
- Working with a DB cluster in a VPC  
  https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_VPC.WorkingWithRDSInstanceinaVPC.html
- CloudFormation AWS::RDS::DBCluster  
  https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rds-dbcluster.html#cfn-rds-dbcluster-networktype

```ts
declare const vpc: ec2.Vpc; // VPC and subnets must have IPv6 CIDR blocks
const cluster = new rds.DatabaseCluster(this, 'Database', {
  engine: rds.DatabaseClusterEngine.auroraMysql({ version: rds.AuroraMysqlEngineVersion.VER_3_02_1 }),
  instanceProps: {
    vpc,
    publiclyAccessible: false,
  },
  networkType: rds.NetworkType.DUAL,
});
```

### RDS
- Working with a DB instance in a VPC  
  https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_VPC.WorkingWithRDSInstanceinaVPC.html
- CloudFormation AWS::RDS::DBInstance  
  https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rds-dbinstance.html#cfn-rds-dbinstance-networktype

```ts
declare const vpc: ec2.Vpc; // VPC and subnets must have IPv6 CIDR blocks
const instance = new rds.DatabaseInstance(this, 'Instance', {
  engine: rds.DatabaseInstanceEngine.postgres({ version: rds.PostgresEngineVersion.VER_14_4 }),
  vpc,
  networkType: rds.NetworkType.DUAL,
  publiclyAccessible: false,
});
```

Note: CDK cannot check whether the specified VPC and subnets have actually IPv6 CIDR blocks because `ec2.IVpc` and `ec2.ISubnet` does not have ipv6 attributes. (cf. #19525)

----

### All Submissions:

* [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md)

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies)

### New Features

* [x] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)?
	* [x] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)?

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@github-actions
Copy link

This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Mar 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

No branches or pull requests

2 participants