deregisterTaskDefinition method

Future<DeregisterTaskDefinitionResponse> deregisterTaskDefinition({
  1. required String taskDefinition,
})

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. If you want to delete a task definition revision, you must first deregister the task definition revision.

You can't use an INACTIVE task definition to run new tasks or create new services, and you can't update an existing service to reference an INACTIVE task definition. However, there may be up to a 10-minute window following deregistration where these restrictions have not yet taken effect. You must deregister a task definition revision before you delete it. For more information, see DeleteTaskDefinitions.

May throw AccessDeniedException. May throw ClientException. May throw InvalidParameterException. May throw ServerException.

Parameter taskDefinition : The family and revision (family:revision) or full Amazon Resource Name (ARN) of the task definition to deregister. You must specify a revision.

Implementation

Future<DeregisterTaskDefinitionResponse> deregisterTaskDefinition({
  required String taskDefinition,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target':
        'AmazonEC2ContainerServiceV20141113.DeregisterTaskDefinition'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'taskDefinition': taskDefinition,
    },
  );

  return DeregisterTaskDefinitionResponse.fromJson(jsonResponse.body);
}