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:, enabled: true, description: nil, target_id: nil, task_definition_name:, revision: nil, task_count: nil, role_arn:, network_configuration: nil, launch_type: nil, platform_version: nil, group: nil, region: nil, container_overrides: nil) ⇒ ScheduledTask
constructor
A new instance of ScheduledTask.
Constructor Details
#initialize(cluster:, rule_name:, schedule_expression:, enabled: true, description: nil, target_id: nil, task_definition_name:, revision: nil, task_count: nil, role_arn:, network_configuration: nil, launch_type: nil, platform_version: nil, group: nil, region: nil, container_overrides: nil) ⇒ 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 30 31 32 33 34 35 |
# File 'lib/ecs_deploy/scheduled_task.rb', line 10 def initialize( cluster:, rule_name:, schedule_expression:, enabled: true, description: nil, target_id: nil, task_definition_name:, revision: nil, task_count: nil, role_arn:, network_configuration: nil, launch_type: nil, platform_version: nil, group: nil, region: nil, container_overrides: nil ) @cluster = cluster @rule_name = rule_name @schedule_expression = schedule_expression @enabled = enabled @description = description @target_id = target_id || task_definition_name @task_definition_name = task_definition_name @task_count = task_count || 1 @revision = revision @role_arn = role_arn @network_configuration = network_configuration @launch_type = launch_type || "EC2" @platform_version = platform_version @group = group region ||= EcsDeploy.config.default_region @container_overrides = container_overrides @client = region ? Aws::ECS::Client.new(region: region) : Aws::ECS::Client.new @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
37 38 39 40 |
# File 'lib/ecs_deploy/scheduled_task.rb', line 37 def deploy put_rule put_targets end |