EcsService
Bases: DuploResourceV2
Manage Duplo ECS Resources
A collection of commands to manage ECS services and task definitions.
Commands
apply
create_service
Create an ECS service.
Returns:
| Name | Type | Description |
|---|---|---|
message |
dict
|
A success message. |
Raises:
| Type | Description |
|---|---|
DuploError
|
If the ECS service could not be created. |
Parameters:
--file, -f, --cli-input
delete_service
Delete an ECS service.
Returns:
| Name | Type | Description |
|---|---|---|
message |
dict
|
A message indicating the service has been deleted. |
Parameters:
name
positional
find
find_def
Find the latest version of an ECS task definition by family name.
Returns:
| Name | Type | Description |
|---|---|---|
task_definition |
The latest version of that ECS task definition in the family. |
Raises:
| Type | Description |
|---|---|
DuploError
|
If the ECS task definition could not be found. |
Parameters:
name
positional
find_def_by_arn
Find a ECS task definition by ARN.
Find a task definition by its AWS ARN.
Returns:
| Name | Type | Description |
|---|---|---|
task_definition |
dict
|
The ECS task definition object. |
Raises:
| Type | Description |
|---|---|
DuploError
|
If the ECS task definition could not be found. |
Parameters:
--aws-arn, --arn
find_service_family
Find Service Family by Name
Find an ECS Services task definition family by name.
Returns:
| Name | Type | Description |
|---|---|---|
task_definition_family |
The ECS task definition object. |
Raises:
| Type | Description |
|---|---|
DuploError
|
If the ECS task definition could not be found. |
Parameters:
name
positional
find_task_def_family
Find a ECS task definition family by name.
Returns:
| Type | Description |
|---|---|
|
The ECS task definition object. |
Raises:
| Type | Description |
|---|---|
DuploError
|
If the ECS task definition could not be found. |
Parameters:
name
positional
list
list_services
list_task_def_family
list_tasks
run_task
Run a task from an ECS task definition family's latest definition version."
Execute a task based on some definition.
Wait for task to complete
This supports the global --wait flag to hold the terminal until the task is complete.
Waits for the status of the task to be the desired complete status.
Returns:
| Name | Type | Description |
|---|---|---|
message |
dict
|
A message indicating the task has been run. |
Parameters:
name
positional
--replicas, -r
update_image
Update Image
Creates a new task definition version cloning the latest existing version in the family except for image arguments
If task family is used by an ECS service, method also updates the service to use that newly created definition version
Basic CLI Use
Update image and wait
This supports the global --wait flag to hold the terminal until the service update is complete.
Waits for the status of the service to be the desired running status.
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
A dictionary containing a message about the update status. |
Raises:
| Type | Description |
|---|---|
DuploError
|
If the ECS task definition family could not be updated. |
Parameters:
name
positional
image
positional
--container-image, --container-image
repeatable
update_service
Update an ECS service.
Returns:
| Name | Type | Description |
|---|---|---|
message |
dict
|
A success message. |
Raises:
| Type | Description |
|---|---|
DuploError
|
If the ECS service could not be updated. |
Parameters:
--file, -f, --cli-input
update_taskdef
Update an ECS task definition.
Updates a task definition. This creates a new revision of the task definition and returns the new ARN. Note each definition is immutable so this is effectively a create operation for one item in a set and the latest one is the active one.
Returns:
| Name | Type | Description |
|---|---|---|
task_definition |
dict
|
The updated ECS task definition object. |
Raises:
| Type | Description |
|---|---|
DuploError
|
If the ECS task definition could not be updated. |
Parameters:
--file, -f, --cli-input
Methods
list_detailed_services
List detailed ECS Services
Retrieve a list of all detailed ECS services in a tenant.
Returns:
| Name | Type | Description |
|---|---|---|
list |
list
|
A list of detailed ECS services in the tenant. |