- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
DeleteLogGroupCommand
Deletes the specified log group and permanently deletes all the archived log events associated with the log group.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { CloudWatchLogsClient, DeleteLogGroupCommand } from "@aws-sdk/client-cloudwatch-logs"; // ES Modules import
// const { CloudWatchLogsClient, DeleteLogGroupCommand } = require("@aws-sdk/client-cloudwatch-logs"); // CommonJS import
const client = new CloudWatchLogsClient(config);
const input = { // DeleteLogGroupRequest
logGroupName: "STRING_VALUE", // required
};
const command = new DeleteLogGroupCommand(input);
const response = await client.send(command);
// {};
DeleteLogGroupCommand Input
See DeleteLogGroupCommandInput for more details
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
logGroupName Required | string | undefined | The name of the log group. |
DeleteLogGroupCommand Output
See DeleteLogGroupCommandOutput for details
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
InvalidParameterException | client | A parameter is specified incorrectly. |
OperationAbortedException | client | Multiple concurrent requests to update the same resource were in conflict. |
ResourceNotFoundException | client | The specified resource does not exist. |
ServiceUnavailableException | server | The service cannot complete the request. |
CloudWatchLogsServiceException | Base exception class for all service exceptions from CloudWatchLogs service. |