-
Notifications
You must be signed in to change notification settings - Fork 103
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
ec2.Vpc does not work with IPAM #872
Comments
Hi @titanous Thanks so much for the report here - this is a scenario we have not covered so this is very useful for us! Are you able to show us what you think this should work like with the provider and what you'd expect the outputs to be? Thanks Paul |
If IPAM IDs are specified, I think it should work like this:
Does that make sense? |
are there any defaults you feel are a good set here or should they always be required to set a netmask_lenght for a subnet type? |
Thinking about it more I'm wondering if the netmask length is actually required, I think the |
#1014 Starting this PR to attempt to fix this issue. |
I see this was briefly merged but then reverted. Any plans to address this soon? Use case example: const ipam_14 = new aws.ec2.VpcIpamPoolCidr("ipam-10-216", {
cidr: "10.216.0.0/14",
ipamPoolId: ipam_pool.id,
});
const customVpc = new awsx.ec2.Vpc(prefix, {
numberOfAvailabilityZones: 3,
subnetStrategy: SubnetAllocationStrategy.Auto,
ipv4IpamPoolId: ipam_14.id,
ipv4NetmaskLength: 16,
subnetSpecs: [
{
type: SubnetType.Private,
name: "Application",
cidrMask: 19, //8190 hosts
tags: { ...tags, label: "Application" }
},
{
type: SubnetType.Public,
name: "DMZ",
cidrMask: 20, //4094 hosts
tags: { ...tags, label: "DMZ" }
},
{
type: SubnetType.Isolated,
name: "TGW",
cidrMask: 28, //14 hosts
tags: { ...tags, label: "TGW" }
}
],
}); In this example the /14 has useable hosts 10.216.0.1 - 10.219.255.254. Then all behavior would be the same as if the cidr block for 10.217.0.0/16 was defined directly in code, as far as the underlying subnets, detections for number of hosts being possible, etc. |
Sorry that you're running into this! I'll add it to our backlog. If you're ok with loosing the dynamic part of IPAM, you could specify the |
Fixes issues with supporting the ipv4IpamPoolId parameter that ties a VPC to an IPAM pool. You should now be able to write the following to allows IPAM to allocate and manage a cidrBlock range. The VPC component now uses that dynamically allocated block to automatically configure subnets. ```typescript new awsx.ec2.Vpc("myVpc", { ipv4IpamPoolId: myVpcIpamPool.id, ipv4NetmaskLength: 24, subnetStrategy: "Auto", }); ``` It is also possible to constrain the allocated subnets with subnetSpecs, while still using IPAM to manage the overall cidrBlock range: ```typescript new awsx.ec2.Vpc("myVpc", { numberOfAvailabilityZones: 3, subnetStrategy: "Auto", ipv4IpamPoolId: myVpcIpamPool.id, ipv4NetmaskLength: 22, subnetSpecs: [ { type: "Private", name: "private", cidrMask: 25, }, { type: "Public", name: "public", cidrMask: 27, }, ], tags: tags, }); ``` Fixes #872 Note that `subnetStrategy: "Auto"` is required with this functionality, and "Legacy" strategy is not supported.
What happened?
VpcArgs
hasipv4IpamPoolId
andipv4NetmaskLength
fields, but it doesn't look like the code is set up to handle them.pulumi-awsx/awsx/ec2/vpc.ts
Lines 80 to 83 in dfe6be7
This code assumes that a static
cidrBlock
will be used and applies a default if one is not provided.Steps to reproduce
Create a
Vpc
withipv4IpamPoolId
set.Expected Behavior
The stack deploys.
Actual Behavior
Versions used
Additional context
No response
Contributing
Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).
The text was updated successfully, but these errors were encountered: