Class | AWS::EC2::SecurityGroupCollection |
In: |
lib/aws/ec2/security_group_collection.rb
|
Parent: | Collection |
@param [String] group_id The group id of a security group. @return [SecurityGroup] The group with the given id.
Creates a new @param [String] name The name of the security group to create. @param [Hash] options @option options [String] :description An informal description
of this security group. Accepts alphanumeric characters, spaces, dashes, and underscores. If left blank the description will be set to the name.
@option options [VPC,String] :vpc (nil) A VPC or VPC id string to
create the security group in. When specified a VPC security group is created.
@return [SecurityGroup]
Specify one or more criteria to filter security groups by. A subsequent call to each will limit the security groups returned by the set of filters.
If you supply multiple values to filter then these values are treated as an OR condition. To return security groups named ‘test’ or ‘fake’:
security_groups.filter('group-name', 'test', 'fake')
If you want to and conditions together you need to chain calls to filter. To limit security groups to those with a name like ‘test’ and like ‘ruby’:
security_groups. filter('group-name', '*test*'). filter('group-name', '*ruby*').each do |group| #... end
Note that * matches one or more characters and ? matches any one character.
### Valid Filters
protocols, or an ICMP type number.
@return [SecurityGroupCollection] A new collection that represents
a subset of the security groups associated with this account.
@yield [group] @yieldparam [SecurityGroup] group @return [nil]