Jump to Content

New API Documentation - Developer Preview Available

We are excited to announce the developer preview of our new API documentation for AWS SDK for JavaScript v3. Please follow instructions on the landing page to leave us your feedback.

Class PutPermissionCommandProtected

Adds permissions to a profiling group's resource-based policy that are provided using an action group. If a profiling group doesn't have a resource-based policy, one is created for it using the permissions in the action group and the roles and users in the principals parameter.

    <p> The one supported action group that can be added is <code>agentPermission</code>
which grants <code>ConfigureAgent</code> and <code>PostAgent</code> permissions. For
more information, see <a href="https://docs.aws.amazon.com/codeguru/latest/profiler-ug/resource-based-policies.html">Resource-based
policies in CodeGuru Profiler</a> in the <i>Amazon CodeGuru Profiler User
Guide</i>, <a href="https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_ConfigureAgent.html">
<code>ConfigureAgent</code>
</a>, and <a href="https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_PostAgentProfile.html">
<code>PostAgentProfile</code>
</a>. </p>

<p>
The first time you call <code>PutPermission</code> on a profiling group, do not specify a <code>revisionId</code> because
it doesn't have a resource-based policy. Subsequent calls must provide a <code>revisionId</code> to specify
which revision of the resource-based policy to add the permissions to.
</p>

<p>
The response contains the profiling group's JSON-formatted resource policy.
</p>

Example

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

import { CodeGuruProfilerClient, PutPermissionCommand } from "@aws-sdk/client-codeguruprofiler"; // ES Modules import
// const { CodeGuruProfilerClient, PutPermissionCommand } = require("@aws-sdk/client-codeguruprofiler"); // CommonJS import
const client = new CodeGuruProfilerClient(config);
const input = { // PutPermissionRequest
profilingGroupName: "STRING_VALUE", // required
actionGroup: "STRING_VALUE", // required
principals: [ // Principals // required
"STRING_VALUE",
],
revisionId: "STRING_VALUE",
};
const command = new PutPermissionCommand(input);
const response = await client.send(command);
// { // PutPermissionResponse
// policy: "STRING_VALUE", // required
// revisionId: "STRING_VALUE", // required
// };

Param

PutPermissionCommandInput

Returns

PutPermissionCommandOutput

See

Throws

ConflictException (client fault)

The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request.

Throws

InternalServerException (server fault)

The server encountered an internal error and is unable to complete the request.

Throws

ResourceNotFoundException (client fault)

The resource specified in the request does not exist.

Throws

ThrottlingException (client fault)

The request was denied due to request throttling.

Throws

ValidationException (client fault)

The parameter is not valid.

Throws

CodeGuruProfilerServiceException

Base exception class for all service exceptions from CodeGuruProfiler service.

Hierarchy

Constructors

Properties

middlewareStack: MiddlewareStack<PutPermissionCommandInput, PutPermissionCommandOutput>

Methods