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

[Bug]: Unknown values in aws_wafv2_ip_set.addresses provide inconsistent final plan #30351

Closed
johnsonaj opened this issue Mar 30, 2023 · 3 comments · Fixed by #30352
Closed
Labels
bug Addresses a defect in current functionality. service/wafv2 Issues and PRs that pertain to the wafv2 service.
Milestone

Comments

@johnsonaj
Copy link
Contributor

Terraform Core Version

1.4.2

AWS Provider Version

4.59.0

Affected Resource(s)

  • aws_wafv2_ip_set

Expected Behavior

Terraform to successfully apply configuration

Actual Behavior

Terraform returns the following error stating an inconsistent final plan.

Relevant Error/Panic Output Snippet

Error: Provider produced inconsistent final plan
│
│ When expanding the plan for aws_wafv2_ip_set.example to include new values learned so far during apply, provider "registry.terraform.io/hashicorp/aws" produced an invalid new value for .addresses: was null, but now
│ cty.SetVal([]cty.Value{cty.StringVal("127.0.0.1/32"), cty.StringVal("44.237.22.240/32")}).
│
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.

Terraform Configuration Files

resource "aws_eip" "example" {
  vpc = true
}

resource "aws_wafv2_ip_set" "example" {
  name               = "example"
  description        = "Example IP set"
  scope              = "REGIONAL"
  ip_address_version = "IPV4"

  addresses = ["127.0.0.1/32",
    "${aws_eip.example.public_ip}/32"
  ]
}

Steps to Reproduce

  • Create a configuration that has an unknown value in addresses
  • Terraform apply.

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

"addresses": {
Type: schema.TypeSet,
Optional: true,
MaxItems: 10000,
Elem: &schema.Schema{Type: schema.TypeString},
DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool {
o, n := d.GetChange("addresses")
oldAddresses := o.(*schema.Set).List()
newAddresses := n.(*schema.Set).List()
if len(oldAddresses) == len(newAddresses) {
for _, ov := range oldAddresses {
hasAddress := false
for _, nv := range newAddresses {
if verify.CIDRBlocksEqual(ov.(string), nv.(string)) {
hasAddress = true
break
}
}
if !hasAddress {
return false
}
}
return true
}
return false
},
},

Would you like to implement a fix?

None

@johnsonaj johnsonaj added the bug Addresses a defect in current functionality. label Mar 30, 2023
@github-actions
Copy link

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot added service/ec2 Issues and PRs that pertain to the ec2 service. service/wafv2 Issues and PRs that pertain to the wafv2 service. labels Mar 30, 2023
@johnsonaj johnsonaj removed the service/ec2 Issues and PRs that pertain to the ec2 service. label Mar 30, 2023
@github-actions github-actions bot added this to the v4.61.0 milestone Mar 30, 2023
@github-actions
Copy link

This functionality has been released in v4.61.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/wafv2 Issues and PRs that pertain to the wafv2 service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant