Class: Serverspec::Type::AWS::Redshift::Cluster
- Inherits:
-
Base
- Object
- Base
- Serverspec::Type::AWS::Redshift::Cluster
- Defined in:
- lib/resources/redshift/cluster.rb
Overview
The Cluster class exposes the Redshift::Cluster resources
Instance Method Summary collapse
-
#automated_snapshot_retention_period ⇒ Integer
The number of days that automatic cluster snapshots are retained.
-
#availability_zone ⇒ String
The name of the Availability Zone in which the cluster is located.
-
#available? ⇒ Boolean
Indicates whether cluster_status is available.
-
#database_name ⇒ String
The name of the initial database that was created when the cluster was created.
-
#elastic_ip_status ⇒ Hash
Describes the status of the elastic IP address.
-
#encrypted? ⇒ Boolean
If true, data in the cluster is encrypted at rest.
-
#endpoint ⇒ String
The connection endpoint DNS address of the Cluster.
-
#hsm_status ⇒ Hash
Reports whether the Amazon Redshift cluster has finished applying any HSM settings changes specified in a modify cluster command.
-
#initialize(cluster_id, instance = nil) ⇒ Cluster
constructor
AWS SDK for Ruby v2 Aws::RDS::Client wrapper for initializing a Cluster resource.
-
#kms_key_id ⇒ String
The AWS Key Management Service key ID of the encryption key used to encrypt data in the cluster.
-
#listening_port ⇒ Integer
The port that the database engine is listening on.
-
#master_username ⇒ String
The master user name for the cluster.
-
#modify_status ⇒ String
The status of a modify operation, if any, initiated for the cluster.
-
#node_type ⇒ String
The node type for the nodes in the cluster.
-
#nodes ⇒ Array(Hash)
The nodes in a cluster.
-
#number_of_nodes ⇒ Integer
The number of compute nodes in the cluster.
-
#parameter_groups ⇒ Array(String)
The list of cluster parameter groups.
-
#pending_modified_values ⇒ Hash
If present, changes to the cluster are pending.
-
#preferred_maintenance_window ⇒ String
The weekly time range (in UTC) during which system maintenance can occur.
-
#public_key ⇒ String
The public key for the cluster.
-
#publicly_accessible? ⇒ Boolean
If true, the cluster can be accessed from a public network.
-
#restore_status ⇒ Hash
Describes the status of a cluster restore action.
-
#revision_number ⇒ String
The specific revision number of the database in the cluster.
-
#security_groups ⇒ Array(String)
A list of active cluster security groups.
-
#snapshot_copy_status ⇒ Hash
Returns the destination region and retention period that are configured for cross-region snapshot copy.
-
#subnet_group ⇒ String
The name of the subnet group that is associated with the cluster.
-
#tags ⇒ Array(Hash)
The list of tags for the cluster.
-
#to_s ⇒ String
Returns the string representation of Redshift::Cluster.
-
#version ⇒ String
The version ID of the Amazon Redshift engine that is running on the cluster.
-
#version_upgradeable? ⇒ Boolean
If true, major version upgrades will be applied automatically to the cluster during the maintenance window.
-
#vpc_id ⇒ String
The identifier of the VPC the cluster is in, if the cluster is in a VPC.
-
#vpc_security_groups ⇒ Array(String)
A list of active VPC security groups.
Constructor Details
#initialize(cluster_id, instance = nil) ⇒ Cluster
AWS SDK for Ruby v2 Aws::RDS::Client wrapper for initializing a Cluster resource
15 16 17 18 19 20 |
# File 'lib/resources/redshift/cluster.rb', line 15 def initialize(cluster_id, instance = nil) check_init_arg 'cluster_id', 'Redshift::Cluster', cluster_id @cluster_id = cluster_id @aws = instance.nil? ? Aws::Redshift::Client.new : instance get_cluster cluster_id end |
Instance Method Details
#automated_snapshot_retention_period ⇒ Integer
The number of days that automatic cluster snapshots are retained
91 92 93 |
# File 'lib/resources/redshift/cluster.rb', line 91 def automated_snapshot_retention_period @cluster.automated_snapshot_retention_period end |
#availability_zone ⇒ String
The name of the Availability Zone in which the cluster is located
141 142 143 |
# File 'lib/resources/redshift/cluster.rb', line 141 def availability_zone @cluster.availability_zone end |
#available? ⇒ Boolean
Indicates whether cluster_status is available
29 30 31 |
# File 'lib/resources/redshift/cluster.rb', line 29 def available? @cluster.cluster_status == 'available' end |
#database_name ⇒ String
The name of the initial database that was created when the cluster was created. This same name is returned for the life of the cluster. If an initial database was not specified, a database named “dev” was created by default
73 74 75 |
# File 'lib/resources/redshift/cluster.rb', line 73 def database_name @cluster.db_name end |
#elastic_ip_status ⇒ Hash
Describes the status of the elastic IP address
207 208 209 |
# File 'lib/resources/redshift/cluster.rb', line 207 def elastic_ip_status @cluster.elastic_ip_status end |
#encrypted? ⇒ Boolean
If true, data in the cluster is encrypted at rest
45 46 47 |
# File 'lib/resources/redshift/cluster.rb', line 45 def encrypted? @cluster.encrypted end |
#endpoint ⇒ String
The connection endpoint DNS address of the Cluster
79 80 81 |
# File 'lib/resources/redshift/cluster.rb', line 79 def endpoint @cluster.endpoint.address end |
#hsm_status ⇒ Hash
Reports whether the Amazon Redshift cluster has finished applying any HSM settings changes specified in a modify cluster command
182 183 184 |
# File 'lib/resources/redshift/cluster.rb', line 182 def hsm_status @cluster.hsm_status end |
#kms_key_id ⇒ String
The AWS Key Management Service key ID of the encryption key used to encrypt data in the cluster
226 227 228 |
# File 'lib/resources/redshift/cluster.rb', line 226 def kms_key_id @cluster.kms_key_id end |
#listening_port ⇒ Integer
The port that the database engine is listening on
85 86 87 |
# File 'lib/resources/redshift/cluster.rb', line 85 def listening_port @cluster.endpoint.port end |
#master_username ⇒ String
The master user name for the cluster. This name is used to connect to the database that is specified in DBName
64 65 66 |
# File 'lib/resources/redshift/cluster.rb', line 64 def master_username @cluster.master_username end |
#modify_status ⇒ String
The status of a modify operation, if any, initiated for the cluster
57 58 59 |
# File 'lib/resources/redshift/cluster.rb', line 57 def modify_status @cluster.modify_status end |
#node_type ⇒ String
The node type for the nodes in the cluster
51 52 53 |
# File 'lib/resources/redshift/cluster.rb', line 51 def node_type @cluster.node_type end |
#nodes ⇒ Array(Hash)
The nodes in a cluster
201 202 203 |
# File 'lib/resources/redshift/cluster.rb', line 201 def nodes @cluster.cluster_nodes end |
#number_of_nodes ⇒ Integer
The number of compute nodes in the cluster
168 169 170 |
# File 'lib/resources/redshift/cluster.rb', line 168 def number_of_nodes @cluster.number_of_nodes end |
#parameter_groups ⇒ Array(String)
The list of cluster parameter groups
117 118 119 120 121 122 123 |
# File 'lib/resources/redshift/cluster.rb', line 117 def parameter_groups cpgs = [] @cluster.cluster_parameter_groups.each do |cpg| cpgs << cpg.parameter_group_name end cpgs end |
#pending_modified_values ⇒ Hash
If present, changes to the cluster are pending. Specific pending changes are identified by subelements
155 156 157 |
# File 'lib/resources/redshift/cluster.rb', line 155 def pending_modified_values @cluster.pending_modified_values end |
#preferred_maintenance_window ⇒ String
The weekly time range (in UTC) during which system maintenance can occur
148 149 150 |
# File 'lib/resources/redshift/cluster.rb', line 148 def preferred_maintenance_window @cluster.preferred_maintenance_window end |
#public_key ⇒ String
The public key for the cluster
195 196 197 |
# File 'lib/resources/redshift/cluster.rb', line 195 def public_key @cluster.cluster_public_key end |
#publicly_accessible? ⇒ Boolean
If true, the cluster can be accessed from a public network
40 41 42 |
# File 'lib/resources/redshift/cluster.rb', line 40 def publicly_accessible? @cluster.publicly_accessible end |
#restore_status ⇒ Hash
Describes the status of a cluster restore action. Returns null if the cluster was not created by restoring a snapshot
175 176 177 |
# File 'lib/resources/redshift/cluster.rb', line 175 def restore_status @cluster.restore_status end |
#revision_number ⇒ String
The specific revision number of the database in the cluster
213 214 215 |
# File 'lib/resources/redshift/cluster.rb', line 213 def revision_number @cluster.cluster_revision_number end |
#security_groups ⇒ Array(String)
A list of active cluster security groups
97 98 99 100 101 102 103 |
# File 'lib/resources/redshift/cluster.rb', line 97 def security_groups sgs = [] @cluster.cluster_security_groups.each do |sg| sgs << sg.cluster_security_group_name if sg.status == 'active' end sgs end |
#snapshot_copy_status ⇒ Hash
Returns the destination region and retention period that are configured for cross-region snapshot copy
189 190 191 |
# File 'lib/resources/redshift/cluster.rb', line 189 def snapshot_copy_status @cluster.cluster_snapshot_copy_status end |
#subnet_group ⇒ String
The name of the subnet group that is associated with the cluster. This parameter is valid only when the cluster is in a VPC
128 129 130 |
# File 'lib/resources/redshift/cluster.rb', line 128 def subnet_group @cluster.cluster_subnet_group_name end |
#tags ⇒ Array(Hash)
The list of tags for the cluster
219 220 221 |
# File 'lib/resources/redshift/cluster.rb', line 219 def @cluster. end |
#to_s ⇒ String
Returns the string representation of Redshift::Cluster
24 25 26 |
# File 'lib/resources/redshift/cluster.rb', line 24 def to_s "Redshift Cluster: #{@cluster_id}" end |
#version ⇒ String
The version ID of the Amazon Redshift engine that is running on the cluster
162 163 164 |
# File 'lib/resources/redshift/cluster.rb', line 162 def version @cluster.cluster_version end |
#version_upgradeable? ⇒ Boolean
If true, major version upgrades will be applied automatically to the cluster during the maintenance window
35 36 37 |
# File 'lib/resources/redshift/cluster.rb', line 35 def version_upgradeable? @cluster.allow_version_upgrade end |
#vpc_id ⇒ String
The identifier of the VPC the cluster is in, if the cluster is in a VPC
135 136 137 |
# File 'lib/resources/redshift/cluster.rb', line 135 def vpc_id @cluster.vpc_id end |
#vpc_security_groups ⇒ Array(String)
A list of active VPC security groups
107 108 109 110 111 112 113 |
# File 'lib/resources/redshift/cluster.rb', line 107 def vpc_security_groups vsgs = [] @cluster.vpc_security_groups.each do |vsg| vsgs << vsg.vpc_security_group_id if vsg.status == 'active' end vsgs end |