-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
Terraform Instance creation for ENI with Secondary private private IPs greater than 1 Fails #15886
Comments
This issue has been automatically migrated to hashicorp/terraform-provider-aws#1490 because it looks like an issue with that provider. If you believe this is not an issue with the provider, please reply to this issue and let us know. |
This is a bit old, but I just went through the same problem and I want to share how I managed to fix it. aws_network_interface resource documentation is a bit unhelpful here, as it does not clear states that private_ips_count means secondary private ips, instead of the total count. Since instances have different limits of IP's per interface, people will encounter this errors with different number of IPs and instance types. The following code will result in an ENI with 3 private IP address instead of two. This is because there will be always one primary IP. The parameter private_ips_count should be better documented to inform about the default primary IP or better yet, match AWS API name secondary_private_ip_address_count or secondary_private_ips_count. resource "aws_network_interface" "three-private-ips" { If you want to define using pre-existing allocations, you can use private_ips, the first address will be the primary one. The code below will produce an ENI with 3 private IPs, where 1.1.1.100 is the primary one. resource "aws_network_interface" "three-private-ips" { |
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. |
Terraform Version
Terraform Configuration Files
Debug Output
Expected Behavior
The Instance should be created
Actual Behavior
The instance creation with primary nic with multiple ips works for private ip count as 1 but if i enter say 2 or 3 private ip count it fails.
Error: Reason: Server.InternalError: Internal error on launch (in terminal and in aws instance section also.)
Steps to Reproduce
I referred to https://www.terraform.io/docs/providers/aws/r/instance.html the Network Interfaces section.
The text was updated successfully, but these errors were encountered: