AWS ECS
Disclaimer
Your use of this download is governed by Stonebranch's Terms of Use.
Version Information
Template Name | Extension Name | Version | Status |
---|---|---|---|
AWS ECS | ue-aws-ecs | 1 (Current 1.0.0) | Fixes and new Features are introduced. |
Refer to Changelog for version history information.
Overview
Amazon Elastic Container Service (AWS ECS) is a fully managed container orchestration service that simplifies the deployment, management, and scaling of containerized applications. ECS allows you to run and scale Docker containers on AWS infrastructure without needing to manage the underlying hardware or software, making it easier to build, deploy, and operate containerized applications. It integrates seamlessly with other AWS services, supports both serverless (AWS Fargate) and server-based (EC2) compute options, and provides robust security, networking, and monitoring capabilities.
In Amazon Elastic Container Service (AWS ECS), an ECS task is a running instance of a task definition. Tasks use case is ideal for one-time or short-lived jobs. For example:
Batch Jobs: Suitable for batch processing, data transformations, and other workloads that are completed after a certain period.
Task Scheduling: Useful for scheduled tasks, such as cron jobs, where you need to run a task at specific intervals.
Manual Execution: Good for tasks that you want to run on-demand or manually trigger through an event or user action
This integration provides the capability to run ECS Tasks allowing the above use cases to be fulfilled through UAC, where UAC has the role of an orchestrator.
Key Features
Feature | Description |
---|---|
Run Task | Run a single instance of a Task on AWS ECS. |
Stop Task | Stop a single instance of a Task on AWS ECS. |
Software Requirements
This integration requires a Universal Agent and a Python runtime to execute the Universal Task and comes bundled with Amazon Boto3 Python AWS SDK V.1.34.136.
Area | Details |
---|---|
Python Version | Requires Python 3.11 tested with Agent Bundled Python 3.11.6. |
Universal Agent Compatibility |
|
Universal Controller Compatibility | Universal Controller Version >= 7.6.0.0. |
Network and Connectivity | Network connectivity and access rights are required for AWS ECS. |
Supported Actions
Action: Run Task
This action allows the execution of a single ECS task instance from an ECS Task Definition.
Task Authors have full flexibility to provide Task Definition/container overrides, however in most cases the ECS Task default configuration (which is part of its definition on AWS) should be adequate. It is possible also to configure the UAC task in such a way that the Universal Task Instance is finished by the time the ECS Task is triggered or wait until the ECS Task is finished (STOPPED).
In the case where the UAC Task Instance only triggers the run of the Task, the Universal Task Instance is considered successful if the triggering of the run operations is successful.
In the case where the UAC Task Instance not only triggers the run of the Task but also waits until it is finished (STOPPED), then If the ECS Task is finished without a Task Error reported by AWS the UAC Task Instance is finished with Success, else with Failure.
Note that the ECS Task may be finished without errors, however some, or all the containers, can finish with an exit code different than zero.
Configuration examples
Scenario A Start an ECS Task with Role Assumption. The Network Configuration field is required if the intent is to run on FARGATE clusters. Group and Started By fields are also provided | Scenario B Start an ECS Task and wait for the Task to Stop. This configuration will also poll to acquire the Task description at defined intervals, in this case, every 60 seconds. It is suggested to avoid setting it too low to avoid rate limit flags. Role assumption is used in this case. |
Scenario C Start an ECS Task with Additional optional Configuration as JSON Text. The list of all available options is available in the Boto3 documentation. | Scenario D Start an ECS Task providing the AWS Region and proxy to be used as an environment variable. Execution Metadata is not provided on EXTENSION Output |
Action Output
Output Type | Description | Examples |
---|---|---|
EXTENSION | The extension output provides the following information:
|
Action: Stop Task
This action stops the execution of a single ECS task. If the ECS task is already stopped the Universal Task Instance will exit with success. It is possible also to configure the UAC task in such a way that the Universal Task Instance is finished by the time the ECS Task Stop is triggered or wait until the ECS Task is stopped.
In the case where the UAC Task Instance only triggers the stop of the Task, the Universal Task Instance is considered successful if the triggering of the stop operations is successful.
In the case where the UAC Task Instance not only triggers the stop of the Task but also waits until it is stopped, If the ECS Task is finished without a Task Error reported by AWS the UAC Task Instance is finished with Success, else with Failure.
Note that the ECS Task may be finished without errors, however some, or all the containers, can finish with an exit code different than zero.
Configuration examples
The configuration from Run Task also applies here. The only difference is that the Stop Task action also requires a Task ARN.
Scenario A Stop an ECS Task with Role Assumption. A Task ARN is required. Optional field Stop Reason is populated. | Scenario B Stop an ECS Task and wait for the Task to Stop. Polling Interval is set to 60 seconds. Execution Metadata is not provided on EXTENSION Output |
Action Output
Output Type | Description | Examples |
---|---|---|
EXTENSION | The extension output provides the following information:
|
Input Fields
Name | Type | Description | Version Information |
---|---|---|---|
Action | Choice | The action performed upon the task execution.
| Introduced in 1.0.0 |
AWS Credentials | Credentials | The Credentials definition should be as follows.
The field population is optional and applicable to all the Actions. When AWS Credentials is not populated as part of the task definition, during task execution the integration will look for AWS Credentials on the task execution environment. Refer to AWS Credential Configuration Options for more information | Introduced in 1.0.0 |
AWS Region | Text | Region for the Amazon Web Service i.e. "us-east-1" The field population is optional and applicable to all the Actions. When AWS Region is not populated as part of the task definition, during task execution the integration will look for the AWS Region on the task execution environment (AWS configuration file or through AWS environment variables). The field is applicable to all the Actions. | Introduced in 1.0.0 |
Cluster | Text | The short name or full Amazon Resource Name (ARN) of the cluster to run your task on. Required for all Actions | Introduced in 1.0.0 |
Assume Role ARN | Large Text | Role ARN of the AWS Assume Role functionality. The Assume Role functionality in AWS (Amazon Web Services) allows a user or service to take on the permissions of another IAM (Identity and Access Management) role temporarily. If the field is left empty Role Assumption is not performed. | Introduced in 1.0.0 |
Task Definition | Text | The family and revision (family:revision) or full ARN of the task definition to run. If a revision isn’t specified, the latest ACTIVE revision is used. Required when Action = “Run Task” | Introduced in 1.0.0 |
Task ARN | Text | The Task ARN of the Task to Stop Required when Action = “Stop Task” | Introduced in 1.0.0 |
Stop Reason | Text | An optional message specified when a task is stopped. This message appears on AWS Console, but also when a task is queried programmatically. | Introduced in 1.0.0 |
Network Configuration (JSON) | Large Text | The field could be required when Action = “Run Task” and represents the network configuration for the task. This parameter is required for task definitions that use the The default value is a placeholder value meant to serve as a way to inform the user of what the available options are. It is not meant to be used directly as a default value for an execution of the integration. task authors can use the default value provided, as a template, however it needs to be modified according to the needs.
|