# CfnPolicyProps

Properties for defining a `CfnPolicy`.

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

- Source: Generated at build time
- Type last changed: v2.274.0 · 20 Oct 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_networksecuritymanager as networksecuritymanager } from 'aws-cdk-lib';
const cfnPolicyProps: networksecuritymanager.CfnPolicyProps = {
  firewallType: 'firewallType',
  policyConfiguration: {
    remediationEnabled: false,
    resourcesCleanUp: false,
    wafConfig: {
      conflictResolution: 'conflictResolution',
      existingCustomerWebAclResolution: 'existingCustomerWebAclResolution',
    },
  },
  policyName: 'policyName',
  priority: 123,

  // the properties below are optional
  associatedTemplateAndRuleList: [{
    ruleArn: 'ruleArn',
    templateArn: 'templateArn',
  }],
  policyDescription: 'policyDescription',
  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_networksecuritymanager as networksecuritymanager

cfn_policy_props = networksecuritymanager.CfnPolicyProps(
    firewall_type="firewallType",
    policy_configuration=networksecuritymanager.CfnPolicy.PolicyConfigurationProperty(
        remediation_enabled=False,
        resources_clean_up=False,
        waf_config=networksecuritymanager.CfnPolicy.WafConfigProperty(
            conflict_resolution="conflictResolution",
            existing_customer_web_acl_resolution="existingCustomerWebAclResolution"
        )
    ),
    policy_name="policyName",
    priority=123,

    # the properties below are optional
    associated_template_and_rule_list=[networksecuritymanager.CfnPolicy.AssociatedTemplateAndRuleProperty(
        rule_arn="ruleArn",
        template_arn="templateArn"
    )],
    policy_description="policyDescription",
    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.networksecuritymanager.*;

CfnPolicyProps cfnPolicyProps = CfnPolicyProps.builder()
        .firewallType("firewallType")
        .policyConfiguration(PolicyConfigurationProperty.builder()
                .remediationEnabled(false)
                .resourcesCleanUp(false)
                .wafConfig(WafConfigProperty.builder()
                        .conflictResolution("conflictResolution")
                        .existingCustomerWebAclResolution("existingCustomerWebAclResolution")
                        .build())
                .build())
        .policyName("policyName")
        .priority(123)

        // the properties below are optional
        .associatedTemplateAndRuleList(List.of(AssociatedTemplateAndRuleProperty.builder()
                .ruleArn("ruleArn")
                .templateArn("templateArn")
                .build()))
        .policyDescription("policyDescription")
        .tags(List.of(CfnTag.builder()
                .key("key")
                .value("value")
                .build()))
        .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.NetworkSecurityManager;

var cfnPolicyProps = new CfnPolicyProps {
    FirewallType = "firewallType",
    PolicyConfiguration = new PolicyConfigurationProperty {
        RemediationEnabled = false,
        ResourcesCleanUp = false,
        WafConfig = new WafConfigProperty {
            ConflictResolution = "conflictResolution",
            ExistingCustomerWebAclResolution = "existingCustomerWebAclResolution"
        }
    },
    PolicyName = "policyName",
    Priority = 123,

    // the properties below are optional
    AssociatedTemplateAndRuleList = new [] { new AssociatedTemplateAndRuleProperty {
        RuleArn = "ruleArn",
        TemplateArn = "templateArn"
    } },
    PolicyDescription = "policyDescription",
    Tags = new [] { new CfnTag {
        Key = "key",
        Value = "value"
    } }
};
```

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{
	FirewallType: jsii.String("firewallType"),
	PolicyConfiguration: &PolicyConfigurationProperty{
		RemediationEnabled: jsii.Boolean(false),
		ResourcesCleanUp: jsii.Boolean(false),
		WafConfig: &WafConfigProperty{
			ConflictResolution: jsii.String("conflictResolution"),
			ExistingCustomerWebAclResolution: jsii.String("existingCustomerWebAclResolution"),
		},
	},
	PolicyName: jsii.String("policyName"),
	Priority: jsii.Number(123),

	// the properties below are optional
	AssociatedTemplateAndRuleList: []interface{}{
		&AssociatedTemplateAndRuleProperty{
			RuleArn: jsii.String("ruleArn"),
			TemplateArn: jsii.String("templateArn"),
		},
	},
	PolicyDescription: jsii.String("policyDescription"),
	Tags: []CfnTag{
		&CfnTag{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
}
```

## Properties

- `associatedTemplateAndRuleList`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnPolicy.AssociatedTemplateAndRuleProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_networksecuritymanager.CfnPolicy.AssociatedTemplateAndRuleProperty.html)[] — List of templates and rules associated with this policy.

- `firewallType`: string (required) — The type of firewall.

- `policyConfiguration`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnPolicy.PolicyConfigurationProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_networksecuritymanager.CfnPolicy.PolicyConfigurationProperty.html) (required) — Configuration settings for policy behavior.

- `policyDescription`: string — A description of the policy.

- `policyName`: string (required) — The name of the policy.

- `priority`: number (required) — The priority of the policy.

- `tags`: [CfnTag](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.CfnTag.html)[] — The tags associated with the policy.
