Class: AWS::EC2::SecurityGroup

Inherits:
Object
  • Object
show all
Defined in:
lib/piculet/ext/security-group.rb,
lib/piculet/ext/ip-permission-collection-ext.rb

Defined Under Namespace

Classes: IpPermissionCollection

Constant Summary collapse

ELB_OWNER =
'amazon-elb'
ELB_NAME =
'amazon-elb-sg'
DESC_SECURITY_GROUP_RETRY_TIMES =
3
DESC_SECURITY_GROUP_RETRY_WAIT =
3

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.elb?(owner_or_name) ⇒ Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/piculet/ext/security-group.rb', line 24

def elb?(owner_or_name)
  [ELB_OWNER, self.elb_sg].include?(owner_or_name)
end

.elb_sgObject



20
21
22
# File 'lib/piculet/ext/security-group.rb', line 20

def elb_sg
  "#{ELB_OWNER}/#{ELB_NAME}"
end

Instance Method Details

#elb?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/piculet/ext/security-group.rb', line 7

def elb?
  self.class.elb?(self.owner_id)
end

#nameObject



13
14
15
16
17
# File 'lib/piculet/ext/security-group.rb', line 13

def name
  self.elb? ? ELB_NAME : name_orig
rescue AWS::EC2::Errors::InvalidGroup::NotFound
  self.id
end

#name_origObject



11
# File 'lib/piculet/ext/security-group.rb', line 11

alias name_orig name