Class: AWS::EC2

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

Defined Under Namespace

Classes: SecurityGroup

Constant Summary collapse

DESC_OWNER_ID_RETRY_TIMES =
3
DESC_OWNER_ID_RETRY_WAIT =
3
SECURITY_GROUP_NAME_MAX_LEN =
255

Instance Method Summary collapse

Instance Method Details

#own?(other) ⇒ Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/piculet/ext/ec2-owner-id-ext.rb', line 16

def own?(other)
  other == owner_id
end

#owner_idObject



7
8
9
10
11
12
13
14
# File 'lib/piculet/ext/ec2-owner-id-ext.rb', line 7

def owner_id
  return ENV['AWS_OWNER_ID'] if ENV['AWS_OWNER_ID']
  return @owner_id if @owner_id

  @owner_id = get_owner_id_from_iam || get_owner_id_from_security_group

  return @owner_id
end