Created
January 17, 2017 13:43
-
-
Save dandye/8d695dbb888eb124386defc9a61ae96c to your computer and use it in GitHub Desktop.
AWS CLI Open Port for my IP in specified security group
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
pip install awscli | |
export AWS_ACCESS_KEY_ID=$AWS_alice_ACCESS_KEY_ID | |
export AWS_SECRET_ACCESS_KEY=$AWS_alice_SECRET_ACCESS_KEY | |
export AWS_DEFAULT_REGION=$AWS_alice_DEFAULT_REGION | |
export AWS_GROUP_ID=$AWS_alice_GROUP_ID | |
aws ec2 authorize-security-group-ingress \ | |
--group-id $AWS_GROUP_ID \ | |
--protocol tcp \ | |
--port 22 \ | |
--cidr $(dig +short myip.opendns.com @resolver1.opendns.com)/32) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment