Class: RubyAemAws::Component::AuthorStandby

Inherits:
Object
  • Object
show all
Includes:
AbstractGroupedComponent, AbstractSnapshot, HealthyStateVerifier, MetricVerifier, SnapshotVerifier
Defined in:
lib/ruby_aem_aws/component/author_standby.rb

Overview

Interface to the AWS instance running the Author-Standby component of a full-set AEM stack.

Constant Summary collapse

EC2_COMPONENT =
'author-standby'.freeze
EC2_NAME =
'AEM Author - Standby'.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from SnapshotVerifier

#snapshot?, #snapshots?

Methods included from MetricVerifier

#alarm?, #component_alarm?, #component_ec2_metric?, #component_log_event?, #component_log_stream?, #component_loggroup?, #component_metric?, #log_event?, #log_stream?, #loggroup?, #metric?

Methods included from RubyAemAws::CloudwatchClient

#get_alarm, #get_log_event, #get_log_streams, #get_metrics

Methods included from HealthyStateVerifier

#healthy?, #wait_until_healthy

Methods included from AbstractSnapshot

#get_snapshot_by_id, #get_snapshots_by_type

Methods included from AbstractComponent

#to_s

Methods included from InstanceDescriber

#describe_instance, #describe_instances

Methods included from AbstractGroupedComponent

#get_all_instances, #get_instance_by_id, #get_num_of_instances, #get_random_instance

Constructor Details

#initialize(stack_prefix, params) ⇒ Object

  • CloudWatchClient: AWS Cloudwatch Client.

  • CloudWatchLogsClient: AWS Cloudwatch Logs Client.

  • Ec2Resource: AWS EC2 Resource connection.

Parameters:

  • stack_prefix

    AWS tag: StackPrefix

  • params

    Array of AWS Clients and Resource connections:



41
42
43
44
45
46
47
# File 'lib/ruby_aem_aws/component/author_standby.rb', line 41

def initialize(stack_prefix, params)
  @descriptor = ComponentDescriptor.new(stack_prefix,
                                        EC2Descriptor.new(EC2_COMPONENT, EC2_NAME))
  @cloud_watch_client = params[:CloudWatchClient]
  @cloud_watch_log_client = params[:CloudWatchLogsClient]
  @ec2_resource = params[:Ec2Resource]
end

Instance Attribute Details

#cloud_watch_clientObject (readonly)

Returns the value of attribute cloud_watch_client.



25
26
27
# File 'lib/ruby_aem_aws/component/author_standby.rb', line 25

def cloud_watch_client
  @cloud_watch_client
end

#cloud_watch_log_clientObject (readonly)

Returns the value of attribute cloud_watch_log_client.



25
26
27
# File 'lib/ruby_aem_aws/component/author_standby.rb', line 25

def cloud_watch_log_client
  @cloud_watch_log_client
end

#descriptorObject (readonly)

Returns the value of attribute descriptor.



25
26
27
# File 'lib/ruby_aem_aws/component/author_standby.rb', line 25

def descriptor
  @descriptor
end

#ec2_resourceObject (readonly)

Returns the value of attribute ec2_resource.



25
26
27
# File 'lib/ruby_aem_aws/component/author_standby.rb', line 25

def ec2_resource
  @ec2_resource
end

Instance Method Details

#terminateObject

Returns Aws::EC2::Instance.

Returns:

  • Aws::EC2::Instance



50
51
52
53
54
# File 'lib/ruby_aem_aws/component/author_standby.rb', line 50

def terminate
  instance = get_instance
  instance.terminate
  instance.wait_until_terminated
end