Module erlcloud_ecs

An Erlang interface to AWS ECS.

Authors: Pavel Trakhtman (pavvel@alertlogic.com).

Description

An Erlang interface to AWS ECS.

http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_Operations.html

erlcloud_ecs implements the entire 20141113 API except actions use only by EC2 Container Service Agent: http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DiscoverPollEndpoint.html http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_SubmitContainerStateChange.html http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_SubmitTaskStateChange.html

Method names match ECS operations converted to lower_case_with_underscores.

Required parameters are passed as function arguments. In addition all methods take an options proplist argument which can be used to pass optional parameters. See function documentation for examples.

Output is in the form of {ok, Value} or {error, Reason}. The format of Value is controlled by the out option, which defaults to json. The possible values are:

* json - The output from ECS as processed by jsx:decode but with no further manipulation. This would rarely be useful, unless the ECS API is updated to include data that is not yet parsed correctly.

* record - A record containing all the information from the ECS response except field types.

ECS errors are return in the form {error, {ErrorCode, Message}} where ErrorCode and 'Message' are both binary strings. List of error codes: http://docs.aws.amazon.com/AmazonECS/latest/developerguide/troubleshooting.html#api_failures_messages.

See the unit tests for additional usage examples beyond what are provided for each function.

Data Types

arn()

arn() = binary()

attr_name()

attr_name() = binary() | string()

client_token_opt()

client_token_opt() = {client_token, string_param()}

cluster_opt()

cluster_opt() = {cluster, string_param()}

container_definition_opt()

container_definition_opt() = {command, [string_param()]} | {cpu, pos_integer()} | {disable_networking, boolean()} | {dns_search_domains, [string_param()]} | {dns_servers, [string_param()]} | {docker_labels, [{string_param(), string_param()}]} | {docker_security_options, [string() | boolean()]} | {entry_point, [string_param()]} | container_environment_opt() | {essential, boolean()} | container_extra_hosts_opt() | {host_name, string_param()} | {image, string_param()} | {links, [string_param()]} | container_log_configuration_opt() | {memory, pos_integer()} | {memory_reservation, pos_integer()} | container_mount_points_opt() | {name, string_param()} | container_port_mappings_opt() | {privileged, boolean()} | {readonly_root_filesystem, boolean()} | {user, string_param()} | container_ulimits_opt() | container_volumes_from_opt() | {working_directory, string_param()}

container_definition_opts()

container_definition_opts() = [container_definition_opt()]

container_environment_opt()

container_environment_opt() = {environment, key_value_pair_opts()}

container_extra_hosts_opt()

container_extra_hosts_opt() = {extra_hosts, ecs_host_entry_opts()}

container_log_configuration_opt()

container_log_configuration_opt() = {log_configuration, ecs_log_configuration_opts()}

container_mount_points_opt()

container_mount_points_opt() = {mount_points, ecs_mount_point_opts()}

container_name_opt()

container_name_opt() = {container_name, string_param()}

container_port_mappings_opt()

container_port_mappings_opt() = {port_mappings, ecs_port_mapping_opts()}

container_port_opt()

container_port_opt() = {container_port, pos_integer()}

container_ulimits_opt()

container_ulimits_opt() = {ulimits, ecs_ulimit_opts()}

container_volumes_from_opt()

container_volumes_from_opt() = {volumes_from, ecs_volume_from_opts()}

create_cluster_opt()

create_cluster_opt() = {cluster_name, string_param()} | out_opt()

create_cluster_opts()

create_cluster_opts() = [create_cluster_opt()]

create_service_opt()

create_service_opt() = client_token_opt() | cluster_opt() | deployment_configuration() | load_balancers_opt() | role_opt() | out_opt()

create_service_opts()

create_service_opts() = [create_service_opt()]

delete_service_opt()

delete_service_opt() = {cluster, string_param()} | out_opt()

delete_service_opts()

delete_service_opts() = [delete_service_opt()]

deployment_configuration()

deployment_configuration() = {deployment_configuration, deployment_configuration_opts()}

deployment_configuration_opt()

deployment_configuration_opt() = maximum_percent_opt() | minimum_healthy_percent_opt()

deployment_configuration_opts()

deployment_configuration_opts() = [deployment_configuration_opt()]

deregister_container_instance_opt()

deregister_container_instance_opt() = {cluster, string_param()} | {force, boolean()} | out_opt()

deregister_container_instance_opts()

deregister_container_instance_opts() = [deregister_container_instance_opt()]

describe_clusters_opt()

describe_clusters_opt() = {clusters, [string_param()]} | out_opt()

describe_clusters_opts()

describe_clusters_opts() = [describe_clusters_opt()]

describe_container_instances_opt()

describe_container_instances_opt() = {cluster, string_param()} | out_opt()

describe_container_instances_opts()

describe_container_instances_opts() = [describe_container_instances_opt()]

describe_services_opt()

describe_services_opt() = {cluster, string_param()} | out_opt()

describe_services_opts()

describe_services_opts() = [describe_services_opt()]

describe_tasks_opt()

describe_tasks_opt() = {cluster, string_param()} | out_opt()

describe_tasks_opts()

describe_tasks_opts() = [describe_tasks_opt()]

ecs_container_override_opt()

ecs_container_override_opt() = {command, [string_param()]} | {environment, key_value_pair_opts()} | {name, string_param()}

ecs_container_override_opts()

ecs_container_override_opts() = [maybe_list(ecs_container_override_opt())]

ecs_host_entry_opt()

ecs_host_entry_opt() = {host_name, string_param()} | {ip_address, string_param()}

ecs_host_entry_opts()

ecs_host_entry_opts() = maybe_list([ecs_host_entry_opt()])

ecs_log_configuration_opt()

ecs_log_configuration_opt() = {log_driver, string_param()} | {options, [{string_param(), string_param()}]}

ecs_log_configuration_opts()

ecs_log_configuration_opts() = [ecs_log_configuration_opt()]

ecs_mount_point_opt()

ecs_mount_point_opt() = {container_path, string_param()} | {read_only, boolean()} | {source_volume, string_param()}

ecs_mount_point_opts()

ecs_mount_point_opts() = maybe_list([ecs_mount_point_opt()])

ecs_opts()

ecs_opts() = [out_opt()]

ecs_port_mapping_opt()

ecs_port_mapping_opt() = {container_port, pos_integer()} | {host_port, pos_integer()} | {protocol, ecs_protocol()}

ecs_port_mapping_opts()

ecs_port_mapping_opts() = maybe_list([ecs_port_mapping_opt()])

ecs_return()

ecs_return(Record) = {ok, jsx:json_term() | Record} | {error, term()}

ecs_task_override_opt()

ecs_task_override_opt() = {container_overrides, ecs_container_override_opts()} | {task_role_arn, string_param()}

ecs_task_override_opts()

ecs_task_override_opts() = [ecs_task_override_opt()]

ecs_ulimit_opt()

ecs_ulimit_opt() = {hard_limit, pos_integer()} | {soft_limit, pos_integer()} | {name, string_param()}

ecs_ulimit_opts()

ecs_ulimit_opts() = maybe_list([ecs_ulimit_opt()])

ecs_volume_from_opt()

ecs_volume_from_opt() = {read_only, boolean()} | {source_container, string_param()}

ecs_volume_from_opts()

ecs_volume_from_opts() = maybe_list([ecs_volume_from_opt()])

key_value_pair_opt()

key_value_pair_opt() = {name, string_param()} | {value, string_param()}

key_value_pair_opts()

key_value_pair_opts() = maybe_list([key_value_pair_opt()])

list_clusters_opt()

list_clusters_opt() = {max_results, 1..100} | {next_token, binary()} | out_opt()

list_clusters_opts()

list_clusters_opts() = [list_clusters_opt()]

list_container_instances_opt()

list_container_instances_opt() = {cluster, string_param()} | {max_results, 1..100} | {next_token, binary()} | out_opt()

list_container_instances_opts()

list_container_instances_opts() = [list_container_instances_opt()]

list_services_opt()

list_services_opt() = {cluster, string_param()} | {max_results, 1..100} | {next_token, binary()} | out_opt()

list_services_opts()

list_services_opts() = [list_services_opt()]

list_task_definition_families_opt()

list_task_definition_families_opt() = {family_prefix, string_param()} | {status, active | inactive | all} | {max_results, 1..100} | {next_token, binary()} | out_opt()

list_task_definition_families_opts()

list_task_definition_families_opts() = [list_task_definition_families_opt()]

list_task_definitions_opt()

list_task_definitions_opt() = {family_prefix, string_param()} | {status, active | inactive} | {sort, asc | desc} | {max_results, 1..100} | {next_token, binary()} | out_opt()

list_task_definitions_opts()

list_task_definitions_opts() = [list_task_definitions_opt()]

list_tasks_opt()

list_tasks_opt() = {cluster, string_param()} | {container_instance, string_param()} | {desired_state, running | pending | stopped} | {service_name, string_param()} | {started_by, string_param()} | {family, string_param()} | {sort, asc | desc} | {max_results, 1..100} | {next_token, binary()} | out_opt()

list_tasks_opts()

list_tasks_opts() = [list_tasks_opt()]

load_balancer_name_opt()

load_balancer_name_opt() = {load_balancer_name, string_param()}

load_balancers_opt()

load_balancers_opt() = container_name_opt() | container_port_opt() | load_balancer_name_opt() | target_group_arn_opt()

load_balancers_opts()

load_balancers_opts() = [load_balancers_opt()]

maximum_percent_opt()

maximum_percent_opt() = {maximum_percent, pos_integer()}

maybe_list()

maybe_list(T) = T | [T]

minimum_healthy_percent_opt()

minimum_healthy_percent_opt() = {minimum_healthy_percent, pos_integer()}

out_opt()

out_opt() = {out, out_type()}

out_type()

out_type() = json | record

placement_strategy()

placement_strategy() = {placement_strategy, maybe_list(placement_strategy_opts())}

placement_strategy_field_opt()

placement_strategy_field_opt() = {field, string_param()}

placement_strategy_opt()

placement_strategy_opt() = placement_strategy_field_opt() | placement_strategy_type_opt()

placement_strategy_opts()

placement_strategy_opts() = [placement_strategy_opt()]

placement_strategy_type_opt()

placement_strategy_type_opt() = {type, string_param()}

register_task_definition_opt()

register_task_definition_opt() = {network_mode, ecs_network_mode()} | {task_role_arn, string_param()} | volumes() | out_opt()

register_task_definition_opts()

register_task_definition_opts() = [register_task_definition_opt()]

role_opt()

role_opt() = {role, string_param()}

run_task_opt()

run_task_opt() = {cluster, string_param()} | {count, pos_integer()} | task_overrides_opt() | placement_strategy() | {started_by, string_param()} | out_opt()

run_task_opts()

run_task_opts() = [run_task_opt()]

start_task_opt()

start_task_opt() = {cluster, string_param()} | task_overrides_opt() | {started_by, string_param()} | out_opt()

start_task_opts()

start_task_opts() = [start_task_opt()]

stop_task_opt()

stop_task_opt() = {cluster, string_param()} | {reason, string_param()} | out_opt()

stop_task_opts()

stop_task_opts() = [stop_task_opt()]

string_param()

string_param() = binary() | string()

target_group_arn_opt()

target_group_arn_opt() = {target_group_arn, string_param()}

task_overrides_opt()

task_overrides_opt() = {overrides, ecs_container_override_opts()}

update_container_agent_opts()

update_container_agent_opts() = [{cluster, string_param()} | out_opt()]

update_service_opt()

update_service_opt() = {cluster, string_param()} | deployment_configuration() | {desired_count, pos_integer()} | {task_definition, string_param()} | out_opt()

update_service_opts()

update_service_opts() = [update_service_opt()]

volume_host_opt()

volume_host_opt() = {host, [{source_path, string_param()}]}

volume_name_opt()

volume_name_opt() = {name, string_param()}

volumes()

volumes() = {volumes, maybe_list(volumes_opts())}

volumes_opt()

volumes_opt() = volume_name_opt() | volume_host_opt()

volumes_opts()

volumes_opts() = [volumes_opt()]

Function Index

configure/2
configure/3
configure/4
create_cluster/0
create_cluster/1
create_cluster/2 ECS API http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_CreateCluster.html
create_service/3
create_service/4
create_service/5 ECS API http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_CreateService.html
delete_cluster/1
delete_cluster/2
delete_cluster/3 ECS API http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DeleteCluster.html
delete_service/1
delete_service/2
delete_service/3 ECS API http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DeleteService.html
deregister_container_instance/1
deregister_container_instance/2
deregister_container_instance/3 ECS API http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DeregisterContainerInstance.html
deregister_task_definition/1
deregister_task_definition/2
deregister_task_definition/3 ECS API http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DeregisterTaskDefinition.html
describe_clusters/0
describe_clusters/1
describe_clusters/2 ECS API http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DescribeClusters.html
describe_container_instances/1
describe_container_instances/2
describe_container_instances/3 ECS API http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DescribeContainerInstances.html
describe_services/1
describe_services/2
describe_services/3 ECS API http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DescribeServices.html
describe_task_definition/1
describe_task_definition/2
describe_task_definition/3 ECS API http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DescribeTaskDefinition.html
describe_tasks/1
describe_tasks/2
describe_tasks/3 ECS API http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DescribeTasks.html
list_clusters/0
list_clusters/1
list_clusters/2 ECS API http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_ListClusters.html
list_container_instances/0
list_container_instances/1
list_container_instances/2 ECS API http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_ListContainerInstances.html
list_services/0
list_services/1
list_services/2 ECS API http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_ListServices.html
list_task_definition_families/0
list_task_definition_families/1
list_task_definition_families/2 ECS API http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_ListTaskDefinitionFamilies.html
list_task_definitions/0
list_task_definitions/1
list_task_definitions/2 ECS API http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_ListTaskDefinitions.html
list_tasks/0
list_tasks/1
list_tasks/2 ECS API http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_ListTasks.html
new/2
new/3
new/4
register_task_definition/2
register_task_definition/3
register_task_definition/4 ECS API http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_RegisterTaskDefinition.html
run_task/1
run_task/2
run_task/3 ECS API http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_RunTask.html
start_task/2
start_task/3
start_task/4 ECS API http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_StartTask.html
stop_task/1
stop_task/2
stop_task/3 ECS API http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_StoptTask.html
update_container_agent/1
update_container_agent/2
update_container_agent/3 ECS API http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_UpdateContainerAgent.html
update_service/1
update_service/2
update_service/3 ECS API http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_UpdateService.html

Function Details

configure/2

configure(AccessKeyID::string(), SecretAccessKey::string()) -> ok

configure/3

configure(AccessKeyID::string(), SecretAccessKey::string(), Host::string()) -> ok

configure/4

configure(AccessKeyID::string(), SecretAccessKey::string(), Host::string(), Port::non_neg_integer()) -> ok

create_cluster/0

create_cluster() -> ecs_return(#ecs_cluster{})

create_cluster/1

create_cluster(Aws_config::create_cluster_opts() | aws_config()) -> ecs_return(#ecs_cluster{})

create_cluster/2

create_cluster(Opts::create_cluster_opts(), Config::aws_config()) -> ecs_return(#ecs_cluster{})

ECS API http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_CreateCluster.html

Example

Create ECS Cluster named "NewCluster"

{ok, Cluster} = erlcloud_ecs:create_cluster([{cluster_name, <<"NewCluster">>}, {out, json}]),

create_service/3

create_service(ServiceName::string_param(), TaskDefinition::string_param(), DesiredCount::pos_integer()) -> ecs_return(#ecs_service{})

create_service/4

create_service(ServiceName::string_param(), TaskDefinition::string_param(), DesiredCount::pos_integer(), Aws_config::create_service_opts() | aws_config()) -> ecs_return(#ecs_service{})

create_service/5

create_service(ServiceName::string_param(), TaskDefinition::string_param(), DesiredCount::pos_integer(), Opts::create_service_opts(), Config::aws_config()) -> ecs_return(#ecs_service{})

ECS API http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_CreateService.html

Example

Create ECS Service named "ecs-simple-service-test" in a "NewTest" cluster.

{ok, Service} = erlcloud_ecs:create_service("ecs-simple-service-test", "hello_world", 1, [{cluster, "NewTest"}, {out, json}]).

delete_cluster/1

delete_cluster(ClusterName::string_param()) -> ecs_return(#ecs_cluster{})

delete_cluster/2

delete_cluster(ClusterName::string_param(), Aws_config::ecs_opts() | aws_config()) -> ecs_return(#ecs_cluster{})

delete_cluster/3

delete_cluster(ClusterName::string_param(), Opts::ecs_opts(), Aws_config::aws_config()) -> ecs_return(#ecs_cluster{})

ECS API http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DeleteCluster.html

Example

Delete ECS cluster named "NewTest".

{ok, Service} = erlcloud_ecs:create_service("ecs-simple-service-test", "hello_world", 1, [{cluster, "NewTest"}, {out, json}]).

delete_service/1

delete_service(ServiceName::string_param()) -> ecs_return(#ecs_service{})

delete_service/2

delete_service(ServiceName::string_param(), Aws_config::delete_service_opts() | aws_config()) -> ecs_return(#ecs_service{})

delete_service/3

delete_service(ServiceName::string_param(), Opts::delete_service_opts(), Config::aws_config()) -> ecs_return(#ecs_service{})

ECS API http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DeleteService.html

Example

Delete ECS Service named "ecs-simple-service-test" from "NewTest" cluster.

{ok, Service} = erlcloud_ecs:create_service("ecs-simple-service-test", "hello_world", 1, [{cluster, "NewTest"}, {out, json}]).

deregister_container_instance/1

deregister_container_instance(ContainerInstance::string_param()) -> ecs_return(#ecs_container_instance{})

deregister_container_instance/2

deregister_container_instance(ContainerInstance::string_param(), Aws_config::deregister_container_instance_opts() | aws_config()) -> ecs_return(#ecs_container_instance{})

deregister_container_instance/3

deregister_container_instance(ContainerInstance::string_param(), Opts::deregister_container_instance_opts(), Config::aws_config()) -> ecs_return(#ecs_container_instance{})

ECS API http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DeregisterContainerInstance.html

Example

Dergister ECS Container Instance with id "c9c9a6f2-8766-464b-8805-9c57b9368fb0".

{ok, Result} = deregister_container_instance("c9c9a6f2-8766-464b-8805-9c57b9368fb0", [{out, record}]),

deregister_task_definition/1

deregister_task_definition(TaskDefinition::string_param()) -> ecs_return(#ecs_task_definition{})

deregister_task_definition/2

deregister_task_definition(TaskDefinition::string_param(), Aws_config::ecs_opts() | aws_config()) -> ecs_return(#ecs_task_definition{})

deregister_task_definition/3

deregister_task_definition(TaskDefinition::string_param(), Opts::ecs_opts(), Config::aws_config()) -> ecs_return(#ecs_task_definition{})

ECS API http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DeregisterTaskDefinition.html

Example

Delete ECS task definition named "hello_world:1".

{ok, Service} = erlcloud_ecs:deregister_task_definition("hello_world:1", {out, json}]).

describe_clusters/0

describe_clusters() -> ecs_return(#ecs_describe_clusters{})

describe_clusters/1

describe_clusters(Aws_config::describe_clusters_opts() | aws_config()) -> ecs_return(#ecs_describe_clusters{})

describe_clusters/2

describe_clusters(Opts::describe_clusters_opts(), Config::aws_config()) -> ecs_return(#ecs_describe_clusters{})

ECS API http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DescribeClusters.html

Example

Describe ECS Clusters named "NewCluster" and "TestCluster"

{ok, Clusters} = erlcloud_ecs:describe_clusters([{clusters, ["NewTest", "TestCluster"]}, {out, json}])

describe_container_instances/1

describe_container_instances(Instances::[string_param()]) -> ecs_return(#ecs_describe_container_instances{})

describe_container_instances/2

describe_container_instances(Instances::[string_param()], Aws_config::describe_container_instances_opts() | aws_config()) -> ecs_return(#ecs_describe_container_instances{})

describe_container_instances/3

describe_container_instances(Instances::[string_param()], Opts::describe_container_instances_opts(), Config::aws_config()) -> ecs_return(#ecs_describe_container_instances{})

ECS API http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DescribeContainerInstances.html

Example

Describe ECS Container Instances with the the name "709b350e-8c8e-490c-8fa3-d5fc09ac9e0b" in a "TestCluster" cluster

{ok, Instances} = erlcloud_ecs:describe_container_instances(["709b350e-8c8e-490c-8fa3-d5fc09ac9e0b"], [{cluster, "TestCluster"}, {out, json}]),

describe_services/1

describe_services(Services::[string_param()]) -> ecs_return(#ecs_describe_services{})

describe_services/2

describe_services(Services::[string_param()], Aws_config::describe_services_opts() | aws_config()) -> ecs_return(#ecs_describe_services{})

describe_services/3

describe_services(Services::[string_param()], Opts::describe_services_opts(), Config::aws_config()) -> ecs_return(#ecs_describe_services{})

ECS API http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DescribeServices.html

Example

Describe ECS Service with the the name "sample-webapp" in a "TestCluster" cluster

{ok, Services} = erlcloud_ecs:describe_services(["sample-webapp"], [{cluster, "TestCluster"}, {out, json}]),

describe_task_definition/1

describe_task_definition(TaskDefinition::string_param()) -> ecs_return(#ecs_container_definition{})

describe_task_definition/2

describe_task_definition(TaskDefinition::string_param(), Aws_config::ecs_opts() | aws_config()) -> ecs_return(#ecs_container_definition{})

describe_task_definition/3

describe_task_definition(TaskDefinition::string_param(), Opts::ecs_opts(), Config::aws_config()) -> ecs_return(#ecs_container_definition{})

ECS API http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DescribeTaskDefinition.html

Example

Describe "console-sample-app-static" ECS Task

{ok, TaskDefinition} = erlcloud_ecs:describe_task_definition("console-sample-app-static", [{out, record}]).

describe_tasks/1

describe_tasks(Tasks::[string_param()]) -> ecs_return(#ecs_describe_tasks{})

describe_tasks/2

describe_tasks(Tasks::[string_param()], Aws_config::describe_tasks_opts() | aws_config()) -> ecs_return(#ecs_describe_tasks{})

describe_tasks/3

describe_tasks(Tasks::[string_param()], Opts::describe_tasks_opts(), Config::aws_config()) -> ecs_return(#ecs_describe_tasks{})

ECS API http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DescribeTasks.html

Example

Describe "4c89e317-0571-4f07-878b-a8b8c705c347" ECS Task in a "TestCluster" cluster

{ok, Tasks} = erlcloud_ecs:describe_tasks(["4c89e317-0571-4f07-878b-a8b8c705c347"], [{cluster, "TestCluster"}, {out, json}])

list_clusters/0

list_clusters() -> ecs_return(#ecs_list_clusters{})

list_clusters/1

list_clusters(Opts::list_clusters_opts()) -> ecs_return(#ecs_list_clusters{})

list_clusters/2

list_clusters(Opts::list_clusters_opts(), Config::aws_config()) -> ecs_return(#ecs_list_clusters{})

ECS API http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_ListClusters.html

Example

List ECS Clusters

{ok, Result} = erlcloud_ecs:list_clusters([{max_results, 1}, {out, json}]),

list_container_instances/0

list_container_instances() -> ecs_return(#ecs_list_container_instances{})

list_container_instances/1

list_container_instances(Opts::list_container_instances_opts()) -> ecs_return(#ecs_list_container_instances{})

list_container_instances/2

list_container_instances(Opts::list_container_instances_opts(), Config::aws_config()) -> ecs_return(#ecs_list_container_instances{})

ECS API http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_ListContainerInstances.html

Example

List one container instances from 'TestCluster' ECS Cluster

{ok, Result} = erlcloud_ecs:list_container_instances([{cluster, "TestCluster"}, {max_results, 1}, {out, json}]),

list_services/0

list_services() -> ecs_return(#ecs_list_services{})

list_services/1

list_services(Opts::list_services_opts()) -> ecs_return(#ecs_list_services{})

list_services/2

list_services(Opts::list_services_opts(), Config::aws_config()) -> ecs_return(#ecs_list_services{})

ECS API http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_ListServices.html

Example

List one service from 'TestCluster' ECS Cluster

{ok, Result} = erlcloud_ecs:list_services([{cluster, "TestCluster"}, {max_results, 1}, {out, json}]),

list_task_definition_families/0

list_task_definition_families() -> ecs_return(#ecs_list_task_definition_families{})

list_task_definition_families/1

list_task_definition_families(Opts::list_task_definition_families_opts()) -> ecs_return(#ecs_list_task_definition_families{})

list_task_definition_families/2

list_task_definition_families(Opts::list_task_definition_families_opts(), Config::aws_config()) -> ecs_return(#ecs_list_task_definition_families{})

ECS API http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_ListTaskDefinitionFamilies.html

Example

List active task families with prefix console

{ok, Result} = erlcloud_ecs:list_task_definition_families([{family_prefix, "console"}, {status, "active"}, {out, json}]).

list_task_definitions/0

list_task_definitions() -> ecs_return(#ecs_list_task_definitions{})

list_task_definitions/1

list_task_definitions(Opts::list_task_definitions_opts()) -> ecs_return(#ecs_list_task_definitions{})

list_task_definitions/2

list_task_definitions(Opts::list_task_definitions_opts(), Config::aws_config()) -> ecs_return(#ecs_list_task_definitions{})

ECS API http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_ListTaskDefinitions.html

Example

List active task definitions with prefix 'console-sample-app-static'

{ok, Result} = erlcloud_ecs:list_task_definitions([{family_prefix, "console-sample-app-static"}, {status, "active"}, {out, json}]),

list_tasks/0

list_tasks() -> ecs_return(#ecs_list_tasks{})

list_tasks/1

list_tasks(Opts::list_tasks_opts()) -> ecs_return(#ecs_list_tasks{})

list_tasks/2

list_tasks(Opts::list_tasks_opts(), Config::aws_config()) -> ecs_return(#ecs_list_tasks{})

ECS API http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_ListTasks.html

Example

List tasks for 'TestCluster' ECS Cluster

{ok, Result} = erlcloud_ecs:list_tasks([{cluster, "TestCluster"}, {out, json}]),

new/2

new(AccessKeyID::string(), SecretAccessKey::string()) -> aws_config()

new/3

new(AccessKeyID::string(), SecretAccessKey::string(), Host::string()) -> aws_config()

new/4

new(AccessKeyID::string(), SecretAccessKey::string(), Host::string(), Port::non_neg_integer()) -> aws_config()

register_task_definition/2

register_task_definition(ContainerDefinitions::maybe_list(container_definition_opts()), Family::string_param()) -> ecs_return(#ecs_task_definition{})

register_task_definition/3

register_task_definition(ContainerDefinitions::maybe_list(container_definition_opts()), Family::string_param(), Aws_config::register_task_definition_opts() | aws_config()) -> ecs_return(#ecs_task_definition{})

register_task_definition/4

register_task_definition(ContainerDefinitions::maybe_list(container_definition_opts()), Family::string_param(), Opts::register_task_definition_opts(), Config::aws_config()) -> ecs_return(#ecs_task_definition{})

ECS API http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_RegisterTaskDefinition.html

Example

Register 'hello_world' ECS task definition

{ok, Result} = erlcloud_ecs:register_task_definition([[{memory, 500}, PM, {essential, true}, {name, "wordpress"}, {links, ["mysql"]}, {image, "wordpress"}, {cpu, 10}], [{memory, 500}, {essential, true}, {name, "mysql"}, E, {image, "mysql"}, {cpu, 10}]], "hello_world", [{network_mode, host}]),

run_task/1

run_task(TaskDefinition::string_param()) -> ecs_return(#ecs_run_task{})

run_task/2

run_task(TaskDefinition::string_param(), Aws_config::run_task_opts() | aws_config()) -> ecs_return(#ecs_run_task{})

run_task/3

run_task(TaskDefinition::string_param(), Opts::run_task_opts(), Config::aws_config()) -> ecs_return(#ecs_run_task{})

ECS API http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_RunTask.html

Example

Run ECS task with 'console-sample-app-static' ECS Task Definition in the 'TestCluster'

{ok, Result} = erlcloud_ecs:run_task("console-sample-app-static", [{cluster, "TestCluster"}, {count, 1}, {overrides, [{container_overrides, [{command, ["foo", "bar"]}, {name, "test"}]}, {task_role_arn, "RoleArn"} ] }, {out, record}])

start_task/2

start_task(TaskDefinition::string_param(), ContainerInstances::[string_param()]) -> ecs_return(#ecs_start_task{})

start_task/3

start_task(TaskDefinition::string_param(), ContainerInstances::[string_param()], Aws_config::start_task_opts() | aws_config()) -> ecs_return(#ecs_start_task{})

start_task/4

start_task(TaskDefinition::string_param(), ContainerInstances::[string_param()], Opts::start_task_opts(), Config::aws_config()) -> ecs_return(#ecs_start_task{})

ECS API http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_StartTask.html

Example

Run ECS task with 'console-sample-app-static' ECS Task Definition in the 'TestCluster'

{ok, Result} = erlcloud_ecs:run_task("console-sample-app-static", [{cluster, "TestCluster"}, {count, 1}, {overrides, [{container_overrides, [{command, ["foo", "bar"]}, {name, "test"}]}, {task_role_arn, "RoleArn"} ] }, {out, record}])

stop_task/1

stop_task(Task::string_param()) -> ecs_return(#ecs_task{})

stop_task/2

stop_task(Task::string_param(), Aws_config::stop_task_opts() | aws_config()) -> ecs_return(#ecs_task{})

stop_task/3

stop_task(Task::string_param(), Opts::stop_task_opts(), Aws_config::aws_config()) -> ecs_return(#ecs_task{})

ECS API http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_StoptTask.html

Example

Stop '4c89e317-0571-4f07-878b-a8b8c705c347' ECS task in the 'TestCluster'

{ok, Result} = erlcloud_ecs:stop_task("4c89e317-0571-4f07-878b-a8b8c705c347", [{cluster, "TestCluster"}, {out, record}]),

update_container_agent/1

update_container_agent(ContainerInstance::string_param()) -> ecs_return(#ecs_container_instance{})

update_container_agent/2

update_container_agent(ContainerInstance::string_param(), Aws_config::update_container_agent_opts() | aws_config()) -> ecs_return(#ecs_container_instance{})

update_container_agent/3

update_container_agent(ContainerInstance::string_param(), Opts::update_container_agent_opts(), Config::aws_config()) -> ecs_return(#ecs_container_instance{})

ECS API http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_UpdateContainerAgent.html

Example

Stop '709b350e-8c8e-490c-8fa3-d5fc09ac9e0b' ECS instance in the 'TestCluster'

{ok, Result} = erlcloud_ecs:update_container_agent("709b350e-8c8e-490c-8fa3-d5fc09ac9e0b", [{cluster, "TestCluster"}, {out, record}]),

update_service/1

update_service(Service::string_param()) -> ecs_return(#ecs_service{})

update_service/2

update_service(Service::string_param(), Aws_config::update_service_opts() | aws_config) -> ecs_return(#ecs_service{})

update_service/3

update_service(Service::string_param(), Opts::update_service_opts(), Config::aws_config()) -> ecs_return(#ecs_service{})

ECS API http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_UpdateService.html

Example

Update 'sample-webapp' ECS Service in the 'TestCluster'

{ok, Result} = erlcloud_ecs:update_service("sample-webapp", [{cluster, "TestCluster"}, {desired_count, 1}, {task_definition, "console-sample-app-static:1"}, {deployment_configuration, [{minimum_healthy_percent, 20}]} ]),


Generated by EDoc