DescribeProtectionCommand

Lists the details of a Protection object.

Example Syntax

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

import { ShieldClient, DescribeProtectionCommand } from "@aws-sdk/client-shield"; // ES Modules import
// const { ShieldClient, DescribeProtectionCommand } = require("@aws-sdk/client-shield"); // CommonJS import
const client = new ShieldClient(config);
const input = { // DescribeProtectionRequest
  ProtectionId: "STRING_VALUE",
  ResourceArn: "STRING_VALUE",
};
const command = new DescribeProtectionCommand(input);
const response = await client.send(command);
// { // DescribeProtectionResponse
//   Protection: { // Protection
//     Id: "STRING_VALUE",
//     Name: "STRING_VALUE",
//     ResourceArn: "STRING_VALUE",
//     HealthCheckIds: [ // HealthCheckIds
//       "STRING_VALUE",
//     ],
//     ProtectionArn: "STRING_VALUE",
//     ApplicationLayerAutomaticResponseConfiguration: { // ApplicationLayerAutomaticResponseConfiguration
//       Status: "ENABLED" || "DISABLED", // required
//       Action: { // ResponseAction
//         Block: {},
//         Count: {},
//       },
//     },
//   },
// };

DescribeProtectionCommand Input

See DescribeProtectionCommandInput for more details

Parameter
Type
Description
ProtectionId
string | undefined

The unique identifier (ID) for the Protection object to describe. You must provide either the ResourceArn of the protected resource or the ProtectionID of the protection, but not both.

ResourceArn
string | undefined

The ARN (Amazon Resource Name) of the protected Amazon Web Services resource. You must provide either the ResourceArn of the protected resource or the ProtectionID of the protection, but not both.

DescribeProtectionCommand Output

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

The Protection that you requested.

Throws

Name
Fault
Details
InternalErrorException
server

Exception that indicates that a problem occurred with the service infrastructure. You can retry the request.

InvalidParameterException
client

Exception that indicates that the parameters passed to the API are invalid. If available, this exception includes details in additional properties.

ResourceNotFoundException
client

Exception indicating the specified resource does not exist. If available, this exception includes details in additional properties.

ShieldServiceException
Base exception class for all service exceptions from Shield service.