# PolicyProperty

Struct · External

Contains information about an attached policy.

An attached policy is a managed policy that has been attached to a user, group, or role.

For more information about managed policies, refer to [Managed Policies and Inline Policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) in the *IAM User Guide* .

- Source: Generated at build time
- Type last changed: v2.93.0 · 23 Aug 2023

## Example

TypeScript:

```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 policyDocument: any;
const policyProperty: iam.CfnUser.PolicyProperty = {
  policyDocument: policyDocument,
  policyName: 'policyName',
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_iam as iam

# policy_document: Any

policy_property = iam.CfnUser.PolicyProperty(
    policy_document=policy_document,
    policy_name="policyName"
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.iam.*;

Object policyDocument;

PolicyProperty policyProperty = PolicyProperty.builder()
        .policyDocument(policyDocument)
        .policyName("policyName")
        .build();
```

C#:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.IAM;

var policyDocument;

var policyProperty = new PolicyProperty {
    PolicyDocument = policyDocument,
    PolicyName = "policyName"
};
```

Go:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var policyDocument interface{}

policyProperty := &PolicyProperty{
	PolicyDocument: policyDocument,
	PolicyName: jsii.String("policyName"),
}
```

## Properties

- `policyDocument`: any (required) — The entire contents of the policy that defines permissions.

  For more information, see [Overview of JSON policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#access_policies-json) .

- `policyName`: string (required) — The friendly name (not ARN) identifying the policy.
