Last active
February 27, 2023 22:36
-
-
Save jsbonso/6c6ca23373d0516d7a55a9aeaeaa26ff to your computer and use it in GitHub Desktop.
Shell Script to add your IP to your EC2 Security Group using AWS CLI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MY_IP=`curl checkip.amazonaws.com` | |
echo $MY_IP | |
aws ec2 authorize-security-group-ingress \ | |
--group-id sg-01298cde13c80c75 \ | |
--protocol tcp \ | |
--port 22 \ | |
--cidr $MY_IP/32 \ | |
--region us-east-1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment