CmdID / aws / aws inspector2
aws inspector2 list-coverage
Lists coverage details for your environment. AWS CLI reference
2 examples 3 options Its page in the AWS CLI reference
Examples
Example 1: To list coverage details about your environment
The following list-coverage example lists your environment's coverage details.
aws inspector2 list-coverageIdentifyIts output
{
"coveredResources": [
{
"accountId": "123456789012",
"lastScannedAt": "2024-05-20T16:23:20-07:00",
"resourceId": "i-EXAMPLE55555555555",
"resourceMetadata": {
"ec2": {
"amiId": "ami-EXAMPLE6666666666",
"platform": "LINUX"
}
},
"resourceType": "AWS_EC2_INSTANCE",
"scanStatus": {
"reason": "SUCCESSFUL",
"statusCode": "ACTIVE"
},
"scanType": "PACKAGE"
}
]
}Example 2: To list coverage details about the Lambda function resource type
The following list-coverage example lists your Lambda function resource type details.
aws inspector2 list-coverage --filter-criteria '{"resourceType":[{"comparison":"EQUALS","value":"AWS_LAMBDA_FUNCTION"}]}'Identify--filter-criteriaAn object that contains details on the filters to apply to the coverage data for your environment.Its output
{
"coveredResources": [
{
"accountId": "123456789012",
"resourceId": "arn:aws:lambda:us-west-2:123456789012:function:Eval-container-scan-results:$LATEST",
"resourceMetadata": {
"lambdaFunction": {
"functionName": "Eval-container-scan-results",
"functionTags": {},
"layers": [],
"runtime": "PYTHON_3_7"
}
},
"resourceType": "AWS_LAMBDA_FUNCTION",
"scanStatus": {
"reason": "SUCCESSFUL",
"statusCode": "ACTIVE"
},
"scanType": "CODE"
}
]
}For more information, see Assessing Amazon Inspector coverage of your AWS environment in the Amazon Inspector User Guide.
Options
--filter-criteriaAn object that contains details on the filters to apply to the coverage data for your environment.--max-resultsThe maximum number of results the response can return.--next-tokenA token to use for paginating results that are returned in the response.