PutResourcePolicyCommand

Adds a resource policy to the specified response plan. The resource policy is used to share the response plan using Resource Access Manager (RAM). For more information about cross-account sharing, see Cross-Region and cross-account incident management .

Example Syntax

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

import { SSMIncidentsClient, PutResourcePolicyCommand } from "@aws-sdk/client-ssm-incidents"; // ES Modules import
// const { SSMIncidentsClient, PutResourcePolicyCommand } = require("@aws-sdk/client-ssm-incidents"); // CommonJS import
const client = new SSMIncidentsClient(config);
const input = { // PutResourcePolicyInput
  resourceArn: "STRING_VALUE", // required
  policy: "STRING_VALUE", // required
};
const command = new PutResourcePolicyCommand(input);
const response = await client.send(command);
// { // PutResourcePolicyOutput
//   policyId: "STRING_VALUE", // required
// };

PutResourcePolicyCommand Input

See PutResourcePolicyCommandInput for more details

Parameter
Type
Description
policy
Required
string | undefined

Details of the resource policy.

resourceArn
Required
string | undefined

The Amazon Resource Name (ARN) of the response plan to add the resource policy to.

PutResourcePolicyCommand Output

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

The ID of the resource policy.

Throws

Name
Fault
Details
AccessDeniedException
client

You don't have sufficient access to perform this operation.

InternalServerException
server

The request processing has failed because of an unknown error, exception or failure.

ResourceNotFoundException
client

Request references a resource which doesn't exist.

ThrottlingException
client

The request was denied due to request throttling.

ValidationException
client

The input fails to satisfy the constraints specified by an Amazon Web Services service.

SSMIncidentsServiceException
Base exception class for all service exceptions from SSMIncidents service.