Skip to content
v2.278.0

CfnPolicyProps Struct ​

Properties for defining a CfnPolicy.

Example ​

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
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
// 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();
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"
    } }
};
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 ​

associatedTemplateAndRuleListoptionalIResolvable | IResolvable | CfnPolicy.AssociatedTemplateAndRuleProperty[]associated_template_and_rule_listoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, AssociatedTemplateAndRuleProperty]]]associatedTemplateAndRuleListoptionalIResolvableAssociatedTemplateAndRuleListoptionalIResolvableAssociatedTemplateAndRuleListoptionalinterface{} #
List of templates and rules associated with this policy.
firewallTypestringfirewall_typestrfirewallTypeStringFirewallTypestringFirewallType*string required #
The type of firewall.
policyConfigurationIResolvable | CfnPolicy.PolicyConfigurationPropertypolicy_configurationtyping.Union[IResolvable, PolicyConfigurationProperty]policyConfigurationIResolvablePolicyConfigurationIResolvablePolicyConfigurationinterface{} required #
Configuration settings for policy behavior.
policyDescriptionoptionalstringpolicy_descriptionoptionalstrpolicyDescriptionoptionalStringPolicyDescriptionoptionalstringPolicyDescriptionoptional*string #
A description of the policy.
policyNamestringpolicy_namestrpolicyNameStringPolicyNamestringPolicyName*string required #
The name of the policy.
prioritynumberpriorityint | floatpriorityNumberPrioritydoublePriority*float64 required #
The priority of the policy.
tagsoptionalCfnTag[]tagsoptionaltyping.List[CfnTag]tagsoptionalList<CfnTag>TagsoptionalCfnTag[]Tagsoptional*[]CfnTag #
The tags associated with the policy.