Class: RubyAemAws::Component::Author
- Inherits:
-
Object
- Object
- RubyAemAws::Component::Author
- Defined in:
- lib/ruby_aem_aws/component/author.rb
Overview
Interface to the AWS instances running the Author components of a full-set AEM stack.
Constant Summary collapse
- ELB_ID =
'AuthorLoadBalancer'.freeze
- ELB_NAME =
'AEM Author Load Balancer'.freeze
Instance Attribute Summary collapse
-
#author_primary ⇒ Object
readonly
Returns the value of attribute author_primary.
-
#author_standby ⇒ Object
readonly
Returns the value of attribute author_standby.
Instance Method Summary collapse
- #get_tags ⇒ Object
-
#healthy? ⇒ Boolean
True, if all author instances are healthy.
-
#initialize(stack_prefix, params) ⇒ Object
constructor
-
CloudWatchClient: AWS Cloudwatch Client.
-
-
#wait_until_healthy ⇒ Object
True, if all author instances are healthy.
Constructor Details
#initialize(stack_prefix, params) ⇒ Object
-
CloudWatchClient: AWS Cloudwatch Client.
-
CloudWatchLogsClient: AWS Cloudwatch Logs Client.
-
Ec2Resource: AWS EC2 Resource connection.
-
ElbClient: AWS ElasticLoadBalancer v2 Client.
34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/ruby_aem_aws/component/author.rb', line 34 def initialize(stack_prefix, params) = { CloudWatchClient: params[:CloudWatchClient], CloudWatchLogsClient: params[:CloudWatchLogsClient], Ec2Resource: params[:Ec2Resource] } @author_primary = Component::AuthorPrimary.new(stack_prefix, ) @author_standby = Component::AuthorStandby.new(stack_prefix, ) @ec2_resource = params[:Ec2Resource] @elb_client = params[:ElbClient] end |
Instance Attribute Details
#author_primary ⇒ Object (readonly)
Returns the value of attribute author_primary.
22 23 24 |
# File 'lib/ruby_aem_aws/component/author.rb', line 22 def @author_primary end |
#author_standby ⇒ Object (readonly)
Returns the value of attribute author_standby.
22 23 24 |
# File 'lib/ruby_aem_aws/component/author.rb', line 22 def @author_standby end |
Instance Method Details
#get_tags ⇒ Object
63 64 65 66 67 68 |
# File 'lib/ruby_aem_aws/component/author.rb', line 63 def = [] .push(.) .push(.) end |
#healthy? ⇒ Boolean
Returns true, if all author instances are healthy.
48 49 50 51 52 53 |
# File 'lib/ruby_aem_aws/component/author.rb', line 48 def healthy? instance = 0 instance += 1 if .healthy? instance += 1 if .healthy? return true unless instance < 2 end |
#wait_until_healthy ⇒ Object
Returns true, if all author instances are healthy.
56 57 58 59 60 61 |
# File 'lib/ruby_aem_aws/component/author.rb', line 56 def wait_until_healthy instance = 0 instance += 1 if .wait_until_healthy.eql? true instance += 1 if .wait_until_healthy.eql? true return true unless instance < 2 end |