Class: LambdaWhenever::TargetLambda
- Inherits:
-
Object
- Object
- LambdaWhenever::TargetLambda
- Defined in:
- lib/lambda_whenever/target_lambda.rb
Overview
The TargetLambda class represents a Lambda function as a target for scheduling.
Instance Attribute Summary collapse
-
#arn ⇒ Object
readonly
Returns the value of attribute arn.
-
#input ⇒ Object
readonly
Returns the value of attribute input.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#role_arn ⇒ Object
readonly
Returns the value of attribute role_arn.
-
#task ⇒ Object
readonly
Returns the value of attribute task.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(arn:, task:) ⇒ TargetLambda
constructor
A new instance of TargetLambda.
- #input_json ⇒ Object
Constructor Details
#initialize(arn:, task:) ⇒ TargetLambda
Returns a new instance of TargetLambda.
17 18 19 20 21 |
# File 'lib/lambda_whenever/target_lambda.rb', line 17 def initialize(arn:, task:) @arn = arn @task = task @input = input_json end |
Instance Attribute Details
#arn ⇒ Object (readonly)
Returns the value of attribute arn.
6 7 8 |
# File 'lib/lambda_whenever/target_lambda.rb', line 6 def arn @arn end |
#input ⇒ Object (readonly)
Returns the value of attribute input.
6 7 8 |
# File 'lib/lambda_whenever/target_lambda.rb', line 6 def input @input end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/lambda_whenever/target_lambda.rb', line 6 def name @name end |
#role_arn ⇒ Object (readonly)
Returns the value of attribute role_arn.
6 7 8 |
# File 'lib/lambda_whenever/target_lambda.rb', line 6 def role_arn @role_arn end |
#task ⇒ Object (readonly)
Returns the value of attribute task.
6 7 8 |
# File 'lib/lambda_whenever/target_lambda.rb', line 6 def task @task end |
Class Method Details
.fetch_arn(function_name, client) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/lambda_whenever/target_lambda.rb', line 9 def fetch_arn(function_name, client) response = client.get_function({ function_name: function_name }) response.configuration.function_arn end |
Instance Method Details
#input_json ⇒ Object
24 25 26 27 28 29 30 31 32 |
# File 'lib/lambda_whenever/target_lambda.rb', line 24 def input_json { execution_id: "<aws.scheduler.execution-id>", scheduled_time: "<aws.scheduler.scheduled-time>", schedule_arn: "<aws.scheduler.schedule-arn>", attempt_number: "<aws.scheduler.attempt-number>", commands: task.commands }.to_json end |