Sha256: c24e37c0e8b7887d2e6a7f69168d2522ba51391f663eaf3349cba86b84dc192c

Contents?: true

Size: 1.02 KB

Versions: 16

Compression:

Stored size: 1.02 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
          (res.respond_to?(:next_page?) && res.next_page? && res = res.next_page) || break
        end
        parameters
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
awspec-1.18.2 lib/awspec/helper/finder/redshift.rb
awspec-1.18.1 lib/awspec/helper/finder/redshift.rb
awspec-1.18.0 lib/awspec/helper/finder/redshift.rb
awspec-1.17.4 lib/awspec/helper/finder/redshift.rb
awspec-1.17.3 lib/awspec/helper/finder/redshift.rb
awspec-1.17.2 lib/awspec/helper/finder/redshift.rb
awspec-1.17.1 lib/awspec/helper/finder/redshift.rb
awspec-1.17.0 lib/awspec/helper/finder/redshift.rb
awspec-1.16.1 lib/awspec/helper/finder/redshift.rb
awspec-1.16.0 lib/awspec/helper/finder/redshift.rb
awspec-1.15.3 lib/awspec/helper/finder/redshift.rb
awspec-1.15.2 lib/awspec/helper/finder/redshift.rb
awspec-1.15.1 lib/awspec/helper/finder/redshift.rb
awspec-1.15.0 lib/awspec/helper/finder/redshift.rb
awspec-1.14.1 lib/awspec/helper/finder/redshift.rb
awspec-1.14.0 lib/awspec/helper/finder/redshift.rb