GetResourcePolicyCommand

Gets the resource-based permission policy that is set for the given environment.

Example Syntax

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

import { MigrationHubRefactorSpacesClient, GetResourcePolicyCommand } from "@aws-sdk/client-migration-hub-refactor-spaces"; // ES Modules import
// const { MigrationHubRefactorSpacesClient, GetResourcePolicyCommand } = require("@aws-sdk/client-migration-hub-refactor-spaces"); // CommonJS import
const client = new MigrationHubRefactorSpacesClient(config);
const input = { // GetResourcePolicyRequest
  Identifier: "STRING_VALUE", // required
};
const command = new GetResourcePolicyCommand(input);
const response = await client.send(command);
// { // GetResourcePolicyResponse
//   Policy: "STRING_VALUE",
// };

GetResourcePolicyCommand Input

See GetResourcePolicyCommandInput for more details

Parameter
Type
Description
Identifier
Required
string | undefined

The Amazon Resource Name (ARN) of the resource associated with the policy.

GetResourcePolicyCommand Output

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

A JSON-formatted string for an Amazon Web Services resource-based policy.

Throws

Name
Fault
Details
AccessDeniedException
client

The user does not have sufficient access to perform this action.

InternalServerException
server

An unexpected error occurred while processing the request.

ResourceNotFoundException
client

The request references a resource that does not exist.

ThrottlingException
client

Request was denied because the request was throttled.

ValidationException
client

The input does not satisfy the constraints specified by an Amazon Web Service.

MigrationHubRefactorSpacesServiceException
Base exception class for all service exceptions from MigrationHubRefactorSpaces service.