Skip to content

Instantly share code, notes, and snippets.

@dandye
Created January 17, 2017 13:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dandye/8d695dbb888eb124386defc9a61ae96c to your computer and use it in GitHub Desktop.
Save dandye/8d695dbb888eb124386defc9a61ae96c to your computer and use it in GitHub Desktop.
AWS CLI Open Port for my IP in specified security group
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