# CfnPolicyProps

Struct · External

Properties for defining a `CfnPolicy`.

Used as props by: [CfnPolicy](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_iot.CfnPolicy.html)

- Source: Generated at build time
- Type last changed: v2.103.0 · 26 Oct 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_iot as iot } from 'aws-cdk-lib';

declare const policyDocument: any;
const cfnPolicyProps: iot.CfnPolicyProps = {
  policyDocument: policyDocument,

  // the properties below are optional
  policyName: 'policyName',
  tags: [{
    key: 'key',
    value: 'value',
  }],
};
```

Python:

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

# policy_document: Any

cfn_policy_props = iot.CfnPolicyProps(
    policy_document=policy_document,

    # the properties below are optional
    policy_name="policyName",
    tags=[CfnTag(
        key="key",
        value="value"
    )]
)
```

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.iot.*;

Object policyDocument;

CfnPolicyProps cfnPolicyProps = CfnPolicyProps.builder()
        .policyDocument(policyDocument)

        // the properties below are optional
        .policyName("policyName")
        .tags(List.of(CfnTag.builder()
                .key("key")
                .value("value")
                .build()))
        .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.IoT;

var policyDocument;

var cfnPolicyProps = new CfnPolicyProps {
    PolicyDocument = policyDocument,

    // the properties below are optional
    PolicyName = "policyName",
    Tags = new [] { new CfnTag {
        Key = "key",
        Value = "value"
    } }
};
```

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{}

cfnPolicyProps := &CfnPolicyProps{
	PolicyDocument: policyDocument,

	// the properties below are optional
	PolicyName: jsii.String("policyName"),
	Tags: []CfnTag{
		&CfnTag{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
}
```

## Properties

- `policyDocument`: any (required) — The JSON document that describes the policy.

- `policyName`: string — The policy name.

- `tags`: [CfnTag](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.CfnTag.html)[]
