methods/ec_common.rb
# Add rule to AWS EC2 security group
Add rule to AWS EC2 security group
Add rule to AWS EC2 security group
def add_rule_to_aws_security_group(options)
  if not options['service']== options['empty']
    options = get_aws_ip_service_info(options)
  end
  if not options['group'].to_s.match(/^sg/)
    options['group'] = get_aws_security_group_id(options)
  end
  if options['dir'].to_s.match(/egress/)
    add_egress_rule_to_aws_security_group(options)
  else
    add_ingress_rule_to_aws_security_group(options)
  end
  return options
end
def add_rule_to_aws_security_group ( options ) if not options [ 'service' ] == options [ 'empty' ] options = get_aws_ip_service_info ( options ) end if not options [ 'group' ] . to_s . match ( / ^sg / ) options [ 'group' ] = get_aws_security_group_id ( options ) end if options [ 'dir' ] . to_s . match ( / egress / ) add_egress_rule_to_aws_security_group ( options ) else add_ingress_rule_to_aws_security_group ( options ) end return options end
Add rule to AWS EC2 security group
Add rule to AWS EC2 security group
options
<not_specific>