Closed glerma closed 1 year ago
ping?
I have a similar issue with the ipv6_ipam_pool_id. On first apply, it finds the pool_id (which I find using the aws_vpc_ipam_pool data source). First apply works ok, however, when I look at the state for the VPC, I find that the ipv6_ipam_pool_id parameter returns "IPAM Managed", which means that every subsequent plans/applies want to change this back to the correct pool_id... Thoughts?
have you see the guidance shared here https://github.com/hashicorp/terraform-provider-aws/issues/25958#issuecomment-1263608883 ?
have you see the guidance shared here hashicorp/terraform-provider-aws#25958 (comment) ?
I will give it a read! Thanks!
This issue has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this issue will be closed in 10 days
This issue was automatically closed because of stale in 10 days
I'm going to lock this issue 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 similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Description
I am reporting a problem I cannot seem to get around elegantly or without making a not so ideal workaround.
When using the vpc module with an existing IPAM pool:
data.aws_vpc_ipam_preview_next_cidr.this.cidr
to get the next cidr to assign to my vpc,cidr
argument. On the initial execution, everything works fine, my subnets are created with the sizes needed, transit gateway attachment, and the terraform apply completes successfully.However, subsequent runs result in changes detected, the terraform plan shows attempts to destroy/replace the vpc and subnets due to the behavior of
data.aws_vpc_ipam_preview_next_cidr.this.cidr
changing in value. This is not ideal for many reasons. It needs to stay idempotent.I do not rule out the possibility that i'm doing this wrong. :) - However, maybe this could be a feature or enhancement to allow for
ignore_changes
lifecycle block in one of the resources in the module source? Perhaps enabled/disabled via a boolean variable?β οΈ Note
Before you submit an issue, please perform the following first:
.terraform
directory (! ONLY if state is stored remotely, which hopefully you are following that best practice!):rm -rf .terraform/
terraform init
Versions
Module version [Required]: 5.1.1
Terraform version:
Provider version(s): 1.4.5
aws: 5.11
Reproduction Code [Required]
Steps to reproduce the behavior:
Are you using workspaces? No Have you cleared the local cache (see Notice section above)?: Yes
Expected behavior
It is expected that when an IP CIDR is obtained then assigned to the vpc
cidr
argument, subsequent runs of terraform apply will not detect changes and try to destroy/replace the VPC and the subnets.Actual behavior
Subsequent runs result in changes found, due to the
data.aws_vpc_ipam_preview_next_cidr.cidr
changing every time.Terminal Output Screenshot(s)
Additional context
Context:
Using an existing IP pool. The IP Pool has a existing CIDR.