npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

detach-aws-sg-from-eni

v1.0.1

Published

NPX script that lists all the ENIs that are attached to a specific security group and gives the option to remove that security group attachement.

Downloads

10

Readme

detach-aws-sg-from-eni

NPX script that lists all the ENIs that are attached to a specific security group and gives the option to remove that security group attachement.

npx detach-aws-sg-from-eni --id sg-04749f5c743ca2c8c

or

npx detach-aws-sg-from-eni --name my-garbage-sg

Under the hood, this NPX script used the following AWS CLI v2 commands:

  • List the ENIs:
aws ec2 describe-network-interfaces --filters Name=...,Values=...
  • Update the security group IDs on those ENIs:
aws ec2 modify-network-interface-attribute --network-interface-id <ENI ID> --groups <SG ID 2> <SG ID 2>

Official doc at:

  • https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-network-interfaces.html
  • https://docs.aws.amazon.com/cli/latest/reference/ec2/modify-network-interface-attribute.html

Why creating this

When provisioning AWS Lambda in private subnets using IaC tools such as Pulumi, Terraform or CloudFormation, ENIs are created in the background. If security groups are also configured on that Lambda, those security groups are implicitly attached to those ENIs, though those ENIs are not explicitly described in the IaC scripts. When the stack is destroyed, the security groups get stuck because the IaC is not aware of the relation between the ENIs and those security groups. Manually detaching security groups from ENIs in the AWS console can be tedious and prone to human mistakes. This utility aims to fix this issue safely and transparently.

License

BSD 3-Clause License