Module: Awspec::Helper::Finder::Redshift
- Included in:
- Awspec::Helper::Finder
- Defined in:
- lib/awspec/helper/finder/redshift.rb
Instance Method Summary collapse
- #find_redshift_cluster_identifier(id) ⇒ Object
- #select_all_redshift_cluster_parameters(parameter_group) ⇒ Object
- #select_redshift_by_vpc_id(vpc_id) ⇒ Object
Instance Method Details
#find_redshift_cluster_identifier(id) ⇒ Object
6 7 8 9 10 11 |
# File 'lib/awspec/helper/finder/redshift.rb', line 6 def find_redshift_cluster_identifier(id) res = redshift_client.describe_clusters(cluster_identifier: id) res.clusters.single_resource(id) rescue StandardError nil end |
#select_all_redshift_cluster_parameters(parameter_group) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/awspec/helper/finder/redshift.rb', line 20 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 |
#select_redshift_by_vpc_id(vpc_id) ⇒ Object
13 14 15 16 17 18 |
# File 'lib/awspec/helper/finder/redshift.rb', line 13 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 |