Sha256: 2764fcc24b077bf6017b5dc4a6439e8c84800d8f41f1249f41d1e7f3b5188c61

Contents?: true

Size: 1.27 KB

Versions: 28

Compression:

Stored size: 1.27 KB

Contents

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
        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

28 entries across 28 versions & 3 rubygems

Version Path
awspec-1.25.1 lib/awspec/helper/finder/redshift.rb
awspec-1.25.0 lib/awspec/helper/finder/redshift.rb
awspec-1.24.4 lib/awspec/helper/finder/redshift.rb
awspec-1.24.3 lib/awspec/helper/finder/redshift.rb
awspec-1.24.2 lib/awspec/helper/finder/redshift.rb
awspec-1.24.1 lib/awspec/helper/finder/redshift.rb
awspec-1.24.0 lib/awspec/helper/finder/redshift.rb
awspec-1.23.0 lib/awspec/helper/finder/redshift.rb
awspec-1.22.1 lib/awspec/helper/finder/redshift.rb
awspec-1.22.0 lib/awspec/helper/finder/redshift.rb
awspec-1.21.1 lib/awspec/helper/finder/redshift.rb
awspec-1.21.0 lib/awspec/helper/finder/redshift.rb
awspec-1.20.0 lib/awspec/helper/finder/redshift.rb
awspec-1.19.2 lib/awspec/helper/finder/redshift.rb
awspec-1.19.1 lib/awspec/helper/finder/redshift.rb
awspec-1.19.0 lib/awspec/helper/finder/redshift.rb
cthiesfork-awspec-1.2.4 lib/awspec/helper/finder/redshift.rb
awspec-api_gateway_extended-1.2.4 lib/awspec/helper/finder/redshift.rb
awspec-api_gateway_extended-1.2.3 lib/awspec/helper/finder/redshift.rb
awspec-1.18.6 lib/awspec/helper/finder/redshift.rb