Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PutUserPolicyCommand

Adds or updates an inline policy document that is embedded in the specified IAM user.

An IAM user can also have a managed policy attached to it. To attach a managed policy to a user, use AttachUserPolicy. To create a new managed policy, use CreatePolicy. For information about policies, see Managed policies and inline policies in the IAM User Guide.

For information about the maximum number of inline policies that you can embed in a user, see IAM and STS quotas in the IAM User Guide.

Because policy documents can be large, you should use POST rather than GET when calling PutUserPolicy. For general information about using the Query API with IAM, see Making query requests in the IAM User Guide.

example

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

import { IAMClient, PutUserPolicyCommand } from "@aws-sdk/client-iam"; // ES Modules import
// const { IAMClient, PutUserPolicyCommand } = require("@aws-sdk/client-iam"); // CommonJS import
const client = new IAMClient(config);
const command = new PutUserPolicyCommand(input);
const response = await client.send(command);
see

PutUserPolicyCommandInput for command's input shape.

see

PutUserPolicyCommandOutput for command's response shape.

see

config for IAMClient's config shape.

Hierarchy

Implements

Index

Constructors

constructor

Properties

Readonly input

input: PutUserPolicyCommandInput

Readonly middlewareStack

middlewareStack: IMiddlewareStack<PutUserPolicyCommandInput, PutUserPolicyCommandOutput>

Methods

Static getEndpointParameterInstructions