Class: AWS::EC2::SecurityGroup::IngressIpPermissionCollection
- Inherits:
-
Object
- Object
- AWS::EC2::SecurityGroup::IngressIpPermissionCollection
- Includes:
- Core::Model, Enumerable
- Defined in:
- lib/aws/ec2/security_group/ingress_ip_permission_collection.rb
Instance Attribute Summary collapse
- #security_group ⇒ SecurityGroup readonly
Attributes included from Core::Model
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize(security_group, options = {}) ⇒ IngressIpPermissionCollection
constructor
A new instance of IngressIpPermissionCollection.
Methods included from Core::Model
#client, #config_prefix, #inspect
Constructor Details
#initialize(security_group, options = {}) ⇒ IngressIpPermissionCollection
Returns a new instance of IngressIpPermissionCollection.
23 24 25 26 |
# File 'lib/aws/ec2/security_group/ingress_ip_permission_collection.rb', line 23 def initialize security_group, = {} @security_group = security_group super end |
Instance Attribute Details
#security_group ⇒ SecurityGroup (readonly)
29 30 31 |
# File 'lib/aws/ec2/security_group/ingress_ip_permission_collection.rb', line 29 def security_group @security_group end |
Instance Method Details
#each ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/aws/ec2/security_group/ingress_ip_permission_collection.rb', line 31 def each security_group..each do |p| ports = p[:from_port] ? [p[:from_port], p[:to_port]] : nil ip_ranges = p.ip_ranges.collect{|ip| ip.cidr_ip } groups = p.groups.collect do |group| SecurityGroup.new(group.group_id, :owner_id => group.user_id, :config => config) end = IpPermission.new(security_group, p.ip_protocol, ports, :ip_ranges => ip_ranges, :groups => groups, :config => config) yield() end end |