Inspector2 / Client / disable

disable#

Inspector2.Client.disable(**kwargs)#

Disables Amazon Inspector scans for one or more Amazon Web Services accounts. Disabling all scan types in an account disables the Amazon Inspector service.

See also: AWS API Documentation

Request Syntax

response = client.disable(
    accountIds=[
        'string',
    ],
    resourceTypes=[
        'EC2'|'ECR'|'LAMBDA'|'LAMBDA_CODE',
    ]
)
Parameters:
  • accountIds (list) –

    An array of account IDs you want to disable Amazon Inspector scans for.

    • (string) –

  • resourceTypes (list) –

    The resource scan types you want to disable.

    • (string) –

Return type:

dict

Returns:

Response Syntax

{
    'accounts': [
        {
            'accountId': 'string',
            'resourceStatus': {
                'ec2': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED',
                'ecr': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED',
                'lambda': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED',
                'lambdaCode': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED'
            },
            'status': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED'
        },
    ],
    'failedAccounts': [
        {
            'accountId': 'string',
            'errorCode': 'ALREADY_ENABLED'|'ENABLE_IN_PROGRESS'|'DISABLE_IN_PROGRESS'|'SUSPEND_IN_PROGRESS'|'RESOURCE_NOT_FOUND'|'ACCESS_DENIED'|'INTERNAL_ERROR'|'SSM_UNAVAILABLE'|'SSM_THROTTLED'|'EVENTBRIDGE_UNAVAILABLE'|'EVENTBRIDGE_THROTTLED'|'RESOURCE_SCAN_NOT_DISABLED'|'DISASSOCIATE_ALL_MEMBERS'|'ACCOUNT_IS_ISOLATED',
            'errorMessage': 'string',
            'resourceStatus': {
                'ec2': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED',
                'ecr': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED',
                'lambda': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED',
                'lambdaCode': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED'
            },
            'status': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED'
        },
    ]
}

Response Structure

  • (dict) –

    • accounts (list) –

      Information on the accounts that have had Amazon Inspector scans successfully disabled. Details are provided for each account.

      • (dict) –

        An Amazon Web Services account within your environment that Amazon Inspector has been enabled for.

        • accountId (string) –

          The ID of the Amazon Web Services account.

        • resourceStatus (dict) –

          Details of the status of Amazon Inspector scans by resource type.

          • ec2 (string) –

            The status of Amazon Inspector scanning for Amazon EC2 resources.

          • ecr (string) –

            The status of Amazon Inspector scanning for Amazon ECR resources.

          • lambda (string) –

            The status of Amazon Inspector scanning for AWS Lambda function.

          • lambdaCode (string) –

            The status of Amazon Inspector scanning for custom application code for Amazon Web Services Lambda functions.

        • status (string) –

          The status of Amazon Inspector for the account.

    • failedAccounts (list) –

      Information on any accounts for which Amazon Inspector scans could not be disabled. Details are provided for each account.

      • (dict) –

        An object with details on why an account failed to enable Amazon Inspector.

        • accountId (string) –

          The Amazon Web Services account ID.

        • errorCode (string) –

          The error code explaining why the account failed to enable Amazon Inspector.

        • errorMessage (string) –

          The error message received when the account failed to enable Amazon Inspector.

        • resourceStatus (dict) –

          An object detailing which resources Amazon Inspector is enabled to scan for the account.

          • ec2 (string) –

            The status of Amazon Inspector scanning for Amazon EC2 resources.

          • ecr (string) –

            The status of Amazon Inspector scanning for Amazon ECR resources.

          • lambda (string) –

            The status of Amazon Inspector scanning for AWS Lambda function.

          • lambdaCode (string) –

            The status of Amazon Inspector scanning for custom application code for Amazon Web Services Lambda functions.

        • status (string) –

          The status of Amazon Inspector for the account.

Exceptions

  • Inspector2.Client.exceptions.ValidationException

  • Inspector2.Client.exceptions.AccessDeniedException

  • Inspector2.Client.exceptions.ResourceNotFoundException

  • Inspector2.Client.exceptions.ThrottlingException

  • Inspector2.Client.exceptions.InternalServerException