Class: RubyAemAws::Component::StackManagerResources
- Inherits:
-
Object
- Object
- RubyAemAws::Component::StackManagerResources
- Includes:
- AbstractStackManager, DynamoDB, MetricVerifier, S3Access, SNSTopic
- Defined in:
- lib/ruby_aem_aws/component/stack_manager_resources.rb
Overview
Interface to the AWS StackManager to send out commands
Instance Attribute Summary collapse
-
#cloud_watch_client ⇒ Object
readonly
Returns the value of attribute cloud_watch_client.
-
#cloud_watch_log_client ⇒ Object
readonly
Returns the value of attribute cloud_watch_log_client.
-
#dynamodb_client ⇒ Object
readonly
Returns the value of attribute dynamodb_client.
-
#s3_client ⇒ Object
readonly
Returns the value of attribute s3_client.
-
#s3_resource ⇒ Object
readonly
Returns the value of attribute s3_resource.
Instance Method Summary collapse
-
#dyn_db_cmd_query(dynamodb_tablename, attribute_value) ⇒ Object
Command state.
-
#dyn_db_msg_scan(dynamodb_tablename, attribute_value) ⇒ Object
Scan result.
-
#initialize(params) ⇒ Object
constructor
-
CloudWatchClient: AWS Cloudwatch Client.
-
-
#s3_download_object(s3_bucket_name, s3_object_name, dest_path = nil) ⇒ Object
AWS S3 client object.
-
#s3_resource_object(s3_bucket_name, s3_object_name) ⇒ Object
AWS S3 resource object.
-
#sns_publish(topicarn, task, stack_prefix, details) ⇒ Object
AWS SNS publish message id.
Methods included from S3Access
#get_s3_bucket, #get_s3_bucket_object, #get_s3_object
Methods included from SNSTopic
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 DynamoDB
Constructor Details
#initialize(params) ⇒ Object
-
CloudWatchClient: AWS Cloudwatch Client.
-
CloudWatchLogsClient: AWS Cloudwatch Logs Client.
-
DynamoDBClient: AWS DynamoDB Client.
-
S3Client: AWS S3 Client.
-
S3Resource: AWS S3 Resource connection.
40 41 42 43 44 45 46 |
# File 'lib/ruby_aem_aws/component/stack_manager_resources.rb', line 40 def initialize(params) @dynamodb_client = params[:DynamoDBClient] @s3_client = params[:S3Client] @s3_resource = params[:S3Resource] @cloud_watch_client = params[:CloudWatchLogsClient] @cloud_watch_log_client = params[:CloudWatchLogsClient] end |
Instance Attribute Details
#cloud_watch_client ⇒ Object (readonly)
Returns the value of attribute cloud_watch_client.
25 26 27 |
# File 'lib/ruby_aem_aws/component/stack_manager_resources.rb', line 25 def cloud_watch_client @cloud_watch_client end |
#cloud_watch_log_client ⇒ Object (readonly)
Returns the value of attribute cloud_watch_log_client.
25 26 27 |
# File 'lib/ruby_aem_aws/component/stack_manager_resources.rb', line 25 def cloud_watch_log_client @cloud_watch_log_client end |
#dynamodb_client ⇒ Object (readonly)
Returns the value of attribute dynamodb_client.
25 26 27 |
# File 'lib/ruby_aem_aws/component/stack_manager_resources.rb', line 25 def dynamodb_client @dynamodb_client end |
#s3_client ⇒ Object (readonly)
Returns the value of attribute s3_client.
25 26 27 |
# File 'lib/ruby_aem_aws/component/stack_manager_resources.rb', line 25 def s3_client @s3_client end |
#s3_resource ⇒ Object (readonly)
Returns the value of attribute s3_resource.
25 26 27 |
# File 'lib/ruby_aem_aws/component/stack_manager_resources.rb', line 25 def s3_resource @s3_resource end |
Instance Method Details
#dyn_db_cmd_query(dynamodb_tablename, attribute_value) ⇒ Object
Returns Command state.
68 69 70 71 72 |
# File 'lib/ruby_aem_aws/component/stack_manager_resources.rb', line 68 def dyn_db_cmd_query(dynamodb_tablename, attribute_value) key_attribute_value = attribute_value.items[0]['command_id'] state = query(filter_for_db_query(dynamodb_tablename, key_attribute_value)) state.items[0]['state'] end |
#dyn_db_msg_scan(dynamodb_tablename, attribute_value) ⇒ Object
Returns Scan result.
61 62 63 |
# File 'lib/ruby_aem_aws/component/stack_manager_resources.rb', line 61 def dyn_db_msg_scan(dynamodb_tablename, attribute_value) scan(filter_for_db_scan(dynamodb_tablename, attribute_value)) end |
#s3_download_object(s3_bucket_name, s3_object_name, dest_path = nil) ⇒ Object
Returns AWS S3 client object.
85 86 87 |
# File 'lib/ruby_aem_aws/component/stack_manager_resources.rb', line 85 def s3_download_object(s3_bucket_name, s3_object_name, dest_path = nil) get_s3_object(s3_bucket_name, s3_object_name, dest_path) end |
#s3_resource_object(s3_bucket_name, s3_object_name) ⇒ Object
Returns AWS S3 resource object.
77 78 79 |
# File 'lib/ruby_aem_aws/component/stack_manager_resources.rb', line 77 def s3_resource_object(s3_bucket_name, s3_object_name) get_s3_bucket_object(s3_bucket_name, s3_object_name) end |
#sns_publish(topicarn, task, stack_prefix, details) ⇒ Object
Returns AWS SNS publish message id.
53 54 55 56 |
# File 'lib/ruby_aem_aws/component/stack_manager_resources.rb', line 53 def sns_publish(topicarn, task, stack_prefix, details) details = JSON.generate(details).tr('\"', '\'') publish(topicarn, (task, stack_prefix, details)) end |