Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CreatePolicyCommand

Creates a new managed policy for your Amazon Web Services account.

This operation creates a policy version with a version identifier of v1 and sets v1 as the policy's default version. For more information about policy versions, see Versioning for managed policies in the IAM User Guide.

As a best practice, you can validate your IAM policies. To learn more, see Validating IAM policies in the IAM User Guide.

For more information about managed policies in general, see Managed policies and inline policies in the IAM User Guide.

example

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

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

CreatePolicyCommandInput for command's input shape.

see

CreatePolicyCommandOutput for command's response shape.

see

config for IAMClient's config shape.

Hierarchy

Implements

Index

Constructors

constructor

Properties

Readonly input

input: CreatePolicyCommandInput

Readonly middlewareStack

middlewareStack: IMiddlewareStack<CreatePolicyCommandInput, CreatePolicyCommandOutput>

Methods

Static getEndpointParameterInstructions