Giter Site home page Giter Site logo

Comments (10)

adv4000 avatar adv4000 commented on June 3, 2024

Looking for same feature.
AWS CLI has flag called --allow-reassociation which is auto deassociate desired IP from any other EC2

aws ec2 associate-address --instance-id=$EC2INSTANCE_ID --allocation-id=$EIPALLOC_ID --allow-reassociation --region=$EC2REGION

from aws-ec2-assign-elastic-ip.

ankitcha avatar ankitcha commented on June 3, 2024

is there any update on this? If no-one is planning or currently working on it - I could contribute a PR for this. Please let me know. Thanks!

from aws-ec2-assign-elastic-ip.

sebdah avatar sebdah commented on June 3, 2024

@ankitcha No active work ongoing for this one. Please submit a PR. I'd be happy to review and merge.

from aws-ec2-assign-elastic-ip.

pmkane avatar pmkane commented on June 3, 2024

I need this too. I will submit a PR.

from aws-ec2-assign-elastic-ip.

 avatar commented on June 3, 2024

Hi Sebastian,

How I need to run this code in Lambda ?
My task is to attach EIP's to newly launched instances, I've setup the Auto Scaling Group and created the Life Cycle Hooks. But how can I put this code in Lambda ?

from aws-ec2-assign-elastic-ip.

pmkane avatar pmkane commented on June 3, 2024

With boto3 in master, I've put up a branch that adds support for controlling AllowReassociation via a CLI flag:

https://github.com/pmkane/aws-ec2-assign-elastic-ip/tree/allow_reassociation

Currently, it does not prefer to assign unassociated IPs, in the case that multiple IPs are available for association. This meets our internal requirements, but I imagine could be surprising behavior if someone runs the command without any command-line requirements.

In our own use case, we would only use --allow-reassociation in combination with --valid-ips with a single IP specified. If that fit other folks' requirements too, we could enforce that policy in the tool.

Thoughts @sebdah or others?

from aws-ec2-assign-elastic-ip.

sebdah avatar sebdah commented on June 3, 2024

@pmkane I think there is a clear use case for --allow-reassociation (false by default). Your use case with --valid-ips is likely the most common and least dangerous one. But I'm not so sure we should limit the tool to that requirement.

However, maybe a safe behavior would be to enforce --valid-ips in the normal use case and add a --force flag to override that check?

Happy to review / merge etc, so feel free to submit a PR.

from aws-ec2-assign-elastic-ip.

sebdah avatar sebdah commented on June 3, 2024

In addition to ☝️, #40 is adding a flag --tag which should probably also be considered along with --valid-ips.

from aws-ec2-assign-elastic-ip.

pmkane avatar pmkane commented on June 3, 2024

Thanks @sebdah , agreed with all. If the PR for #40 is going to be merged soon, I will wait until that happens and then submit a PR. If not, I'll go ahead now.

from aws-ec2-assign-elastic-ip.

sebdah avatar sebdah commented on June 3, 2024

👍 I think you can go ahead 🙇, there's some work to get #40 ready for merging.

from aws-ec2-assign-elastic-ip.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.