Class: OpenStax::Aws::MskCluster

Inherits:
Object
  • Object
show all
Defined in:
lib/openstax/aws/msk_cluster.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cluster_arn:, region:) ⇒ MskCluster

Returns a new instance of MskCluster.



12
13
14
15
# File 'lib/openstax/aws/msk_cluster.rb', line 12

def initialize(cluster_arn:, region:)
  @cluster_arn = cluster_arn
  @client = ::Aws::Kafka::Client.new(region: region)
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



4
5
6
# File 'lib/openstax/aws/msk_cluster.rb', line 4

def client
  @client
end

#cluster_arnObject (readonly)

Returns the value of attribute cluster_arn.



4
5
6
# File 'lib/openstax/aws/msk_cluster.rb', line 4

def cluster_arn
  @cluster_arn
end

Class Method Details

.physical_resource_id_attributeObject



8
9
10
# File 'lib/openstax/aws/msk_cluster.rb', line 8

def self.physical_resource_id_attribute
  :cluster_arn
end

Instance Method Details

#bootstrap_broker_stringObject



17
18
19
# File 'lib/openstax/aws/msk_cluster.rb', line 17

def bootstrap_broker_string
  client.get_bootstrap_brokers(cluster_arn: cluster_arn).bootstrap_broker_string
end

#sorted_bootstrap_broker_stringObject



21
22
23
# File 'lib/openstax/aws/msk_cluster.rb', line 21

def sorted_bootstrap_broker_string
  bootstrap_broker_string.split(',').sort.join(',')
end