-
Notifications
You must be signed in to change notification settings - Fork 8.9k
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
IPv6 prefix and address count specified in same API request resulting in error #23203
Comments
Hi @dr-yd, I've tried to replicate the issue via CLI and this is the error I've got:
IMHO we should add the |
IMO, these fields should definitely not conflict with each other, that would make something that is actually feasible with the API impossible to implement with Terraform! As described in the issue, running Terraform twice and adding the parameters one after another does work and results in the desired outcome. I don't know if there are any internal guidelines on how to handle things like that but like I said above, making two separate API calls would probably be the most seamless user experience. |
This is quite an annoying issue in the AWS api and it would be great if terraform could work around it by invoking the api multiple times. It is perfectly valid to assign prefixes after the fact to an interface, but it's not possible to mix/match everything into a single create-network-interface invocation. |
I guess to be more helpful, in my example I was trying to do a slightly different combination of fields from OP but same issue/error. Note it's not using the count args at all, and that I can create an ENI like this manually via clickops in the console, just seemingly not all at once from a single call to create-network-interface: resource "aws_network_interface" "this" {
subnet_id = aws_subnet.this.id
security_groups = [aws_security_group.instance.id]
private_ips = [local.private_ip]
ipv6_addresses = [local.ipv6_address]
ipv6_prefixes = local.ipv6_prefixes
} |
Community Note
Terraform CLI and Terraform AWS Provider Version
Terraform v1.1.5
on darwin_amd64
Affected Resource(s)
Terraform Configuration Files
Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.
Debug Output
Debug output is available upon request directly to the team.
Expected Behavior
A network interface with both an IPv6 address and an IPv6 prefix is created.
Actual Behavior
Presumably, the provider would have to mask that API requirement my making two separate calls. If one or the other is set, then the second setting is added and Terraform is re-run, the interface ends up as desired. This is impractical in many codebases, e. g. when a module creates the interface.
Steps to Reproduce
terraform apply
Important Factoids
The error message's grammar was badly garbled using provider 3.x a few days ago, which likely means that this is a moving target.
References
None found.
The text was updated successfully, but these errors were encountered: