# CfnPolicyProps

Properties for defining a `CfnPolicy`.

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

- Source: Generated at build time
- Type last changed: v2.260.0 · 16 Jun 2026

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_verifiedpermissions as verifiedpermissions } from 'aws-cdk-lib';
const cfnPolicyProps: verifiedpermissions.CfnPolicyProps = {
  definition: {
    static: {
      statement: 'statement',

      // the properties below are optional
      description: 'description',
    },
    templateLinked: {
      policyTemplateId: 'policyTemplateId',

      // the properties below are optional
      principal: {
        entityId: 'entityId',
        entityType: 'entityType',
      },
      resource: {
        entityId: 'entityId',
        entityType: 'entityType',
      },
    },
  },
  policyStoreId: 'policyStoreId',

  // the properties below are optional
  name: 'name',
};
```

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_verifiedpermissions as verifiedpermissions

cfn_policy_props = verifiedpermissions.CfnPolicyProps(
    definition=verifiedpermissions.CfnPolicy.PolicyDefinitionProperty(
        static=verifiedpermissions.CfnPolicy.StaticPolicyDefinitionProperty(
            statement="statement",

            # the properties below are optional
            description="description"
        ),
        template_linked=verifiedpermissions.CfnPolicy.TemplateLinkedPolicyDefinitionProperty(
            policy_template_id="policyTemplateId",

            # the properties below are optional
            principal=verifiedpermissions.CfnPolicy.EntityIdentifierProperty(
                entity_id="entityId",
                entity_type="entityType"
            ),
            resource=verifiedpermissions.CfnPolicy.EntityIdentifierProperty(
                entity_id="entityId",
                entity_type="entityType"
            )
        )
    ),
    policy_store_id="policyStoreId",

    # the properties below are optional
    name="name"
)
```

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

CfnPolicyProps cfnPolicyProps = CfnPolicyProps.builder()
        .definition(PolicyDefinitionProperty.builder()
                .static(StaticPolicyDefinitionProperty.builder()
                        .statement("statement")

                        // the properties below are optional
                        .description("description")
                        .build())
                .templateLinked(TemplateLinkedPolicyDefinitionProperty.builder()
                        .policyTemplateId("policyTemplateId")

                        // the properties below are optional
                        .principal(EntityIdentifierProperty.builder()
                                .entityId("entityId")
                                .entityType("entityType")
                                .build())
                        .resource(EntityIdentifierProperty.builder()
                                .entityId("entityId")
                                .entityType("entityType")
                                .build())
                        .build())
                .build())
        .policyStoreId("policyStoreId")

        // the properties below are optional
        .name("name")
        .build();
```

C# / .NET:

```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.VerifiedPermissions;

var cfnPolicyProps = new CfnPolicyProps {
    Definition = new PolicyDefinitionProperty {
        Static = new StaticPolicyDefinitionProperty {
            Statement = "statement",

            // the properties below are optional
            Description = "description"
        },
        TemplateLinked = new TemplateLinkedPolicyDefinitionProperty {
            PolicyTemplateId = "policyTemplateId",

            // the properties below are optional
            Principal = new EntityIdentifierProperty {
                EntityId = "entityId",
                EntityType = "entityType"
            },
            Resource = new EntityIdentifierProperty {
                EntityId = "entityId",
                EntityType = "entityType"
            }
        }
    },
    PolicyStoreId = "policyStoreId",

    // the properties below are optional
    Name = "name"
};
```

Golang:

```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"

cfnPolicyProps := &CfnPolicyProps{
	Definition: &PolicyDefinitionProperty{
		Static: &StaticPolicyDefinitionProperty{
			Statement: jsii.String("statement"),

			// the properties below are optional
			Description: jsii.String("description"),
		},
		TemplateLinked: &TemplateLinkedPolicyDefinitionProperty{
			PolicyTemplateId: jsii.String("policyTemplateId"),

			// the properties below are optional
			Principal: &EntityIdentifierProperty{
				EntityId: jsii.String("entityId"),
				EntityType: jsii.String("entityType"),
			},
			Resource: &EntityIdentifierProperty{
				EntityId: jsii.String("entityId"),
				EntityType: jsii.String("entityType"),
			},
		},
	},
	PolicyStoreId: jsii.String("policyStoreId"),

	// the properties below are optional
	Name: jsii.String("name"),
}
```

## Properties

- `definition`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnPolicy.PolicyDefinitionProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_verifiedpermissions.CfnPolicy.PolicyDefinitionProperty.html) (required) — Specifies the policy type and content to use for the new or updated policy.

  The definition structure must include either a `Static` or a `TemplateLinked` element.

- `name`: string

- `policyStoreId`: string (required) — Specifies the `PolicyStoreId` of the policy store you want to store the policy in.
