Skip to content

(@aws-cdk/aws-ec2-alpha): IPAM PoolOptions missing options from AWS::EC2::IPAMPool #34178

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

Open
1 task
pemattr opened this issue Apr 17, 2025 · 2 comments · May be fixed by #34359
Open
1 task

(@aws-cdk/aws-ec2-alpha): IPAM PoolOptions missing options from AWS::EC2::IPAMPool #34178

pemattr opened this issue Apr 17, 2025 · 2 comments · May be fixed by #34359
Labels
effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2 package/tools Related to AWS CDK Tools or CLI

Comments

@pemattr
Copy link

pemattr commented Apr 17, 2025

Describe the bug

https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-ec2-alpha.PoolOptions.html#properties
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-ipampool.html

Currently the Interface is missing a few options from the CFN construct. The key one being SourceIpamPoolId allowing you to create pools within pools.

Regression Issue

  • Select this option if this issue appears to be a regression.

Last Known Working CDK Version

No response

Expected Behavior

The L2 construct should support all the options

Current Behavior

No SourceIpamPoolId option exists

Reproduction Steps

N/A

Possible Solution

The option could be added to PoolOptions or a method could be attached to IIpamPool called addPool or similar allowing you to create a pool from the created construct. Or both?

Additional Information/Context

No response

CDK CLI Version

2.1010.0 (build 6b421db)

Framework Version

No response

Node.js Version

v22.14.0

OS

Windows 11 WSL2 Ubuntu 24.04.2 LTS

Language

TypeScript

Language Version

No response

Other information

No response

@pemattr pemattr added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Apr 17, 2025
@github-actions github-actions bot added the package/tools Related to AWS CDK Tools or CLI label Apr 17, 2025
@pahud pahud self-assigned this Apr 17, 2025
@pahud
Copy link
Contributor

pahud commented Apr 17, 2025

Hi @pemattr,

Thanks for reporting this issue and providing detailed information!

You've correctly identified a feature gap in the @aws-cdk/aws-ec2-alpha PoolOptions interface. It currently lacks the SourceIpamPoolId property, which is available in the underlying AWS::EC2::IPAMPool CloudFormation resource and is necessary for creating nested IPAM pools.

It's important to note that while the CDK aims to provide convenient L2 constructs, not all properties from the underlying L1 CloudFormation resources are automatically exposed. Enhancements like adding SourceIpamPoolId often require specific contributions to map the property and integrate it into the L2 construct's logic.

The definition for PoolOptions is located in the ipam-pool.ts file within the packages/@aws-cdk/aws-ec2-alpha/lib/ directory. Adding the sourceIpamPoolId property to this interface seems like the appropriate way forward. Conceptually, the change would look something like this:

// Conceptual fix - adding the property to PoolOptions
// Likely file: packages/@aws-cdk/aws-ec2-alpha/lib/ipam-pool.ts

export interface PoolOptions {
  // ... existing options like addressFamily, allocationDefaultNetmaskLength, etc. ...

  /**
   * The ID of the source IPAM pool. Use this option to create a pool within an existing pool.
   * @default - Pool is created at the top level.
   */
  readonly sourceIpamPoolId?: string;

  // ... potentially other missing options ...
}

We truly appreciate community contributions and welcome Pull Requests! If you're interested in submitting a PR to add this property (and potentially other missing options), the CDK team would be happy to review it. Please refer to the AWS CDK Contributing Guide for more details on the process.

In the meantime, adding an upvote (👍 reaction) to the issue can help the team gauge community interest and prioritize this feature request.

Thanks again for bringing this to our attention! Let us know if you have any other questions.

@pahud pahud added p2 feature-request A feature should be added or improved. and removed bug This issue is a bug. labels Apr 17, 2025
@pahud pahud removed their assignment Apr 17, 2025
@pahud pahud added effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. labels Apr 17, 2025
@sbeginCoveo
Copy link

sbeginCoveo commented May 1, 2025

An interesting alternative could be to implement the same addPool function that's available on scopes, making the reference implicit.

@sbeginCoveo sbeginCoveo linked a pull request May 5, 2025 that will close this issue
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2 package/tools Related to AWS CDK Tools or CLI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants