Class: Ironfan::Dsl::SecurityGroup
- Inherits:
-
Ironfan::Dsl
- Object
- Builder
- Ironfan::Dsl
- Ironfan::Dsl::SecurityGroup
- Defined in:
- lib/ironfan/dsl/security_group.rb
Instance Attribute Summary
Attributes included from Gorillib::Resolution
Instance Method Summary collapse
- #authorize_group(other_name) ⇒ Object
- #authorize_port_range(range, cidr_ip = '0.0.0.0/0', ip_protocol = 'tcp') ⇒ Object
- #authorized_by_group(other_name) ⇒ Object
-
#receive!(hsh, &blk) ⇒ Object
This allows Gorillib resolution to merge-resolve a collection of security groups and properly merge authorizations.
Methods inherited from Ironfan::Dsl
#_skip_fields, #skip_fields, #to_manifest
Methods included from Gorillib::Resolution
#deep_resolve, #merge_resolve, #merge_values, #read_resolved_attribute, #read_set_attribute, #read_set_or_underlay_attribute, #read_underlay_attribute, #resolve, #resolve!, #resolve_value
Methods included from CookbookRequirements
#_cookbook_reqs, #children, #cookbook_req, #cookbook_reqs, #join_req
Methods inherited from Builder
Instance Method Details
#authorize_group(other_name) ⇒ Object
45 46 47 48 49 |
# File 'lib/ironfan/dsl/security_group.rb', line 45 def (other_name) << other_name.to_s .compact! .uniq! end |
#authorize_port_range(range, cidr_ip = '0.0.0.0/0', ip_protocol = 'tcp') ⇒ Object
32 33 34 35 36 37 |
# File 'lib/ironfan/dsl/security_group.rb', line 32 def (range, cidr_ip = '0.0.0.0/0', ip_protocol = 'tcp') range = (range .. range) if range.is_a?(Integer) << [range, cidr_ip, ip_protocol] .compact! .uniq! end |
#authorized_by_group(other_name) ⇒ Object
39 40 41 42 43 |
# File 'lib/ironfan/dsl/security_group.rb', line 39 def (other_name) << other_name.to_s .compact! .uniq! end |
#receive!(hsh, &blk) ⇒ Object
This allows Gorillib resolution to merge-resolve a collection of security groups and properly merge authorizations.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/ironfan/dsl/security_group.rb', line 11 def receive!(hsh, &blk) if hsh.respond_to? :attributes hsh = hsh.attributes end super(hsh.merge({ group_authorized: ( + hsh.delete(:group_authorized).to_a + hsh.delete('group_authorized').to_a).uniq, group_authorized_by: ( + hsh.delete(:group_authorized_by).to_a + hsh.delete('group_authorized_by').to_a).uniq, range_authorizations: ( + hsh.delete(:range_authorizations).to_a + hsh.delete('range_authorizations').to_a).uniq, }), &blk) end |