AWS SDK for Ruby
Developer Guide

Getting Information about All Amazon RDS Security Groups

The following example lists the names of all of your Amazon RDS security groups in the us-west-2 region.


Amazon RDS security groups are only applicable when you are using the Amazon EC2-Classic platform. If you are using Amazon EC2-VPC, use VPC security groups. Both are shown in the example.

require 'aws-sdk-rds' # v2: require 'aws-sdk' rds = 'us-west-2') rds.db_instances.each do |i| # Show any security group IDs and descriptions puts 'Security Groups:' i.db_security_groups.each do |sg| puts sg.db_security_group_name puts ' ' + sg.db_security_group_description puts end # Show any VPC security group IDs and their status puts 'VPC Security Groups:' i.vpc_security_groups.each do |vsg| puts vsg.vpc_security_group_id puts ' ' + vsg.status puts end end