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.4.0 lib/aws_recon/collectors/redshift.rb
aws_recon-0.3.5 lib/aws_recon/collectors/redshift.rb
aws_recon-0.3.4 lib/aws_recon/collectors/redshift.rb
aws_recon-0.3.3 lib/aws_recon/collectors/redshift.rb
aws_recon-0.3.2 lib/aws_recon/collectors/redshift.rb
aws_recon-0.3.1 lib/aws_recon/collectors/redshift.rb
aws_recon-0.3.0 lib/aws_recon/collectors/redshift.rb
aws_recon-0.2.36 lib/aws_recon/collectors/redshift.rb
aws_recon-0.2.35 lib/aws_recon/collectors/redshift.rb
aws_recon-0.2.34 lib/aws_recon/collectors/redshift.rb
aws_recon-0.2.33 lib/aws_recon/collectors/redshift.rb
aws_recon-0.2.32 lib/aws_recon/collectors/redshift.rb
aws_recon-0.2.31 lib/aws_recon/collectors/redshift.rb
aws_recon-0.2.30 lib/aws_recon/collectors/redshift.rb
aws_recon-0.2.29 lib/aws_recon/collectors/redshift.rb
aws_recon-0.2.28 lib/aws_recon/collectors/redshift.rb