Skip to content

Commit

Permalink
More debug info for security group issue
Browse files Browse the repository at this point in the history
  • Loading branch information
mcianfrocco committed Jul 2, 2017
1 parent cfc4e33 commit 8dd8f17
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions aws/launch_AWS_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,7 @@ def launchInstance(params,keyName,keyPath,AMI,AWS_ACCOUNT_ID):

if params['debug'] is True:
print 'aws ec2 create-security-group --group-name %s --vpc-id %s --description "%s" | grep GroupId' %(securityGroupName,VPC,securityGroupDescript)
print subprocess.Popen('aws ec2 create-security-group --group-name %s --vpc-id %s --description "%s"'%(securityGroupName,VPC,securityGroupDescript), shell=True, stdout=subprocess.PIPE).stdout.read().strip()
print subprocess.Popen('aws ec2 create-security-group --group-name %s --vpc-id %s --description "%s" | grep GroupId' %(securityGroupName,VPC,securityGroupDescript), shell=True, stdout=subprocess.PIPE).stdout.read().strip()
print subprocess.Popen('aws ec2 describe-security-groups --query "SecurityGroups[*].{Groups:GroupName}" | grep Groups| wc -l', shell=True, stdout=subprocess.PIPE).stdout.read().strip()

securityGroupId=subprocess.Popen('aws ec2 create-security-group --group-name %s --vpc-id %s --description "%s" | grep GroupId' %(securityGroupName,VPC,securityGroupDescript), shell=True, stdout=subprocess.PIPE).stdout.read().strip().split()[-1].split('"')[1]

Expand Down

0 comments on commit 8dd8f17

Please sign in to comment.