# PrincipalPolicyFragment

A collection of the fields in a PolicyStatement that can be used to identify a principal.

This consists of the JSON used in the "Principal" field, and optionally a
set of "Condition"s that need to be applied to the policy.

Generally, a principal looks like:

    { '<TYPE>': ['ID', 'ID', ...] }

And this is also the type of the field `principalJson`.  However, there is a
special type of principal that is just the string '*', which is treated
differently by some services. To represent that principal, `principalJson`
should contain `{ 'LiteralString': ['*'] }`.

- Source: [`aws-iam/lib/principals.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-iam/lib/principals.ts#L418)

## Example

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_iam as iam } from 'aws-cdk-lib';

declare const conditions: any;
const principalPolicyFragment = new iam.PrincipalPolicyFragment({
  principalJsonKey: ['principalJson'],
}, /* all optional props */ {
  conditionsKey: conditions,
});
```

## Initializer

```ts
new PrincipalPolicyFragment(principalJson: { [key: string]: string[] }, conditions?: { [key: string]: any })
```

## Properties

- `conditions`: { [key: string]: any } — The conditions under which the policy is in effect.

  See [the IAM documentation](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition.html).
  conditions that need to be applied to this policy

- `principalJson`: { [key: string]: string[] } — JSON of the "Principal" section in a policy statement.
