Class: Ec2::SecurityGroup
- Inherits:
-
Object
- Object
- Ec2::SecurityGroup
show all
- Includes:
- Helper, Logger
- Defined in:
- lib/ec2/security_group.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods included from Logger
#debug?, #logger, logger, #stderr, stderr
Methods included from Helper
#error
Constructor Details
#initialize(name, vpc_id: nil) ⇒ SecurityGroup
Returns a new instance of SecurityGroup.
13
14
15
16
17
18
|
# File 'lib/ec2/security_group.rb', line 13
def initialize(name, vpc_id: nil)
error "vpc_id not specified for security group" if not vpc_id
@vpc_id = vpc_id.to_s
@name = name
@dry_run = false
end
|
Instance Attribute Details
#desired_permissions ⇒ Object
Returns the value of attribute desired_permissions.
11
12
13
|
# File 'lib/ec2/security_group.rb', line 11
def desired_permissions
@desired_permissions
end
|
Instance Method Details
#created(&block) ⇒ Object
34
35
36
37
38
39
|
# File 'lib/ec2/security_group.rb', line 34
def created(&block)
clear_vars
instance_eval &block
create if not exists?
sync
end
|
#description(description) ⇒ Object
25
26
27
|
# File 'lib/ec2/security_group.rb', line 25
def description(description)
@description = description
end
|
#id ⇒ Object
20
21
22
23
|
# File 'lib/ec2/security_group.rb', line 20
def id
return @id unless @id.nil?
@id = load_id
end
|
#id! ⇒ Object
29
30
31
32
|
# File 'lib/ec2/security_group.rb', line 29
def id!
error "specified security_group #{@name} doesn't exist in vpc #{@vpc_id}" if not exists?
id
end
|