# ManagedPolicyProps

Properties for defining an IAM managed policy.

Extends: ManagedPolicyProps
Used as props by: ManagedPolicy

- Source: [`aws-iam/lib/managed-policy.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-iam/lib/managed-policy.ts#L41)
- Type last changed: v2.224.0 · 13 Nov 2025

## Example

```ts
const policyDocument = {
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "FirstStatement",
      "Effect": "Allow",
      "Action": ["iam:ChangePassword"],
      "Resource": ["*"],
    },
    {
      "Sid": "SecondStatement",
      "Effect": "Allow",
      "Action": ["s3:ListAllMyBuckets"],
      "Resource": ["*"],
    },
    {
      "Sid": "ThirdStatement",
      "Effect": "Allow",
      "Action": [
        "s3:List*",
        "s3:Get*",
      ],
      "Resource": [
        "arn:aws:s3:::confidential-data",
        "arn:aws:s3:::confidential-data/*",
      ],
      "Condition": {"Bool": {"aws:MultiFactorAuthPresent": "true"}},
    },
  ],
};

const customPolicyDocument = iam.PolicyDocument.fromJson(policyDocument);

// You can pass this document as an initial document to a ManagedPolicy
// or inline Policy.
const newManagedPolicy = new iam.ManagedPolicy(this, 'MyNewManagedPolicy', {
  document: customPolicyDocument,
});
const newPolicy = new iam.Policy(this, 'MyNewPolicy', {
  document: customPolicyDocument,
});
```

## Properties

- `description`: string = empty — A description of the managed policy.

  Typically used to store information about the
  permissions defined in the policy. For example, "Grants access to production DynamoDB tables."
  The policy description is immutable. After a value is assigned, it cannot be changed.

- `document`: [PolicyDocument](/cdk/api/v2/docs/aws-cdk-lib.aws_iam.PolicyDocument.html) — Initial PolicyDocument to use for this ManagedPolicy.

  **Default:** An empty policy.

  If omited, any
  `PolicyStatement` provided in the `statements` property will be applied
  against the empty default `PolicyDocument`.

- `groups`: [IGroupRef](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_iam.IGroupRef.html)[] — Groups to attach this policy to.

  **Default:** No groups.

  You can also use `attachToGroup(group)` to attach this policy to a group.

- `managedPolicyName`: string — The name of the managed policy.

  **Default:** A name is automatically generated.

  If you specify multiple policies for an entity,
  specify unique names. For example, if you specify a list of policies for
  an IAM role, each policy must have a unique name.

- `path`: string = "/" — The path for the policy.

  This parameter allows (through its regex pattern) a string of characters
  consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes.
  In addition, it can contain any ASCII character from the ! (\u0021) through the DEL character (\u007F),
  including most punctuation characters, digits, and upper and lowercased letters.

  For more information about paths, see IAM Identifiers in the IAM User Guide.

- `roles`: [IRole](/cdk/api/v2/docs/aws-cdk-lib.aws_iam.IRole.html)[] — Roles to attach this policy to.

  **Default:** No roles.

  You can also use `attachToRole(role)` to attach this policy to a role.

- `statements`: [PolicyStatement](/cdk/api/v2/docs/aws-cdk-lib.aws_iam.PolicyStatement.html)[] — Initial set of permissions to add to this policy document.

  **Default:** No statements.

  You can also use `addPermission(statement)` to add permissions later.

- `users`: [IUser](/cdk/api/v2/docs/aws-cdk-lib.aws_iam.IUser.html)[] — Users to attach this policy to.

  **Default:** No users.

  You can also use `attachToUser(user)` to attach this policy to a user.
