- Documentation
Elastic Compute Service
Elastic Compute Service
API Reference
Instances
DisassociateInstancesIamRole - Disassociates IAM role from instances
Instances
DisassociateInstancesIamRole - Disassociates IAM role from instances
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
Sample response
Error codes
The table below lists the business-related error codes of the operation. For more information, refer to Common error codes.
Last updated: 2026.06.18 17:48:24