Skip to content

Instantly share code, notes, and snippets.

@nhammond101
Last active November 15, 2019 09:20
Show Gist options
  • Save nhammond101/3d11d3e3ee3cd88f7f0b4435e424343a to your computer and use it in GitHub Desktop.
Save nhammond101/3d11d3e3ee3cd88f7f0b4435e424343a to your computer and use it in GitHub Desktop.
Add current IP to AWS EC2 security group for SSH Access using Docker
docker run --rm -it -v ~/.aws:/root/.aws waracle/aws-cli \
aws ec2 \
--profile default \
authorize-security-group-ingress \
--group-id sg-123456780abcdef \
--ip-permissions "FromPort=22,ToPort=22,IpProtocol=tcp,IpRanges=[{CidrIp=$(curl -s https://canihazip.com/s)/32,Description=RoamingIp}]"
@nhammond101
Copy link
Author

Yes, i did spend most of my time thinking of a clever acronym. Pippa stands for Push IP to Aws. I know there's 2 Ps, but it's early

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment