Skip to content
v2.278.0

CfnRuleProps Struct ​

Properties for defining a CfnRule.

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 cfnRuleProps: networksecuritymanager.CfnRuleProps = {
  ruleName: 'ruleName',

  // the properties below are optional
  configuration: 'configuration',
  firewallType: 'firewallType',
  ruleDescription: 'ruleDescription',
  ruleType: 'ruleType',
  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_rule_props = networksecuritymanager.CfnRuleProps(
    rule_name="ruleName",

    # the properties below are optional
    configuration="configuration",
    firewall_type="firewallType",
    rule_description="ruleDescription",
    rule_type="ruleType",
    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.*;

CfnRuleProps cfnRuleProps = CfnRuleProps.builder()
        .ruleName("ruleName")

        // the properties below are optional
        .configuration("configuration")
        .firewallType("firewallType")
        .ruleDescription("ruleDescription")
        .ruleType("ruleType")
        .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 cfnRuleProps = new CfnRuleProps {
    RuleName = "ruleName",

    // the properties below are optional
    Configuration = "configuration",
    FirewallType = "firewallType",
    RuleDescription = "ruleDescription",
    RuleType = "ruleType",
    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"

cfnRuleProps := &CfnRuleProps{
	RuleName: jsii.String("ruleName"),

	// the properties below are optional
	Configuration: jsii.String("configuration"),
	FirewallType: jsii.String("firewallType"),
	RuleDescription: jsii.String("ruleDescription"),
	RuleType: jsii.String("ruleType"),
	Tags: []CfnTag{
		&CfnTag{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
}

Properties ​

configurationoptionalstringconfigurationoptionalstrconfigurationoptionalStringConfigurationoptionalstringConfigurationoptional*string #
The rule configuration as a JSON string.
firewallTypeoptionalstringfirewall_typeoptionalstrfirewallTypeoptionalStringFirewallTypeoptionalstringFirewallTypeoptional*string #
The type of firewall for this rule.
ruleDescriptionoptionalstringrule_descriptionoptionalstrruleDescriptionoptionalStringRuleDescriptionoptionalstringRuleDescriptionoptional*string #
A description of the rule.
ruleNamestringrule_namestrruleNameStringRuleNamestringRuleName*string required #
The name of the rule.
ruleTypeoptionalstringrule_typeoptionalstrruleTypeoptionalStringRuleTypeoptionalstringRuleTypeoptional*string #
The type of rule.
tagsoptionalCfnTag[]tagsoptionaltyping.List[CfnTag]tagsoptionalList<CfnTag>TagsoptionalCfnTag[]Tagsoptional*[]CfnTag #
The tags associated with the rule.