Class: RDS
Overview
Collect RDS Resources
Constant Summary
Constants inherited from Mapper
Mapper::SINGLE_REGION_SERVICES
Instance Method Summary collapse
-
#collect ⇒ Object
Returns an array of resources.
Methods inherited from Mapper
Constructor Details
This class inherits a constructor from Mapper
Instance Method Details
#collect ⇒ Object
Returns an array of resources.
describe_db_engine_versions is skipped with @options.skip_slow
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
# File 'lib/aws_recon/collectors/rds.rb', line 12 def collect resources = [] # # describe_db_clusters # @client.describe_db_clusters.each_with_index do |response, page| log(response.context.operation_name, page) response.db_clusters.each do |cluster| log(response.context.operation_name, cluster.db_cluster_identifier) struct = OpenStruct.new(cluster.to_h) struct.type = 'db_cluster' struct.arn = cluster.db_cluster_arn resources.push(struct.to_h) end end # # describe_db_instances # @client.describe_db_instances.each_with_index do |response, page| log(response.context.operation_name, page) response.db_instances.each do |instance| log(response.context.operation_name, instance.db_instance_identifier) struct = OpenStruct.new(instance.to_h) struct.type = 'db_instance' struct.arn = instance.db_instance_arn struct.parent_id = instance.db_cluster_identifier # TODO: describe_db_snapshots here (with public flag) resources.push(struct.to_h) end end # # describe_db_snapshots # @client.describe_db_snapshots.each_with_index do |response, page| log(response.context.operation_name, page) response.db_snapshots.each do |snapshot| log(response.context.operation_name, snapshot.db_snapshot_identifier) struct = OpenStruct.new(snapshot.to_h) struct.type = 'db_snapshot' struct.arn = snapshot.db_snapshot_arn struct.parent_id = snapshot.db_instance_identifier resources.push(struct.to_h) end end # # describe_db_cluster_snapshots # @client.describe_db_cluster_snapshots.each_with_index do |response, page| log(response.context.operation_name, page) response.db_cluster_snapshots.each do |snapshot| log(response.context.operation_name, snapshot.db_cluster_snapshot_identifier) struct = OpenStruct.new(snapshot.to_h) struct.type = 'db_cluster_snapshot' struct.arn = snapshot.db_cluster_snapshot_arn struct.parent_id = snapshot.db_cluster_identifier resources.push(struct.to_h) end end # # describe_db_engine_versions # ### unless @options.skip_slow ### @client.describe_db_engine_versions.each_with_index do |response, page| ### log(response.context.operation_name, page) ### response.db_engine_versions.each do |version| ### struct = OpenStruct.new(version.to_h) ### struct.type = 'db_engine_version' ### resources.push(struct.to_h) ### end ### end ### end resources end |