ListCoverageCommand

Lists coverage details for your GuardDuty account. If you're a GuardDuty administrator, you can retrieve all resources associated with the active member accounts in your organization.

Make sure the accounts have Runtime Monitoring enabled and GuardDuty agent running on their resources.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { GuardDutyClient, ListCoverageCommand } from "@aws-sdk/client-guardduty"; // ES Modules import
// const { GuardDutyClient, ListCoverageCommand } = require("@aws-sdk/client-guardduty"); // CommonJS import
const client = new GuardDutyClient(config);
const input = { // ListCoverageRequest
  DetectorId: "STRING_VALUE", // required
  NextToken: "STRING_VALUE",
  MaxResults: Number("int"),
  FilterCriteria: { // CoverageFilterCriteria
    FilterCriterion: [ // CoverageFilterCriterionList
      { // CoverageFilterCriterion
        CriterionKey: "ACCOUNT_ID" || "CLUSTER_NAME" || "RESOURCE_TYPE" || "COVERAGE_STATUS" || "ADDON_VERSION" || "MANAGEMENT_TYPE" || "EKS_CLUSTER_NAME" || "ECS_CLUSTER_NAME" || "AGENT_VERSION" || "INSTANCE_ID" || "CLUSTER_ARN",
        FilterCondition: { // CoverageFilterCondition
          Equals: [ // Equals
            "STRING_VALUE",
          ],
          NotEquals: [ // NotEquals
            "STRING_VALUE",
          ],
        },
      },
    ],
  },
  SortCriteria: { // CoverageSortCriteria
    AttributeName: "ACCOUNT_ID" || "CLUSTER_NAME" || "COVERAGE_STATUS" || "ISSUE" || "ADDON_VERSION" || "UPDATED_AT" || "EKS_CLUSTER_NAME" || "ECS_CLUSTER_NAME" || "INSTANCE_ID",
    OrderBy: "ASC" || "DESC",
  },
};
const command = new ListCoverageCommand(input);
const response = await client.send(command);
// { // ListCoverageResponse
//   Resources: [ // CoverageResources // required
//     { // CoverageResource
//       ResourceId: "STRING_VALUE",
//       DetectorId: "STRING_VALUE",
//       AccountId: "STRING_VALUE",
//       ResourceDetails: { // CoverageResourceDetails
//         EksClusterDetails: { // CoverageEksClusterDetails
//           ClusterName: "STRING_VALUE",
//           CoveredNodes: Number("long"),
//           CompatibleNodes: Number("long"),
//           AddonDetails: { // AddonDetails
//             AddonVersion: "STRING_VALUE",
//             AddonStatus: "STRING_VALUE",
//           },
//           ManagementType: "AUTO_MANAGED" || "MANUAL" || "DISABLED",
//         },
//         ResourceType: "EKS" || "ECS" || "EC2",
//         EcsClusterDetails: { // CoverageEcsClusterDetails
//           ClusterName: "STRING_VALUE",
//           FargateDetails: { // FargateDetails
//             Issues: [ // Issues
//               "STRING_VALUE",
//             ],
//             ManagementType: "AUTO_MANAGED" || "MANUAL" || "DISABLED",
//           },
//           ContainerInstanceDetails: { // ContainerInstanceDetails
//             CoveredContainerInstances: Number("long"),
//             CompatibleContainerInstances: Number("long"),
//           },
//         },
//         Ec2InstanceDetails: { // CoverageEc2InstanceDetails
//           InstanceId: "STRING_VALUE",
//           InstanceType: "STRING_VALUE",
//           ClusterArn: "STRING_VALUE",
//           AgentDetails: { // AgentDetails
//             Version: "STRING_VALUE",
//           },
//           ManagementType: "AUTO_MANAGED" || "MANUAL" || "DISABLED",
//         },
//       },
//       CoverageStatus: "HEALTHY" || "UNHEALTHY",
//       Issue: "STRING_VALUE",
//       UpdatedAt: new Date("TIMESTAMP"),
//     },
//   ],
//   NextToken: "STRING_VALUE",
// };

ListCoverageCommand Input

See ListCoverageCommandInput for more details

Parameter
Type
Description
DetectorId
Required
string | undefined

The unique ID of the detector whose coverage details you want to retrieve.

To find the detectorId in the current Region, see the Settings page in the GuardDuty console, or run the ListDetectors  API.

FilterCriteria
CoverageFilterCriteria | undefined

Represents the criteria used to filter the coverage details.

MaxResults
number | undefined

The maximum number of results to return in the response.

NextToken
string | undefined

A token to use for paginating results that are returned in the response. Set the value of this parameter to null for the first request to a list action. For subsequent calls, use the NextToken value returned from the previous request to continue listing results after the first page.

SortCriteria
CoverageSortCriteria | undefined

Represents the criteria used to sort the coverage details.

ListCoverageCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
Resources
Required
CoverageResource[] | undefined

A list of resources and their attributes providing cluster details.

NextToken
string | undefined

The pagination parameter to be used on the next list operation to retrieve more items.

Throws

Name
Fault
Details
BadRequestException
client

A bad request exception object.

InternalServerErrorException
server

An internal server error exception object.

GuardDutyServiceException
Base exception class for all service exceptions from GuardDuty service.