You need to enable JavaScript to run this app.
Elastic Compute Service

Elastic Compute Service

Copy page
Download PDF
Instances
DisassociateInstancesIamRole - Disassociates IAM role from instances
Copy page
Download PDF
DisassociateInstancesIamRole - Disassociates IAM role from instances
Call the DisassociateInstancesIamRole operation to disassociate IAM roles from one or more instances. Users or services can only disassociate IAM roles that are associated with themselves.​
Debugging​
API Explorer
You can initiate calls online through API Explorer without paying attention to the signature generation process and quickly obtain the call results.
​
Request parameters​
The table below lists only the request parameters specific to this operation and some common parameters. For more information, refer to Common parameters.​
Action string required Sample value: DisassociateInstancesIamRole​
The operation that you want to perform. Valid value: DisassociateInstancesIamRole.​
​
Version string required Sample value: 2020-04-01​
The version of the API. Valid value: 2020-04-01.​
​
ClientToken string Optional Sample value: 333456899ff****​
The ClientToken is used to ensure the request idempotency. You can use the client to automatically generate a token, but you must make sure that the token is unique among different requests. This prevents repeated actions due to multiple client retries when the call of the API action times out or an internal server error occurs.​
Value: Only ASCII characters are supported. The length is no more than 64 ASCII characters.​
​
IamRoleName string Optional Sample value: EcsTestRole​
The name of the IAM role that you want to disassociate from the instance.​
You can use ListRoles to query the IAM roles of instances you have created.​
​
InstanceIds.N string[] required Sample value: InstanceIds.1=i-3ti9101aju3vj0******&InstanceIds.2=i-3tiegs1y963vj0******​
The instance ID. A maximum of 100 instance IDs are supported.​
  • Parameter - N: specifies the serial number of the instance.​
  • Multiple instance IDs are separated by &.​
​
​
​
Response parameters​
The table below lists only the response parameters specific to this operation. For more information, refer to Response structure.​
tip​
The following error code for the operation is displayed only when an invalid value is specified for a request parameter. If valid values are specified for the request parameters, no error code is displayed, and a status code of 200 is returned. However, this does not mean that the operation on all instances is successful. To view the operation result on a single instance, see the information in the following response parameters.​
OperationDetails object[] Sample value: --​
The operation details.​
Error object Sample value: --​
The error message for the instance being operated on.​
Code string Sample value: InvalidInstance.NotFound​
The error code for the failure of a specific individual request during batch operations. Valid values:​
  • InvalidInstance.NotFound: The specified instance does not exist.​
  • FlowLimitExceeded: You have exceeded the rate limit for resource requests.​
  • OperationDenied.IamRoleAuth: The specified operation is rejected because the role is not associated with the instance by you.​
tip​
Each Code corresponds to a Message in sequence.​
​
Message string Sample value: The specified instance does not exist.​
The error information for the failure of a specific request during batch operations. Valid values:​
  • The specified instance does not exist.​
  • You've reached the limit on request rate of resources.​
  • The specified operation is denied as the IamRole was not associated with the instance by you.​
tip​
Each Code corresponds to a Message in sequence.​
​
​
InstanceId string Sample value: i-bp67acfmxazb4p****​
The ID of the instance on which the operation is performed.​
​
​
​
​
Sample request​
​
GET /?Action=DisassociateInstancesIamRole&Version=2020-04-01&InstanceIds.1=i-3tiefmkskq3vj0******&IamRoleName=EcsTestRole HTTP/1.1​
Host: ecs.cn-beijing.volcengineapi.com​
Region: cn-beijing​
Service: ecs​
​
Sample response​
​
{​
"ResponseMetadata": {​
"RequestId": "2021110417394001022514606307******",​
"Action": "DisassociateInstancesIamRole",​
"Version": "2020-04-01",​
"Service": "ecs",​
"Region": "cn-beijing"​
},​
"Result": {​
"OperationDetails": [​
{​
"InstanceId": "i-ahipakt2gcg95jpv****",​
"Error": null​
},​
{​
"InstanceId": "i-ahipakt2hgg95k5c****",​
"Error": {​
"Code": "InvalidInstance.NotFound",​
"Message": "The specified instance does not exist."​
}​
}​
]​
}​
}​
​
Error codes​
The table below lists the business-related error codes of the operation. For more information, refer to Common error codes.​
​
Status code​
Error code​
Error message​
Description​
400​
IdempotentParameterMismatch​
The request uses the same client token as a previous, but non-identical request. Do not reuse a client token with different requests, unless the requests are identical.​
The idempotent parameters are inconsistent.​
400​
InvalidArgument​
The specified argument is invalid.​
The specified parameter is invalid.​
400​
InvalidClientToken.Malformed​
The specified ClientToken is malformed.​
The specified ClientToken is invalid.​
400​
InvalidCount.Malformed​
The specified count is malformed.​
The specified parameter Count is invalid.​
412​
IdempotentProcessing​
The request uses the same client token as a previous one that is still in process.​
The previous idempotent request is still in process. Please try again later.​
500​
InternalError​
An internal error has occurred.​
An internal error occurred. Try again. If multiple attempts fail, submit a ticket.​
​
​
Last updated: 2026.06.18 17:48:24