GetDataProtectionPolicyCommand

Returns information about a log group data protection policy.

Example Syntax

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

import { CloudWatchLogsClient, GetDataProtectionPolicyCommand } from "@aws-sdk/client-cloudwatch-logs"; // ES Modules import
// const { CloudWatchLogsClient, GetDataProtectionPolicyCommand } = require("@aws-sdk/client-cloudwatch-logs"); // CommonJS import
const client = new CloudWatchLogsClient(config);
const input = { // GetDataProtectionPolicyRequest
  logGroupIdentifier: "STRING_VALUE", // required
};
const command = new GetDataProtectionPolicyCommand(input);
const response = await client.send(command);
// { // GetDataProtectionPolicyResponse
//   logGroupIdentifier: "STRING_VALUE",
//   policyDocument: "STRING_VALUE",
//   lastUpdatedTime: Number("long"),
// };

GetDataProtectionPolicyCommand Input

Parameter
Type
Description
logGroupIdentifier
Required
string | undefined

The name or ARN of the log group that contains the data protection policy that you want to see.

GetDataProtectionPolicyCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
lastUpdatedTime
number | undefined

The date and time that this policy was most recently updated.

logGroupIdentifier
string | undefined

The log group name or ARN that you specified in your request.

policyDocument
string | undefined

The data protection policy document for this log group.

Throws

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.