Class: EcsDeploy::ScheduledTask
- Inherits:
-
Object
- Object
- EcsDeploy::ScheduledTask
- Defined in:
- lib/ecs_deploy/scheduled_task.rb
Defined Under Namespace
Classes: PutTargetsFailure
Instance Attribute Summary collapse
-
#cluster ⇒ Object
readonly
Returns the value of attribute cluster.
-
#region ⇒ Object
readonly
Returns the value of attribute region.
-
#schedule_rule_name ⇒ Object
readonly
Returns the value of attribute schedule_rule_name.
Instance Method Summary collapse
- #deploy ⇒ Object
-
#initialize(cluster:, rule_name:, schedule_expression:, task_definition_name:, role_arn:, region: nil, **options) ⇒ ScheduledTask
constructor
A new instance of ScheduledTask.
Constructor Details
#initialize(cluster:, rule_name:, schedule_expression:, task_definition_name:, role_arn:, region: nil, **options) ⇒ ScheduledTask
Returns a new instance of ScheduledTask.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/ecs_deploy/scheduled_task.rb', line 10 def initialize(cluster:, rule_name:, schedule_expression:, task_definition_name:, role_arn:, region: nil, **) @cluster = cluster @rule_name = rule_name @schedule_expression = schedule_expression @task_definition_name = task_definition_name @role_arn = role_arn @options = .dup @options[:enabled] = @options.fetch(:enabled, true) @options[:target_id] ||= task_definition_name @options[:task_count] ||= 1 @options[:launch_type] ||= "EC2" region ||= EcsDeploy.config.default_region params ||= EcsDeploy.config.ecs_client_params @client = region ? Aws::ECS::Client.new(params.merge(region: region)) : Aws::ECS::Client.new(params) @region = @client.config.region @cloud_watch_events = Aws::CloudWatchEvents::Client.new(region: @region) end |
Instance Attribute Details
#cluster ⇒ Object (readonly)
Returns the value of attribute cluster.
8 9 10 |
# File 'lib/ecs_deploy/scheduled_task.rb', line 8 def cluster @cluster end |
#region ⇒ Object (readonly)
Returns the value of attribute region.
8 9 10 |
# File 'lib/ecs_deploy/scheduled_task.rb', line 8 def region @region end |
#schedule_rule_name ⇒ Object (readonly)
Returns the value of attribute schedule_rule_name.
8 9 10 |
# File 'lib/ecs_deploy/scheduled_task.rb', line 8 def schedule_rule_name @schedule_rule_name end |
Instance Method Details
#deploy ⇒ Object
31 32 33 34 |
# File 'lib/ecs_deploy/scheduled_task.rb', line 31 def deploy put_rule put_targets end |