UntagResource
Deletes specified tags from a resource.
Request Syntax
{
"resourceArn": "string
",
"tagKeys": [ "string
" ]
}
Request Parameters
For information about the parameters that are common to all actions, see Common Parameters.
The request accepts the following data in JSON format.
- resourceArn
-
The Amazon Resource Name (ARN) of the resource to delete tags from. Currently, the supported resources are Amazon ECS capacity providers, tasks, services, task definitions, clusters, and container instances.
Type: String
Required: Yes
- tagKeys
-
The keys of the tags to be removed.
Type: Array of strings
Length Constraints: Minimum length of 1. Maximum length of 128.
Pattern:
^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$
Required: Yes
Response Elements
If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body.
Errors
For information about the errors that are common to all actions, see Common Errors.
- ClientException
-
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.
The following list includes additional causes for the error:
-
The
RunTask
could not be processed because you use managed scaling and there is a capacity error because the quota of tasks in thePROVISIONING
per cluster has been reached. For information about the service quotas, see Amazon ECS service quotas.
HTTP Status Code: 400
-
- ClusterNotFoundException
-
The specified cluster wasn't found. You can view your available clusters with ListClusters. Amazon ECS clusters are Region specific.
HTTP Status Code: 400
- InvalidParameterException
-
The specified parameter isn't valid. Review the available parameters for the API request.
HTTP Status Code: 400
- ResourceNotFoundException
-
The specified resource wasn't found.
HTTP Status Code: 400
- ServerException
-
These errors are usually caused by a server issue.
HTTP Status Code: 500
Examples
In the following example or examples, the Authorization header contents
(AUTHPARAMS
) must be replaced with an Amazon Signature Version 4
signature. For more information, see Signature
Version 4 Signing Process in the
Amazon General
Reference.
You only need to learn how to sign HTTP requests if you intend to
create them manually. When you use the Amazon Command Line Interface
Example
This example tags the dev
cluster with key team
and value
dev
.
Sample Request
POST / HTTP/1.1
Host: ecs.us-west-2.amazonaws.com
Accept-Encoding: identity
X-Amz-Target: AmazonEC2ContainerServiceV20141113.UntagResource
Content-Type: application/x-amz-json-1.1
X-Amz-Date: 20181026T200134Z
Authorization: AUTHPARAMS
Content-Length: 93
{
"resourceArn":"arn:aws:ecs:us-west-2:012345678910:cluster/devcluster",
"tagKeys":[
"team"
]
}
Sample Response
HTTP/1.1 200 OK
x-amzn-RequestId: 123a4b56-7c89-01d2-3ef4-example5678f
Content-Type: application/x-amz-json-1.1
Content-Length: 2
Date: Fri, 26 Oct 2018 20:01:34 GMT
{}
See Also
For more information about using this API in one of the language-specific Amazon SDKs, see the following: