Sha256: d82af08f7d8a28767d5a04c432d62e0b37e6e4350cf395e9fb9524b0521e1485

Contents?: true

Size: 1.08 KB

Versions: 56

Compression:

Stored size: 1.08 KB

Contents

# frozen_string_literal: true

#
# Collect Redshift resources
#
class Redshift < Mapper
  #
  # Returns an array of resources.
  #
  def collect
    resources = []

    #
    # describe_clusters
    #
    @client.describe_clusters.each_with_index do |response, page|
      log(response.context.operation_name, page)

      response.clusters.each do |cluster|
        struct = OpenStruct.new(cluster.to_h)
        struct.type = 'cluster'
        struct.arn = cluster.cluster_identifier
        struct.logging_status = @client.describe_logging_status({ cluster_identifier: cluster.cluster_identifier }).to_h

        resources.push(struct.to_h)
      end
    end

    #
    # describe_cluster_subnet_groups
    #
    @client.describe_cluster_subnet_groups.each_with_index do |response, page|
      log(response.context.operation_name, page)

      response.cluster_subnet_groups.each do |group|
        struct = OpenStruct.new(group.to_h)
        struct.type = 'subnet_group'
        struct.arn = group.cluster_subnet_group_name

        resources.push(struct.to_h)
      end
    end

    resources
  end
end

Version data entries

56 entries across 56 versions & 1 rubygems

Version Path
aws_recon-0.5.33 lib/aws_recon/collectors/redshift.rb
aws_recon-0.5.32 lib/aws_recon/collectors/redshift.rb
aws_recon-0.5.31 lib/aws_recon/collectors/redshift.rb
aws_recon-0.5.30 lib/aws_recon/collectors/redshift.rb
aws_recon-0.5.29 lib/aws_recon/collectors/redshift.rb
aws_recon-0.5.28 lib/aws_recon/collectors/redshift.rb
aws_recon-0.5.27 lib/aws_recon/collectors/redshift.rb
aws_recon-0.5.26 lib/aws_recon/collectors/redshift.rb
aws_recon-0.5.25 lib/aws_recon/collectors/redshift.rb
aws_recon-0.5.24 lib/aws_recon/collectors/redshift.rb
aws_recon-0.5.23 lib/aws_recon/collectors/redshift.rb
aws_recon-0.5.22 lib/aws_recon/collectors/redshift.rb
aws_recon-0.5.21 lib/aws_recon/collectors/redshift.rb
aws_recon-0.5.20 lib/aws_recon/collectors/redshift.rb
aws_recon-0.5.19 lib/aws_recon/collectors/redshift.rb
aws_recon-0.5.18 lib/aws_recon/collectors/redshift.rb
aws_recon-0.5.17 lib/aws_recon/collectors/redshift.rb
aws_recon-0.5.16 lib/aws_recon/collectors/redshift.rb
aws_recon-0.5.15 lib/aws_recon/collectors/redshift.rb
aws_recon-0.5.14 lib/aws_recon/collectors/redshift.rb