Sha256: ead2b1d66aa3d5e3d64f617b4aad2c8628f15bbc90c70796058e9fd290f78498

Contents?: true

Size: 1.31 KB

Versions: 13

Compression:

Stored size: 1.31 KB

Contents

# frozen_string_literal: true

module Awspec::Helper
  module Finder
    module Redshift
      def find_redshift_cluster_identifier(id)
        res = redshift_client.describe_clusters(cluster_identifier: id)
        res.clusters.single_resource(id)
      rescue StandardError
        nil
      end

      def select_redshift_by_vpc_id(vpc_id)
        res = redshift_client.describe_clusters
        res.clusters.select do |clusters|
          clusters.vpc_id == vpc_id
        end
      end

      def select_all_redshift_cluster_parameters(parameter_group)
        parameters = {}
        res = redshift_client.describe_cluster_parameters({
                                                            parameter_group_name: parameter_group
                                                          })
        loop do
          res.parameters.each do |param|
            parameters[param.parameter_name] = param.parameter_value
          end
          break if res.marker.nil?

          res = redshift_client.describe_cluster_parameters({
                                                              parameter_group_name: parameter_group,
                                                              marker: res.marker
                                                            })
        end
        parameters
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
awspec-1.31.0 lib/awspec/helper/finder/redshift.rb
awspec-1.30.0 lib/awspec/helper/finder/redshift.rb
awspec-1.29.3 lib/awspec/helper/finder/redshift.rb
awspec-1.29.2 lib/awspec/helper/finder/redshift.rb
awspec-1.29.1 lib/awspec/helper/finder/redshift.rb
awspec-1.29.0 lib/awspec/helper/finder/redshift.rb
awspec-1.28.2 lib/awspec/helper/finder/redshift.rb
awspec-1.28.1 lib/awspec/helper/finder/redshift.rb
awspec-1.28.0 lib/awspec/helper/finder/redshift.rb
awspec-1.27.1 lib/awspec/helper/finder/redshift.rb
awspec-1.27.0 lib/awspec/helper/finder/redshift.rb
awspec-1.26.0 lib/awspec/helper/finder/redshift.rb
awspec-1.25.2 lib/awspec/helper/finder/redshift.rb