aws instance with multiple private ips

831 views
Skip to first unread message

Dan

unread,
Nov 8, 2016, 10:22:33 AM11/8/16
to Terraform
Hi,

Is there a way to spin up a new instance and assign multiple private IPs in an automated way?

Currently it looks like a 2nd ENI needs to be attached and it's private IPs hard coded. This doesn't seem like an ideal thing to have to do with automation tooling.

Using the AWS Console there is the ability to have these secondary private IPs auto-assigned but I can't see how to do this with Terraform.

cheers,
Dan

David Adams

unread,
Nov 8, 2016, 11:33:40 AM11/8/16
to terrafo...@googlegroups.com
https://www.terraform.io/docs/providers/aws/r/network_interface.html

The private IPs are optional. They can be specified if you want, or not.

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/hashicorp/terraform/issues
IRC: #terraform-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Terraform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to terraform-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/terraform-tool/025319e0-407d-4f96-bef7-07952bfafe64%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dan

unread,
Nov 8, 2016, 12:26:26 PM11/8/16
to Terraform
Yeah I think this can work when only an extra 1 or 2 ips is required as each new ENI gets an auto-assigned primary IP. This falls down though if you need say 15 IPs against an instance.

looks like Terraform has the following issues around ENIs
  • the default ENI only has a primary IP, there's no capability to assign secondary IPs to it
  • the default ENI can't be removed or replaced meaning certain instance types have extra IP restrictions (t2.small only allows 2 ENIs with 4 IPs each, so with Terraform you can only actually use 5)
  • aws_network_interface doesn't have the capability to auto-assign IPs to it's secondaries, this leads to hard coding IPs which seems pretty bad
  • can hack around with local exec and aws cli but then there's the chance things can get undone at the next run as terraform corrects what it thinks is wrong
Quite a few open issues already around this




On Tuesday, 8 November 2016 16:33:40 UTC, David Adams wrote:
https://www.terraform.io/docs/providers/aws/r/network_interface.html

The private IPs are optional. They can be specified if you want, or not.
On Tue, Nov 8, 2016 at 9:22 AM, Dan <daniel...@gmail.com> wrote:
Hi,

Is there a way to spin up a new instance and assign multiple private IPs in an automated way?

Currently it looks like a 2nd ENI needs to be attached and it's private IPs hard coded. This doesn't seem like an ideal thing to have to do with automation tooling.

Using the AWS Console there is the ability to have these secondary private IPs auto-assigned but I can't see how to do this with Terraform.

cheers,
Dan

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/hashicorp/terraform/issues
IRC: #terraform-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Terraform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to terraform-too...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages