register_cross_account_access_role

register_cross_account_access_role(**kwargs)

Registers the IAM role that grants Amazon Inspector access to AWS Services needed to perform security assessments.

See also: AWS API Documentation

Request Syntax

response = client.register_cross_account_access_role(
    roleArn='string'
)
Parameters
roleArn (string) --

[REQUIRED]

The ARN of the IAM role that grants Amazon Inspector access to AWS Services needed to perform security assessments.

Returns
None

Exceptions

  • Inspector.Client.exceptions.InternalException
  • Inspector.Client.exceptions.InvalidInputException
  • Inspector.Client.exceptions.AccessDeniedException
  • Inspector.Client.exceptions.InvalidCrossAccountRoleException
  • Inspector.Client.exceptions.ServiceTemporarilyUnavailableException

Examples

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.

response = client.register_cross_account_access_role(
    roleArn='arn:aws:iam::123456789012:role/inspector',
)

print(response)

Expected Output:

{
    'ResponseMetadata': {
        '...': '...',
    },
}