Menu
Amazon Inspector
API Reference (API Version 2016-02-16)

RegisterCrossAccountAccessRole

Registers the IAM role that Amazon Inspector uses to list your EC2 instances at the start of the assessment run or when you call the PreviewAgents action.

Request Syntax

{
   "roleArn": "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.

roleArn

The ARN of the IAM role that Amazon Inspector uses to list your EC2 instances during the assessment run or when you call the PreviewAgents action.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 300.

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.

AccessDeniedException

You do not have required permissions to access the requested resource.

HTTP Status Code: 400

InternalException

Internal server error.

HTTP Status Code: 500

InvalidCrossAccountRoleException

Amazon Inspector cannot assume the cross-account role that it needs to list your EC2 instances during the assessment run.

HTTP Status Code: 400

InvalidInputException

The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

HTTP Status Code: 400

Example

Sample Request


               
                  POST / HTTP/1.1
                  Host: inspector.us-west-2.amazonaws.com
                  Accept-Encoding: identity
                  Content-Length: 55
                  X-Amz-Target: InspectorService.RegisterCrossAccountAccessRole
                  X-Amz-Date: 20160329T225544Z
                  User-Agent: aws-cli/1.10.12 Python/2.7.9 Windows/7 botocore/1.4.3
                  Content-Type: application/x-amz-json-1.1
                  Authorization: AUTHPARAMS
                  
                  {
                    "roleArn": "arn:aws:iam::123456789012:role/inspector"
                  }
               
            

Sample Response


               
                  HTTP/1.1 200 OK
                  x-amzn-RequestId: 5f553cfa-f601-11e5-a47c-b7e2de2d572c
                  Content-Type: application/x-amz-json-1.1
                  Content-Length: 0
                  Date: Tue, 29 Mar 2016 22:55:46 GMT
               
            

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: