Sha256: d44e1a926f2b478085ea102352d7c0c7d743ea19ef0ea13a9cc6f2b146ef2817

Contents?: true

Size: 979 Bytes

Versions: 8

Compression:

Stored size: 979 Bytes

Contents

# frozen_string_literal: true

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

    #
    # get_block_public_access_configuration
    #
    @client.get_block_public_access_configuration.each do |response|
      log(response.context.operation_name)

      struct = OpenStruct.new(response.block_public_access_configuration.to_h)
      struct.type = 'configuration'

      resources.push(struct.to_h)
    end

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

      response.clusters.each do |cluster|
        log(response.context.operation_name, cluster.id)

        struct = OpenStruct.new(@client.describe_cluster({ cluster_id: cluster.id }).cluster.to_h)
        struct.type = 'cluster'
        struct.arn = cluster.cluster_arn

        resources.push(struct.to_h)
      end
    end

    resources
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
aws_recon-0.2.35 lib/aws_recon/collectors/emr.rb
aws_recon-0.2.34 lib/aws_recon/collectors/emr.rb
aws_recon-0.2.33 lib/aws_recon/collectors/emr.rb
aws_recon-0.2.32 lib/aws_recon/collectors/emr.rb
aws_recon-0.2.31 lib/aws_recon/collectors/emr.rb
aws_recon-0.2.30 lib/aws_recon/collectors/emr.rb
aws_recon-0.2.29 lib/aws_recon/collectors/emr.rb
aws_recon-0.2.28 lib/aws_recon/collectors/emr.rb