StopMonitoringMembersCommand

Stops GuardDuty monitoring for the specified member accounts. Use the StartMonitoringMembers operation to restart monitoring for those accounts.

With autoEnableOrganizationMembers configuration for your organization set to ALL, you'll receive an error if you attempt to stop monitoring the member accounts in your organization.

Example Syntax

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

import { GuardDutyClient, StopMonitoringMembersCommand } from "@aws-sdk/client-guardduty"; // ES Modules import
// const { GuardDutyClient, StopMonitoringMembersCommand } = require("@aws-sdk/client-guardduty"); // CommonJS import
const client = new GuardDutyClient(config);
const input = { // StopMonitoringMembersRequest
  DetectorId: "STRING_VALUE", // required
  AccountIds: [ // AccountIds // required
    "STRING_VALUE",
  ],
};
const command = new StopMonitoringMembersCommand(input);
const response = await client.send(command);
// { // StopMonitoringMembersResponse
//   UnprocessedAccounts: [ // UnprocessedAccounts // required
//     { // UnprocessedAccount
//       AccountId: "STRING_VALUE", // required
//       Result: "STRING_VALUE", // required
//     },
//   ],
// };

StopMonitoringMembersCommand Input

Parameter
Type
Description
AccountIds
Required
string[] | undefined

A list of account IDs for the member accounts to stop monitoring.

DetectorId
Required
string | undefined

The unique ID of the detector associated with the GuardDuty administrator account that is monitoring member accounts.

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

StopMonitoringMembersCommand Output

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

A list of objects that contain an accountId for each account that could not be processed, and a result string that indicates why the account was not processed.

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.