-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
feat: Add IPAM IPv4 support #716
feat: Add IPAM IPv4 support #716
Conversation
can you please help a guy out with the correct |
@drewmullen |
thank you, @bryantbiggs . not sure why it was skipping b4 but 🤷 fix is pushed. |
requesting to hold while this is investigated: #715 (comment) |
hoping this data source will allow us to use this module and maintain subnet creation: hashicorp/terraform-provider-aws#22643 commenting for staleness |
The last commit used precommit Context: VPC module allows users to specify the subnets they want to create inside the VPC, this requires setting the cidr range for each subnet. Using AWS IPAM you may get your VPC CIDR derived from IPAM which means you wont know which subnet cidrs to use. The included data "aws_vpc_ipam_preview_next_cidr" "previewed_cidr" {
ipam_pool_id = aws_vpc_ipam_pool.ipv4_example.id
netmask_length = 24
depends_on = [
aws_vpc_ipam_pool_cidr.ipv4_example
]
}
locals {
partition = cidrsubnets(data.aws_vpc_ipam_preview_next_cidr.previewed_cidr.cidr, 2, 2)
private_subnets = cidrsubnets(local.partition[0], 2, 2)
public_subnets = cidrsubnets(local.partition[1], 2, 2)
}
module "ipv4_ipam_calculate_subnets" {
source = "../.."
name = "ipv4-calculated-subnets-${local.name}"
ipv4_ipam_pool_id = aws_vpc_ipam_pool.ipv4_example.id
cidr = data.aws_vpc_ipam_preview_next_cidr.previewed_cidr.cidr
private_subnets = local.private_subnets
public_subnets = local.public_subnets
depends_on = [
aws_vpc_ipam_pool_cidr.ipv4_example
]
} ERRORs:
Youll find many similar errors when you run Any input? |
I had an epiphany! I have solved this issue. Ill clean up the PR and add some documentation to make usage more clear. Hopefully can push Monday! |
Ready for a re-review. Appreciate the patience while I figure this one out! Tested: cd examples/ipam-vpc
terraform apply -auto-approve && terraform destroy -auto-approve |
Any input on what is causing the failure in vpc-flow-logs example? Shouldnt be any effects due to my change (1 new argument / variable) |
ae3ca3f
to
7036a6d
Compare
} | ||
|
||
locals { | ||
name = "complete-example" | ||
name = "ex-${replace(basename(path.cwd), "_", "-")}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of the provider/locals/tags updates were my fault - just aligning the examples to be consistent
|
||
```bash | ||
$ terraform destroy -target=module.vpc # destroy VPC that uses the IPAM pool CIDR first | ||
$ terraform destroy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure why, but deleting the aws_vpc_ipam_pool_cidr.this
takes forever 🤷🏽♂️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be great to combine these two terraform destroy
into one, as we have in all other modules, but I could not find a way to do this now. Let's leave it as it is now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure why, but deleting the
aws_vpc_ipam_pool_cidr.this
takes forever 🤷🏽♂️
The service holds the allocation record for up to 30m after a vpc releases it. It's possible to ignore the allocation and delete faster but conflicts with terraforms paradigm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, good to know!
apologies for the delay, I think when I first followed these PRs I was under the impression that they were breaking changes. @antonbabenko what do you think? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comments, but LGTM.
|
||
```bash | ||
$ terraform destroy -target=module.vpc # destroy VPC that uses the IPAM pool CIDR first | ||
$ terraform destroy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be great to combine these two terraform destroy
into one, as we have in all other modules, but I could not find a way to do this now. Let's leave it as it is now.
Co-authored-by: drewmullen <mullen.drew@gmail.com>
## [3.15.0](v3.14.4...v3.15.0) (2022-09-25) ### Features * Add IPAM IPv4 support ([#716](#716)) ([6eddcad](6eddcad))
This PR is included in version 3.15.0 🎉 |
The PR has been finally merged - it's time for the party at AWS re:invent 2022 🎉🥳 Agree? |
@antonbabenko 100%! I'll be there! We should do a informal tf community meet-up or something |
@drewmullen I agree we can make a more planned Terraform community meetup. I need to know what is the program for and by AWS Heroes, first. Stay in touch! |
We'll need a 🍻 budget |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Description
Motivation and Context
AWS launched VPC IPAM service
Breaking Changes
none
How Has This Been Tested?
examples/*
projectsI also attempted to implement
terraform test
but ran into a breaking bug