AWS cloud discovery of member account resources using dynamically acquired credentials fail with error 401 - AuthFailure

Release or Environment

All releases prior to New York.


When discovering member accounts, the AWS discovery credential and master service account are used to generate a temporary token. In order to generate this token, the master account needs to have "AssumeRole" permission.

When the AWS organizations console is used to create a member account, AWS Organizations automatically creates an IAM role in the account. This is the "OrganizationAccountAccessRole". This role contains the necessary "AssumeRole" permission. The "OrganizationAccountAccessRole" is the role used by the MID server in order to generate the token.

If the "OrganizationAccountAccessRole" role is not created and with "AssumeRole" permission, the discovery of the member account will fail with error 401 - AuthFailure.

Reproduce the error, see "Steps to Reproduce" in this KB, and review the MID server log files to confirm this is the root cause for the 401 error. On the MID server log files the following error should be present:

<time_stamp> (523) Worker-Interactive:APIProxyProbe-<ecc_queue_sys_id> SEVERE *** ERROR *** Exception caught while trying to acquireTemporaryCredentialFromAWS()&#13; Access denied (Service: AWSSecurityTokenService; Status Code: 403; Error Code: AccessDenied; Request ID: a2205d56-5189-11e9-a38b-9715ef911473)&#13;
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.handleErrorResponse(;
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeOneRequest(;
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeHelper(;
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.doExecute(;
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeWithTimer(;
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.execute(;
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.access$500(;
at com.amazonaws.http.AmazonHttpClient$RequestExecutionBuilderImpl.execute(;
at com.amazonaws.http.AmazonHttpClient.execute(;
at com.service_now.mid.util.CloudServiceAccountCredentialUtil.generateFreshTemporaryCredentialForAccount(;

On the above, we see the acquireTemporaryCredentialFromAWS fails. Next, we attempt the discovery without a valid credential and therefore get "Could not complete API call AWS was not able to validate the provided access credentials (Service: AmazonEC2; Status Code: 401" error.


Ensure the "OrganizationAccountAccessRole" is available and that has the "AssumeRole" permission.

Additional Information

The following AWS links provide helpful information on the "OrganizationAccountAccessRole" role and concepts, for a member account and invited accounts:

Article Information

Last Updated:2020-02-11 07:23:45