Class: Awsum::Ec2::SecurityGroup

Inherits:
Object
  • Object
show all
Defined in:
lib/awsum/ec2/security_group.rb

Defined Under Namespace

Classes: GroupPermission, IpPermission, Permission

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ec2, name, description, owner_id, ip_permissions, group_permissions) ⇒ SecurityGroup

Returns a new instance of SecurityGroup.



8
9
10
11
12
13
14
15
# File 'lib/awsum/ec2/security_group.rb', line 8

def initialize(ec2, name, description, owner_id, ip_permissions, group_permissions)
  @ec2 = ec2
  @name = name
  @description = description
  @owner_id = owner_id
  @ip_permissions = ip_permissions
  @group_permissions = group_permissions
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



6
7
8
# File 'lib/awsum/ec2/security_group.rb', line 6

def description
  @description
end

#group_permissionsObject (readonly)

Returns the value of attribute group_permissions.



6
7
8
# File 'lib/awsum/ec2/security_group.rb', line 6

def group_permissions
  @group_permissions
end

#ip_permissionsObject (readonly)

Returns the value of attribute ip_permissions.



6
7
8
# File 'lib/awsum/ec2/security_group.rb', line 6

def ip_permissions
  @ip_permissions
end

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/awsum/ec2/security_group.rb', line 6

def name
  @name
end

#owner_idObject (readonly)

Returns the value of attribute owner_id.



6
7
8
# File 'lib/awsum/ec2/security_group.rb', line 6

def owner_id
  @owner_id
end

Instance Method Details

#authorize(arguments) ⇒ Object

Authorize access

Options:

See Ec2#authorize_security_group_ingress



21
22
23
# File 'lib/awsum/ec2/security_group.rb', line 21

def authorize(arguments)
  @ec2.authorize_security_group_ingress(@name, arguments)
end

#deleteObject

Delete this SecurityGroup



34
35
36
# File 'lib/awsum/ec2/security_group.rb', line 34

def delete
  @ec2.delete_security_group(@name)
end

#revoke(arguments) ⇒ Object

Revoke access

Options:

See Ec2#revoke_security_group_ingress



29
30
31
# File 'lib/awsum/ec2/security_group.rb', line 29

def revoke(arguments)
  @ec2.revoke_security_group_ingress(@name, arguments)
end