NixOS / nixops-aws

GNU Lesser General Public License v3.0
52 stars 39 forks source link

Associate ENIs to a machine using nixops #99

Open mdallali opened 9 years ago

mdallali commented 9 years ago

We have a use case where we access instance privately through directconnect. For this usecase, we use DNS names that resolve to private IP of servers within our VPC. It's of a good use for us to associate to the instances elastic network interfaces in order to keep static private IP addresses in case of instance stop/crash.

I did not find a reference to this in the nixops manual : http://nixos.org/nixops/manual/.

Can we have this feature : attaching an ENI to a VPC instance.

If the feature already exists and I missed it, can someone help on how to do it? Thanks.

mdallali commented 8 years ago

@edolstra, did we make progress on this one? thanks.

edolstra commented 8 years ago

I did some experimentation with attaching ENIs to NixOS EC2 instances, which seems to work fine. You do need to restart dhcpcd after attaching/removing an ENI, though.

Can you say a bit more about your use case? Do you want NixOps to provision ENIs, for instance, or just be able to attach them?

mdallali commented 8 years ago

Well we have Directconnect set up in an account and therefore our apps are accessible internally via a DNS name pointing to the private IP address of instances in the VPC. The thing is that the Private IP addresses would change ifter an instance stop/start. A way to prevent this is by attaching an ENI to each instance so that the Private IPs become static and therefore the DNS names will always point to that unchanged IP address.

Just attaching the ENI would be enough ofr us for now. But having the possiblity to provisions ENI's and configure them with nixops is a very nice thing to have.

Thanks

ip1981 commented 8 years ago

I'd like to attach ENI at instance launch. EIP -> ENI -> instance.

ip1981 commented 8 years ago

Changing instance type via nixops is also a problem:

<Message>There are multiple interfaces attached to instance 'i-XXXXXXXX'. Please specify an interface ID for the operation instead.</Message>
gilligan commented 7 years ago

We currently have the exact same problem. Has there been any progress on this? @ip1981 @mdallali Have you found any solution/workaround?

ip1981 commented 7 years ago

Detach an extra interface :-)

gilligan commented 7 years ago

@ip1981 I don't really know what you mean by that.

I'd like to attach ENI at instance launch. EIP -> ENI -> instance.

I am looking for a way to do exactly that via NixOps.

coretemp commented 6 years ago

Has this ever been implemented? vpc.nix seems to contain at least part of this, but I haven't figured out yet how to build an HTML manual for a recent version of nixops.