Last active
August 29, 2015 14:01
-
-
Save nhajratw/f09291aa942a4fa8d860 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env ruby | |
# | |
# | |
require 'net/http' | |
my_ip = Net::HTTP.get(URI('http://icanhazip.com')) | |
system "aws ec2 authorize-security-group-ingress --group-id sg-2f666d4d --protocol all --cidr #{my_ip}/32" | |
####### | |
# The error i get is: | |
# | |
# A client error (InvalidParameterValue) occurred when calling the AuthorizeSecurityGroupIngress operation: invalid CIDR subnet specification: 70.210.77.66 | |
# sh: line 1: /32: No such file or directory | |
# | |
# Seems like it's trying to parse the /32 as a seperate command |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment