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

Prefix List ressource won't allow adding an entry and changing the maximum number of entries at the same time #26639

Closed
ingoaf opened this issue Sep 5, 2022 · 5 comments · Fixed by #26845
Assignees
Labels
bug Addresses a defect in current functionality. enhancement Requests to existing resources that expand the functionality or scope. service/ec2 Issues and PRs that pertain to the ec2 service.
Milestone

Comments

@ingoaf
Copy link

ingoaf commented Sep 5, 2022

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • 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
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform AWS Provider Version

windows_amd64
terraform v1.2.7

terraform providers
Providers:
├── provider[registry.terraform.io/hashicorp/aws] 4.29.0

Affected Resource(s)

  • aws_ec2_managed_prefix_list

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

resource "aws_ec2_managed_prefix_list" "my_prefix_list" {
  name           = "my-prefix-list"
  address_family = "IPv4"
  max_entries    = 1

  entry {
    cidr        = "172.217.0.0/32"
    description = "test-block-1"
  }
}

Expected Behavior

The execution of terraform apply + confirmation should have worked.

Actual Behavior

Received an error: error updating EC2 Managed Prefix List (pl-0625f89a976b5cd): InvalidParameterCombination: You cannot modify the entries and the maximum entries for the prefix list in the same request.

Steps to Reproduce

  1. terraform apply, confirm
  2. change the terraform configuration to
resource "aws_ec2_managed_prefix_list" "my_prefix_list" {
  name           = "my-prefix-list"
  address_family = "IPv4"
  max_entries    = 2 // increased by one

  entry {
    cidr        = "172.217.0.0/32"
    description = "test-block-1"
  }

  // added this entry
  entry {
    cidr        = "216.58.190.0/32"
    description = "test-block-2"
  }
}
  1. terraform apply, confirm

References

@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. service/vpc Issues and PRs that pertain to the vpc service. labels Sep 5, 2022
@justinretzolk justinretzolk added enhancement Requests to existing resources that expand the functionality or scope. service/ec2 Issues and PRs that pertain to the ec2 service. and removed needs-triage Waiting for first response or review from a maintainer. service/vpc Issues and PRs that pertain to the vpc service. labels Sep 6, 2022
@drewmullen
Copy link
Collaborator

drewmullen commented Sep 9, 2022

The API will not allow updating max entries and entry changes at the same time. the resource code needs to account for:

  • if MaxEntries is increasing, call Modify to increase MaxEntries prior to adding entries
  • if MaxEntries is decreasing, call Modify to decrease MaxEntries after removing entries

This means that if MaxEntries and Entries are changing in the same call, terraform will need to make 2 modify calls

@kevindashton
Copy link

related to #25235

@kevindashton
Copy link

kevindashton commented Sep 9, 2022

Seems like this is a bug/defect, as we were blocked from being able to apply a simple additional inline entry due to these EC2 API errors. A potential work around was to use the aws_ec2_managed_prefix_list_entry resources, but that causes rather extreme performance issues and timeouts during terraform apply due to EC2 API service throttling caused by managing each prefix list entry independently.

@drewmullen drewmullen added the bug Addresses a defect in current functionality. label Sep 12, 2022
@drewmullen drewmullen self-assigned this Sep 16, 2022
@github-actions github-actions bot added this to the v4.32.0 milestone Sep 22, 2022
@github-actions
Copy link

This functionality has been released in v4.32.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 Oct 24, 2022
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. enhancement Requests to existing resources that expand the functionality or scope. service/ec2 Issues and PRs that pertain to the ec2 service.
Projects
None yet
4 participants