ExAws.Ecs.Core
Amazon EC2 Container Service
Amazon EC2 Container Service (Amazon ECS) is a highly scalable, fast, container management service that makes it easy to run, stop, and manage Docker containers on a cluster of Amazon EC2 instances. Amazon ECS lets you launch and stop container-enabled applications with simple API calls, allows you to get the state of your cluster from a centralized service, and gives you access to many familiar Amazon EC2 features like security groups, Amazon EBS volumes, and IAM roles.
You can use Amazon ECS to schedule the placement of containers across your cluster based on your resource needs, isolation policies, and availability requirements. Amazon EC2 Container Service eliminates the need for you to operate your own cluster management and configuration management systems or worry about scaling your management infrastructure.
Summary↑
Types ↑
run_task_request :: [cluster: binary, count: boxed_integer, overrides: task_override, started_by: binary, task_definition: binary]
list_task_definitions_response :: [next_token: binary, task_definition_arns: string_list]
client_exception :: [{:message, binary}]
container_override :: [command: string_list, environment: environment_variables, name: binary]
register_task_definition_response :: [{:task_definition, task_definition}]
service :: [cluster_arn: binary, deployments: deployments, desired_count: integer, events: service_events, load_balancers: load_balancers, pending_count: integer, role_arn: binary, running_count: integer, service_arn: binary, service_name: binary, status: binary, task_definition: binary]
describe_services_response :: [failures: failures, services: services]
task_definition :: [container_definitions: container_definitions, family: binary, revision: integer, status: task_definition_status, task_definition_arn: binary, volumes: volume_list]
delete_cluster_response :: [{:cluster, cluster}]
list_tasks_request :: [cluster: binary, container_instance: binary, desired_status: desired_status, family: binary, max_results: boxed_integer, next_token: binary, service_name: binary, started_by: binary]
list_task_definition_families_response :: [families: string_list, next_token: binary]
list_services_response :: [next_token: binary, service_arns: string_list]
describe_clusters_request :: [{:clusters, string_list}]
service_event :: [created_at: timestamp, id: binary, message: binary]
port_mapping :: [container_port: integer, host_port: integer, protocol: transport_protocol]
boxed_boolean :: boolean
delete_cluster_request :: [{:cluster, binary}]
sort_order :: binary
container_definition :: [command: string_list, cpu: integer, entry_point: string_list, environment: environment_variables, essential: boxed_boolean, image: binary, links: string_list, memory: integer, mount_points: mount_point_list, name: binary, port_mappings: port_mapping_list, volumes_from: volume_from_list]
container_instance :: [agent_connected: boolean, agent_update_status: agent_update_status, container_instance_arn: binary, ec2_instance_id: binary, pending_tasks_count: integer, registered_resources: resources, remaining_resources: resources, running_tasks_count: integer, status: binary, version_info: version_info]
load_balancer :: [container_name: binary, container_port: boxed_integer, load_balancer_name: binary]
discover_poll_endpoint_request :: [cluster: binary, container_instance: binary]
describe_task_definition_request :: [{:task_definition, binary}]
string_list :: [binary]
failure :: [arn: binary, reason: binary]
describe_container_instances_response :: [container_instances: container_instances, failures: failures]
resource :: [double_value: double, integer_value: integer, long_value: long, name: binary, string_set_value: string_list, type: binary]
task_override :: [{:container_overrides, container_overrides}]
version_info :: [agent_hash: binary, agent_version: binary, docker_version: binary]
describe_tasks_response :: [failures: failures, tasks: tasks]
list_task_definitions_request :: [family_prefix: binary, max_results: boxed_integer, next_token: binary, sort: sort_order, status: task_definition_status]
register_task_definition_request :: [container_definitions: container_definitions, family: binary, volumes: volume_list]
submit_task_state_change_request :: [cluster: binary, reason: binary, status: binary, task: binary]
describe_container_instances_request :: [cluster: binary, container_instances: string_list]
discover_poll_endpoint_response :: [endpoint: binary, telemetry_endpoint: binary]
create_cluster_request :: [{:cluster_name, binary}]
deployment :: [created_at: timestamp, desired_count: integer, id: binary, pending_count: integer, running_count: integer, status: binary, task_definition: binary, updated_at: timestamp]
stop_task_response :: [{:task, task}]
list_tasks_response :: [next_token: binary, task_arns: string_list]
deregister_container_instance_response :: [{:container_instance, container_instance}]
timestamp :: integer
list_services_request :: [cluster: binary, max_results: boxed_integer, next_token: binary]
describe_task_definition_response :: [{:task_definition, task_definition}]
update_service_request :: [cluster: binary, desired_count: boxed_integer, service: binary, task_definition: binary]
mount_point :: [container_path: binary, read_only: boxed_boolean, source_volume: binary]
run_task_response :: [failures: failures, tasks: tasks]
create_cluster_response :: [{:cluster, cluster}]
update_container_agent_request :: [cluster: binary, container_instance: binary]
delete_service_response :: [{:service, service}]
task_definition_status :: binary
describe_services_request :: [cluster: binary, services: string_list]
submit_container_state_change_request :: [cluster: binary, container_name: binary, exit_code: boxed_integer, network_bindings: network_bindings, reason: binary, status: binary, task: binary]
stop_task_request :: [cluster: binary, task: binary]
list_container_instances_request :: [cluster: binary, max_results: boxed_integer, next_token: binary]
task :: [cluster_arn: binary, container_instance_arn: binary, containers: containers, desired_status: binary, last_status: binary, overrides: task_override, started_by: binary, task_arn: binary, task_definition_arn: binary]
list_clusters_request :: [max_results: boxed_integer, next_token: binary]
double :: float
deregister_task_definition_request :: [{:task_definition, binary}]
transport_protocol :: binary
key_value_pair :: [name: binary, value: binary]
list_task_definition_families_request :: [family_prefix: binary, max_results: boxed_integer, next_token: binary]
long :: integer
start_task_response :: [failures: failures, tasks: tasks]
register_container_instance_response :: [{:container_instance, container_instance}]
boxed_integer :: integer
start_task_request :: [cluster: binary, container_instances: string_list, overrides: task_override, started_by: binary, task_definition: binary]
volume_from :: [read_only: boxed_boolean, source_container: binary]
cluster :: [active_services_count: integer, cluster_arn: binary, cluster_name: binary, pending_tasks_count: integer, registered_container_instances_count: integer, running_tasks_count: integer, status: binary]
host_volume_properties :: [{:source_path, binary}]
network_binding :: [bind_ip: binary, container_port: boxed_integer, host_port: boxed_integer, protocol: transport_protocol]
deployments :: [deployment]
register_container_instance_request :: [cluster: binary, container_instance_arn: binary, instance_identity_document: binary, instance_identity_document_signature: binary, total_resources: resources, version_info: version_info]
delete_service_request :: [cluster: binary, service: binary]
container :: [container_arn: binary, exit_code: boxed_integer, last_status: binary, name: binary, network_bindings: network_bindings, reason: binary, task_arn: binary]
deregister_task_definition_response :: [{:task_definition, task_definition}]
agent_update_status :: binary
containers :: [container]
list_container_instances_response :: [container_instance_arns: string_list, next_token: binary]
update_container_agent_response :: [{:container_instance, container_instance}]
volume_list :: [volume]
describe_tasks_request :: [cluster: binary, tasks: string_list]
list_clusters_response :: [cluster_arns: string_list, next_token: binary]
submit_task_state_change_response :: [{:acknowledgment, binary}]
create_service_response :: [{:service, service}]
volume :: [host: host_volume_properties, name: binary]
server_exception :: [{:message, binary}]
describe_clusters_response :: [clusters: clusters, failures: failures]
desired_status :: binary
create_service_request :: [client_token: binary, cluster: binary, desired_count: boxed_integer, load_balancers: load_balancers, role: binary, service_name: binary, task_definition: binary]
deregister_container_instance_request :: [cluster: binary, container_instance: binary, force: boxed_boolean]
update_service_response :: [{:service, service}]
submit_container_state_change_response :: [{:acknowledgment, binary}]
Functions
Specs:
- create_cluster(client :: ExAws.Ecs.t, input :: create_cluster_request) :: ExAws.Request.JSON.response_t
CreateCluster
Creates a new Amazon ECS cluster. By default, your account will receive a
default
cluster when you launch your first container instance. However,
you can create your own cluster with a unique name with the CreateCluster
action.
Specs:
- create_cluster!(client :: ExAws.Ecs.t, input :: create_cluster_request) :: ExAws.Request.JSON.success_t | no_return
Same as create_cluster/2
but raise on error.
Specs:
- create_service(client :: ExAws.Ecs.t, input :: create_service_request) :: ExAws.Request.JSON.response_t
CreateService
Runs and maintains a desired number of tasks from a specified task
definition. If the number of tasks running in a service drops below
desiredCount
, Amazon ECS will spawn another instantiation of the task in
the specified cluster.
Specs:
- create_service!(client :: ExAws.Ecs.t, input :: create_service_request) :: ExAws.Request.JSON.success_t | no_return
Same as create_service/2
but raise on error.
Specs:
- delete_cluster(client :: ExAws.Ecs.t, input :: delete_cluster_request) :: ExAws.Request.JSON.response_t
DeleteCluster
Deletes the specified cluster. You must deregister all container instances
from this cluster before you may delete it. You can list the container
instances in a cluster with ListContainerInstances
and deregister them
with DeregisterContainerInstance
.
Specs:
- delete_cluster!(client :: ExAws.Ecs.t, input :: delete_cluster_request) :: ExAws.Request.JSON.success_t | no_return
Same as delete_cluster/2
but raise on error.
Specs:
- delete_service(client :: ExAws.Ecs.t, input :: delete_service_request) :: ExAws.Request.JSON.response_t
DeleteService
Deletes a specified service within a cluster.
Specs:
- delete_service!(client :: ExAws.Ecs.t, input :: delete_service_request) :: ExAws.Request.JSON.success_t | no_return
Same as delete_service/2
but raise on error.
Specs:
- deregister_container_instance(client :: ExAws.Ecs.t, input :: deregister_container_instance_request) :: ExAws.Request.JSON.response_t
DeregisterContainerInstance
Deregisters an Amazon ECS container instance from the specified cluster. This instance will no longer be available to run tasks.
If you intend to use the container instance for some other purpose after deregistration, you should stop all of the tasks running on the container instance before deregistration to avoid any orphaned tasks from consuming resources.
Deregistering a container instance removes the instance from a cluster, but it does not terminate the EC2 instance; if you are finished using the instance, be sure to terminate it in the Amazon EC2 console to stop billing.
Note:When you terminate a container instance, it is automatically deregistered from your cluster.
Specs:
- deregister_container_instance!(client :: ExAws.Ecs.t, input :: deregister_container_instance_request) :: ExAws.Request.JSON.success_t | no_return
Same as deregister_container_instance/2
but raise on error.
Specs:
- deregister_task_definition(client :: ExAws.Ecs.t, input :: deregister_task_definition_request) :: ExAws.Request.JSON.response_t
DeregisterTaskDefinition
Deregisters the specified task definition by family and revision. Upon
deregistration, the task definition is marked as INACTIVE
. Existing tasks
and services that reference an INACTIVE
task definition continue to run
without disruption. Existing services that reference an INACTIVE
task
definition can still scale up or down by modifying the service’s desired
count.
You cannot use an INACTIVE
task definition to run new tasks or create new
services, and you cannot update an existing service to reference an
INACTIVE
task definition (although there may be up to a 10 minute window
following deregistration where these restrictions have not yet taken
effect).
Specs:
- deregister_task_definition!(client :: ExAws.Ecs.t, input :: deregister_task_definition_request) :: ExAws.Request.JSON.success_t | no_return
Same as deregister_task_definition/2
but raise on error.
Specs:
- describe_clusters(client :: ExAws.Ecs.t, input :: describe_clusters_request) :: ExAws.Request.JSON.response_t
DescribeClusters
Describes one or more of your clusters.
Specs:
- describe_clusters!(client :: ExAws.Ecs.t, input :: describe_clusters_request) :: ExAws.Request.JSON.success_t | no_return
Same as describe_clusters/2
but raise on error.
Specs:
- describe_container_instances(client :: ExAws.Ecs.t, input :: describe_container_instances_request) :: ExAws.Request.JSON.response_t
DescribeContainerInstances
Describes Amazon EC2 Container Service container instances. Returns metadata about registered and remaining resources on each container instance requested.
Specs:
- describe_container_instances!(client :: ExAws.Ecs.t, input :: describe_container_instances_request) :: ExAws.Request.JSON.success_t | no_return
Same as describe_container_instances/2
but raise on error.
Specs:
- describe_services(client :: ExAws.Ecs.t, input :: describe_services_request) :: ExAws.Request.JSON.response_t
DescribeServices
Describes the specified services running in your cluster.
Specs:
- describe_services!(client :: ExAws.Ecs.t, input :: describe_services_request) :: ExAws.Request.JSON.success_t | no_return
Same as describe_services/2
but raise on error.
Specs:
- describe_task_definition(client :: ExAws.Ecs.t, input :: describe_task_definition_request) :: ExAws.Request.JSON.response_t
DescribeTaskDefinition
Describes a task definition. You can specify a family
and revision
to
find information on a specific task definition, or you can simply specify
the family to find the latest ACTIVE
revision in that family.
Note: You can only describe INACTIVE
task definitions while an active
task or service references them.
Specs:
- describe_task_definition!(client :: ExAws.Ecs.t, input :: describe_task_definition_request) :: ExAws.Request.JSON.success_t | no_return
Same as describe_task_definition/2
but raise on error.
Specs:
- describe_tasks(client :: ExAws.Ecs.t, input :: describe_tasks_request) :: ExAws.Request.JSON.response_t
DescribeTasks
Describes a specified task or tasks.
Specs:
- describe_tasks!(client :: ExAws.Ecs.t, input :: describe_tasks_request) :: ExAws.Request.JSON.success_t | no_return
Same as describe_tasks/2
but raise on error.
Specs:
- discover_poll_endpoint(client :: ExAws.Ecs.t, input :: discover_poll_endpoint_request) :: ExAws.Request.JSON.response_t
DiscoverPollEndpoint
Note:This action is only used by the Amazon EC2 Container Service agent, and it is not intended for use outside of the agent.
Returns an endpoint for the Amazon EC2 Container Service agent to poll for updates.
Specs:
- discover_poll_endpoint!(client :: ExAws.Ecs.t, input :: discover_poll_endpoint_request) :: ExAws.Request.JSON.success_t | no_return
Same as discover_poll_endpoint/2
but raise on error.
Specs:
- list_clusters(client :: ExAws.Ecs.t, input :: list_clusters_request) :: ExAws.Request.JSON.response_t
ListClusters
Returns a list of existing clusters.
Specs:
- list_clusters!(client :: ExAws.Ecs.t, input :: list_clusters_request) :: ExAws.Request.JSON.success_t | no_return
Same as list_clusters/2
but raise on error.
Specs:
- list_container_instances(client :: ExAws.Ecs.t, input :: list_container_instances_request) :: ExAws.Request.JSON.response_t
ListContainerInstances
Returns a list of container instances in a specified cluster.
Specs:
- list_container_instances!(client :: ExAws.Ecs.t, input :: list_container_instances_request) :: ExAws.Request.JSON.success_t | no_return
Same as list_container_instances/2
but raise on error.
Specs:
- list_services(client :: ExAws.Ecs.t, input :: list_services_request) :: ExAws.Request.JSON.response_t
ListServices
Lists the services that are running in a specified cluster.
Specs:
- list_services!(client :: ExAws.Ecs.t, input :: list_services_request) :: ExAws.Request.JSON.success_t | no_return
Same as list_services/2
but raise on error.
Specs:
- list_task_definition_families(client :: ExAws.Ecs.t, input :: list_task_definition_families_request) :: ExAws.Request.JSON.response_t
ListTaskDefinitionFamilies
Returns a list of task definition families that are registered to your
account (which may include task definition families that no longer have any
ACTIVE
task definitions). You can filter the results with the
familyPrefix
parameter.
Specs:
- list_task_definition_families!(client :: ExAws.Ecs.t, input :: list_task_definition_families_request) :: ExAws.Request.JSON.success_t | no_return
Same as list_task_definition_families/2
but raise on error.
Specs:
- list_task_definitions(client :: ExAws.Ecs.t, input :: list_task_definitions_request) :: ExAws.Request.JSON.response_t
ListTaskDefinitions
Returns a list of task definitions that are registered to your account. You
can filter the results by family name with the familyPrefix
parameter or
by status with the status
parameter.
Specs:
- list_task_definitions!(client :: ExAws.Ecs.t, input :: list_task_definitions_request) :: ExAws.Request.JSON.success_t | no_return
Same as list_task_definitions/2
but raise on error.
Specs:
- list_tasks(client :: ExAws.Ecs.t, input :: list_tasks_request) :: ExAws.Request.JSON.response_t
ListTasks
Returns a list of tasks for a specified cluster. You can filter the results
by family name, by a particular container instance, or by the desired
status of the task with the family
, containerInstance
, and
desiredStatus
parameters.
Specs:
- list_tasks!(client :: ExAws.Ecs.t, input :: list_tasks_request) :: ExAws.Request.JSON.success_t | no_return
Same as list_tasks/2
but raise on error.
Specs:
- register_container_instance(client :: ExAws.Ecs.t, input :: register_container_instance_request) :: ExAws.Request.JSON.response_t
RegisterContainerInstance
Note:This action is only used by the Amazon EC2 Container Service agent, and it is not intended for use outside of the agent.
Registers an Amazon EC2 instance into the specified cluster. This instance will become available to place containers on.
Specs:
- register_container_instance!(client :: ExAws.Ecs.t, input :: register_container_instance_request) :: ExAws.Request.JSON.success_t | no_return
Same as register_container_instance/2
but raise on error.
Specs:
- register_task_definition(client :: ExAws.Ecs.t, input :: register_task_definition_request) :: ExAws.Request.JSON.response_t
RegisterTaskDefinition
Registers a new task definition from the supplied family
and
containerDefinitions
. Optionally, you can add data volumes to your
containers with the volumes
parameter. For more information on task
definition parameters and defaults, see Amazon ECS Task
Definitions
in the Amazon EC2 Container Service Developer Guide.
Specs:
- register_task_definition!(client :: ExAws.Ecs.t, input :: register_task_definition_request) :: ExAws.Request.JSON.success_t | no_return
Same as register_task_definition/2
but raise on error.
Specs:
- run_task(client :: ExAws.Ecs.t, input :: run_task_request) :: ExAws.Request.JSON.response_t
RunTask
Start a task using random placement and the default Amazon ECS scheduler.
If you want to use your own scheduler or place a task on a specific
container instance, use StartTask
instead.
** The count
parameter is limited to 10 tasks per call.
**
Specs:
- run_task!(client :: ExAws.Ecs.t, input :: run_task_request) :: ExAws.Request.JSON.success_t | no_return
Same as run_task/2
but raise on error.
Specs:
- start_task(client :: ExAws.Ecs.t, input :: start_task_request) :: ExAws.Request.JSON.response_t
StartTask
Starts a new task from the specified task definition on the specified
container instance or instances. If you want to use the default Amazon ECS
scheduler to place your task, use RunTask
instead.
** The list of container instances to start tasks on is limited to 10.
**
Specs:
- start_task!(client :: ExAws.Ecs.t, input :: start_task_request) :: ExAws.Request.JSON.success_t | no_return
Same as start_task/2
but raise on error.
Specs:
- stop_task(client :: ExAws.Ecs.t, input :: stop_task_request) :: ExAws.Request.JSON.response_t
StopTask
Stops a running task.
Specs:
- stop_task!(client :: ExAws.Ecs.t, input :: stop_task_request) :: ExAws.Request.JSON.success_t | no_return
Same as stop_task/2
but raise on error.
Specs:
- submit_container_state_change(client :: ExAws.Ecs.t, input :: submit_container_state_change_request) :: ExAws.Request.JSON.response_t
SubmitContainerStateChange
Note:This action is only used by the Amazon EC2 Container Service agent, and it is not intended for use outside of the agent.
Sent to acknowledge that a container changed states.
Specs:
- submit_container_state_change!(client :: ExAws.Ecs.t, input :: submit_container_state_change_request) :: ExAws.Request.JSON.success_t | no_return
Same as submit_container_state_change/2
but raise on error.
Specs:
- submit_task_state_change(client :: ExAws.Ecs.t, input :: submit_task_state_change_request) :: ExAws.Request.JSON.response_t
SubmitTaskStateChange
Note:This action is only used by the Amazon EC2 Container Service agent, and it is not intended for use outside of the agent.
Sent to acknowledge that a task changed states.
Specs:
- submit_task_state_change!(client :: ExAws.Ecs.t, input :: submit_task_state_change_request) :: ExAws.Request.JSON.success_t | no_return
Same as submit_task_state_change/2
but raise on error.
Specs:
- update_container_agent(client :: ExAws.Ecs.t, input :: update_container_agent_request) :: ExAws.Request.JSON.response_t
UpdateContainerAgent
Updates the Amazon ECS container agent on a specified container instance. Updating the Amazon ECS container agent does not interrupt running tasks or services on the container instance. The process for updating the agent differs depending on whether your container instance was launched with the Amazon ECS-optimized AMI or another operating system.
UpdateContainerAgent
requires the Amazon ECS-optimized AMI or Amazon
Linux with the ecs-init
service installed and running. For help updating
the Amazon ECS container agent on other operating systems, see Manually
Updating the Amazon ECS Container
Agent
in the Amazon EC2 Container Service Developer Guide.
Specs:
- update_container_agent!(client :: ExAws.Ecs.t, input :: update_container_agent_request) :: ExAws.Request.JSON.success_t | no_return
Same as update_container_agent/2
but raise on error.
Specs:
- update_service(client :: ExAws.Ecs.t, input :: update_service_request) :: ExAws.Request.JSON.response_t
UpdateService
Modify the desired count or task definition used in a service.
You can add to or subtract from the number of instantiations of a task
definition in a service by specifying the cluster that the service is
running in and a new desiredCount
parameter.
You can use UpdateService
to modify your task definition and deploy a new
version of your service, one task at a time. If you modify the task
definition with UpdateService
, Amazon ECS spawns a task with the new
version of the task definition and then stops an old task after the new
version is running. Because UpdateService
starts a new version of the
task before stopping an old version, your cluster must have capacity to
support one more instantiation of the task when UpdateService
is run. If
your cluster cannot support another instantiation of the task used in your
service, you can reduce the desired count of your service by one before
modifying the task definition.
Specs:
- update_service!(client :: ExAws.Ecs.t, input :: update_service_request) :: ExAws.Request.JSON.success_t | no_return
Same as update_service/2
but raise on error.