-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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 #1490
Comments
This seems to work for me via |
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" { |
This message from the AWS API is misleading, please try with a instance type that support your number of ips. Assume the following: But as instance type you use I can reproduce the issue with terraform 0.12.3 and this example
|
Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label. If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you! |
For future travelers, please see #17846. |
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. |
This issue was originally opened by @pranshuverma as hashicorp/terraform#15886. It was migrated here as a result of the provider split. The original body of the issue is below.
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: