Smaws_Client_ECS.RunTaskStarts a new task using the specified task definition.
On March 21, 2024, a change was made to resolve the task definition revision before authorization. When a task definition revision is not specified, authorization will occur using the latest revision of a task definition.
Amazon Elastic Inference (EI) is no longer available to customers.
You can allow Amazon ECS to place tasks for you, or you can customize how Amazon ECS places tasks using placement constraints and placement strategies. For more information, see Scheduling Tasks in the Amazon Elastic Container Service Developer Guide.
Alternatively, you can use StartTask to use your own scheduler or place tasks manually on specific container instances.
You can attach Amazon EBS volumes to Amazon ECS tasks by configuring the volume when creating or updating a service. For more information, see Amazon EBS volumes in the Amazon Elastic Container Service Developer Guide.
The Amazon ECS API follows an eventual consistency model. This is because of the distributed nature of the system supporting the API. This means that the result of an API command you run that affects your Amazon ECS resources might not be immediately visible to all subsequent commands you run. Keep this in mind when you carry out an API command that immediately follows a previous API command.
To manage eventual consistency, you can do the following:
If you get a ConflictException error, the RunTask request could not be processed due to conflicts. The provided clientToken is already in use with a different RunTask request. The resourceIds are the existing task ARNs which are already associated with the clientToken.
To fix this issue:
RunTask with a unique clientToken.RunTask with the clientToken and the original set of parametersIf you get a ClientExceptionerror, the RunTask could not be processed because you use managed scaling and there is a capacity error because the quota of tasks in the PROVISIONING per cluster has been reached. For information about the service quotas, see Amazon ECS service quotas.
val error_to_string :
[ Smaws_Lib.Protocols.AwsJson.error
| `AccessDeniedException of Types.access_denied_exception
| `BlockedException of Types.blocked_exception
| `ClientException of Types.client_exception
| `ClusterNotFoundException of Types.cluster_not_found_exception
| `ConflictException of Types.conflict_exception
| `InvalidParameterException of Types.invalid_parameter_exception
| `PlatformTaskDefinitionIncompatibilityException of
Types.platform_task_definition_incompatibility_exception
| `PlatformUnknownException of Types.platform_unknown_exception
| `ServerException of Types.server_exception
| `UnsupportedFeatureException of Types.unsupported_feature_exception ] ->
stringval request :
'http_type Smaws_Lib.Context.t ->
Types.run_task_request ->
(Types.run_task_response,
[> Smaws_Lib.Protocols.AwsJson.error
| `AccessDeniedException of Types.access_denied_exception
| `BlockedException of Types.blocked_exception
| `ClientException of Types.client_exception
| `ClusterNotFoundException of Types.cluster_not_found_exception
| `ConflictException of Types.conflict_exception
| `InvalidParameterException of Types.invalid_parameter_exception
| `PlatformTaskDefinitionIncompatibilityException of
Types.platform_task_definition_incompatibility_exception
| `PlatformUnknownException of Types.platform_unknown_exception
| `ServerException of Types.server_exception
| `UnsupportedFeatureException of Types.unsupported_feature_exception ])
Stdlib.resultval request_with_metadata :
'http_type Smaws_Lib.Context.t ->
Types.run_task_request ->
(Types.run_task_response Smaws_Lib.Response.t,
[> Smaws_Lib.Protocols.AwsJson.error
| `AccessDeniedException of Types.access_denied_exception
| `BlockedException of Types.blocked_exception
| `ClientException of Types.client_exception
| `ClusterNotFoundException of Types.cluster_not_found_exception
| `ConflictException of Types.conflict_exception
| `InvalidParameterException of Types.invalid_parameter_exception
| `PlatformTaskDefinitionIncompatibilityException of
Types.platform_task_definition_incompatibility_exception
| `PlatformUnknownException of Types.platform_unknown_exception
| `ServerException of Types.server_exception
| `UnsupportedFeatureException of Types.unsupported_feature_exception ]
* Smaws_Lib.Response.metadata)
Stdlib.result