# 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_bedrockagentcore.CfnPolicy.html)

- Source: Generated at build time
- Type last changed: v2.261.0 · 2 Jul 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_bedrockagentcore as bedrockagentcore } from 'aws-cdk-lib';
const cfnPolicyProps: bedrockagentcore.CfnPolicyProps = {
  definition: {
    cedar: {
      statement: 'statement',
    },
    policy: {
      statement: 'statement',
    },
  },
  name: 'name',
  policyEngineId: 'policyEngineId',

  // the properties below are optional
  description: 'description',
  enforcementMode: 'enforcementMode',
  validationMode: 'validationMode',
};
```

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_bedrockagentcore as bedrockagentcore

cfn_policy_props = bedrockagentcore.CfnPolicyProps(
    definition=bedrockagentcore.CfnPolicy.PolicyDefinitionProperty(
        cedar=bedrockagentcore.CfnPolicy.CedarPolicyProperty(
            statement="statement"
        ),
        policy=bedrockagentcore.CfnPolicy.PolicyStatementProperty(
            statement="statement"
        )
    ),
    name="name",
    policy_engine_id="policyEngineId",

    # the properties below are optional
    description="description",
    enforcement_mode="enforcementMode",
    validation_mode="validationMode"
)
```

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

CfnPolicyProps cfnPolicyProps = CfnPolicyProps.builder()
        .definition(PolicyDefinitionProperty.builder()
                .cedar(CedarPolicyProperty.builder()
                        .statement("statement")
                        .build())
                .policy(PolicyStatementProperty.builder()
                        .statement("statement")
                        .build())
                .build())
        .name("name")
        .policyEngineId("policyEngineId")

        // the properties below are optional
        .description("description")
        .enforcementMode("enforcementMode")
        .validationMode("validationMode")
        .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.BedrockAgentCore;

var cfnPolicyProps = new CfnPolicyProps {
    Definition = new PolicyDefinitionProperty {
        Cedar = new CedarPolicyProperty {
            Statement = "statement"
        },
        Policy = new PolicyStatementProperty {
            Statement = "statement"
        }
    },
    Name = "name",
    PolicyEngineId = "policyEngineId",

    // the properties below are optional
    Description = "description",
    EnforcementMode = "enforcementMode",
    ValidationMode = "validationMode"
};
```

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"

cfnPolicyProps := &CfnPolicyProps{
	Definition: &PolicyDefinitionProperty{
		Cedar: &CedarPolicyProperty{
			Statement: jsii.String("statement"),
		},
		Policy: &PolicyStatementProperty{
			Statement: jsii.String("statement"),
		},
	},
	Name: jsii.String("name"),
	PolicyEngineId: jsii.String("policyEngineId"),

	// the properties below are optional
	Description: jsii.String("description"),
	EnforcementMode: jsii.String("enforcementMode"),
	ValidationMode: jsii.String("validationMode"),
}
```

## 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_bedrockagentcore.CfnPolicy.PolicyDefinitionProperty.html) (required) — The definition structure for policies.

  Encapsulates different policy formats.

- `description`: string — A human-readable description of the policy's purpose and functionality.

- `enforcementMode`: string = "ACTIVE" — Whether the policy contributes to the enforce decision returned to Gateway.

  LOG_ONLY policies are still evaluated but their decisions are observed only, allowing customers to validate a policy against real traffic before promoting it.

- `name`: string (required) — The customer-assigned immutable name for the policy.

  Must be unique within the policy engine.

- `policyEngineId`: string (required) — The identifier of the policy engine which contains this policy.

- `validationMode`: string — The validation mode for the policy.

  Determines how Cedar analyzer validation results are handled.
