PutResourcePolicyCommand

Creates or updates a resource policy.

Example Syntax

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

import { NetworkManagerClient, PutResourcePolicyCommand } from "@aws-sdk/client-networkmanager"; // ES Modules import
// const { NetworkManagerClient, PutResourcePolicyCommand } = require("@aws-sdk/client-networkmanager"); // CommonJS import
const client = new NetworkManagerClient(config);
const input = { // PutResourcePolicyRequest
  PolicyDocument: "STRING_VALUE", // required
  ResourceArn: "STRING_VALUE", // required
};
const command = new PutResourcePolicyCommand(input);
const response = await client.send(command);
// {};

PutResourcePolicyCommand Input

See PutResourcePolicyCommandInput for more details

Parameter
Type
Description
PolicyDocument
Required
AutomaticJsonStringConversion | string | undefined

The JSON resource policy document.

ResourceArn
Required
string | undefined

The ARN of the resource policy.

PutResourcePolicyCommand Output

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

Throws

Name
Fault
Details
AccessDeniedException
client

You do not have sufficient access to perform this action.

ConflictException
client

There was a conflict processing the request. Updating or deleting the resource can cause an inconsistent state.

InternalServerException
server

The request has failed due to an internal error.

ServiceQuotaExceededException
client

A service limit was exceeded.

ThrottlingException
client

The request was denied due to request throttling.

ValidationException
client

The input fails to satisfy the constraints.

NetworkManagerServiceException
Base exception class for all service exceptions from NetworkManager service.