class Piculet::EC2Wrapper::SecurityGroupCollection::SecurityGroup
Public Class Methods
new(security_group, options)
click to toggle source
# File lib/piculet/wrapper/security-group.rb, line 12 def initialize(security_group, options) @security_group = security_group @options = options end
Public Instance Methods
delete()
click to toggle source
# File lib/piculet/wrapper/security-group.rb, line 32 def delete log(:info, 'Delete SecurityGroup', :red, "#{vpc_id || :classic} > #{name}") if name == 'default' log(:warn, 'SecurityGroup `default` is reserved', :yellow) else unless @options.dry_run @security_group.delete @options.updated = true end end end
egress_ip_permissions()
click to toggle source
# File lib/piculet/wrapper/security-group.rb, line 59 def egress_ip_permissions PermissionCollection.new(@security_group, :egress, @options) end
eql?(dsl)
click to toggle source
# File lib/piculet/wrapper/security-group.rb, line 17 def eql?(dsl) description_eql?(dsl) and tags_eql?(dsl) end
ingress_ip_permissions()
click to toggle source
# File lib/piculet/wrapper/security-group.rb, line 55 def ingress_ip_permissions PermissionCollection.new(@security_group, :ingress, @options) end
update(dsl)
click to toggle source
# File lib/piculet/wrapper/security-group.rb, line 21 def update(dsl) unless description_eql?(dsl) log(:warn, '`description` cannot be updated', :yellow, "#{vpc_id || :classic} > #{name}") end unless tags_eql?(dsl) log(:info, 'Update SecurityGroup', :green, "#{vpc_id || :classic} > #{name}") update_tags(dsl) end end
vpc?()
click to toggle source
# File lib/piculet/wrapper/security-group.rb, line 45 def vpc? !!@security_group end
Private Instance Methods
description_eql?(dsl)
click to toggle source
# File lib/piculet/wrapper/security-group.rb, line 64 def description_eql?(dsl) @security_group.description == dsl.description end