class RenderCFN::SecurityGroup

Public Class Methods

new( arguments) click to toggle source
# File lib/renderCFN/securityGroup.rb, line 5
def initialize( arguments)
  @name = "#{arguments[:name]}SecurityGroup"
  @awsObject = { 
    @name => {
      'Type' => 'AWS::EC2::SecurityGroup', 
      'Properties' => {
        'GroupDescription' => arguments[:desc],
        'VpcId' => arguments[:vpcID],
        'SecurityGroupIngress' => [ 
        ]
      }
    }
  }
end

Public Instance Methods

addPort( protocol, ip, from, to=from) click to toggle source
# File lib/renderCFN/securityGroup.rb, line 20
def addPort( protocol, ip, from, to=from)

  entry = { 'IpProtocol' => protocol,
          'CidrIp' => ip,
          'FromPort' => from,
          'ToPort' =>  to
        }
  @awsObject[@name]['Properties']['SecurityGroupIngress'].push( entry)
end