class RubyAemAws::Component::StackManagerResources
Interface to the AWS StackManager
to send out commands
Attributes
Public Class Methods
@param dynamodb_client
AWS DynamoDB
client connection @param params Array of AWS Clients and Resource connections:
-
CloudWatchClient: AWS Cloudwatch Client.
-
CloudWatchLogsClient: AWS Cloudwatch Logs Client.
-
DynamoDBClient: AWS
DynamoDB
Client. -
S3Client: AWS S3 Client.
-
S3Resource: AWS S3 Resource connection.
@return new RubyAemAws::StackManager::StackManagerResources
# 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
Public Instance Methods
@param dynamodb_tablename AWS DynamoDB
table name @param attribute_value Attribute value to query for @return Command state
# 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
@param dynamodb_tablename AWS DynamoDB
table name @param attribute_value Attribute value to scan for @return Scan result
# 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
@param s3_bucket_name S3 bucketname @param s3_object_name S3 Object name @param dest_path local download path, default: nil @return AWS S3 client object
# 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
@param s3_bucket_name S3 bucketname @param s3_object_name S3 Object name @return AWS S3 resource object
# 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
@param topicarn AWS SNS-Topic ARN @param task AEM StackManager
task @param stack_prefix AEM Stack-Prefix @param details AEM StackManager
task detail message @return AWS SNS publish message id
# 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, message_for_sns_publish(task, stack_prefix, details)) end