[Nix-dev] nixops elastic ip

Ben Doyle ben.doyle at skedge.me
Tue Dec 30 18:07:29 CET 2014


On Tue, Dec 30, 2014 at 12:18 AM, stewart mackenzie <setori88 at gmail.com>
wrote:

Ie is there a way to make Nixops control Amazon's Elastic IP to
> automatically allocate and assign an IP address?
>

Yes. Here's a minimal nix expression that provisions and assigns an Elastic
IP:

    let
      region = "us-east-1";
      accessKeyId = "testaccount";

      instance = ip: {resources, ...}: {
          deployment = {
              targetEnv = "ec2";
              ec2 = {
                  inherit region accessKeyId;
                  elasticIPv4 = resources.elasticIPs."${ip}";
      };

    in {
           resources.elasticIPs.name-of-ip = { inherit region accessKeyId;
};

           machine1 = instance "name-of-ip";
    };
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20141230/6bded65b/attachment.html 


More information about the nix-dev mailing list