create_rule_group
async
¶
create_rule_group(
rule_group_name: ResourceName,
type: RuleGroupType,
capacity: RuleCapacity,
*,
config_overrides: Optional[AsyncNetworkFirewallClientConfig] = None,
rule_group: Optional[RuleGroup] = None,
firewall_rule_group: Optional[FirewallRuleGroup] = None,
ips_rule_group: Optional[IpsRuleGroup] = None,
rules: Optional[RulesString] = None,
description: Optional[Description] = None,
tags: Optional[TagList] = None,
dry_run: Optional[Boolean] = None,
encryption_configuration: Optional[EncryptionConfiguration] = None,
source_metadata: Optional[SourceMetadata] = None,
analyze_rule_group: Optional[Boolean] = None,
summary_configuration: Optional[SummaryConfiguration] = None,
) -> CreateRuleGroupResponse
Creates the specified stateless or stateful rule group, which includes the rules for network traffic inspection, a capacity setting, and tags.
You provide your rule group specification in your request using either RuleGroup or Rules.
Parameters:
-
rule_group_name(ResourceName) –The descriptive name of the rule group. You can't change the name of a rule group after you create it.
-
rule_group(Optional[RuleGroup], default:None) –An object that defines the rule group rules.
You must provide either this rule group setting or a
Rulessetting, but not both. -
firewall_rule_group(Optional[FirewallRuleGroup], default:None) –An object that defines the rules in a firewall engine rule group, for use in a Next Generation policy.
-
ips_rule_group(Optional[IpsRuleGroup], default:None) –An object that defines the rules in an IPS engine rule group, for use in a Next Generation policy.
-
rules(Optional[RulesString], default:None) –A string containing stateful rule group rules specifications in Suricata flat format, with one rule per line. Use this to import your existing Suricata compatible rule groups.
You must provide either this rules setting or a populated
RuleGroupsetting, but not both.You can provide your rule group specification in Suricata flat format through this setting when you create or update your rule group. The call response returns a RuleGroup object that Network Firewall has populated from your string.
-
type(RuleGroupType) –Indicates the type of the rule group. Valid values are:
-
STATELESS- Stateless rules, for use in a Classic Network Firewall policy. -
STATEFUL- Stateful rules, for use in a Classic Network Firewall policy. -
FIREWALL- Firewall engine rules, for use in a Next Generation policy. -
IPS- IPS engine rules, for use in a Next Generation policy.
-
-
description(Optional[Description], default:None) –A description of the rule group.
-
capacity(RuleCapacity) –The maximum operating resources that this rule group can use. Rule group capacity is fixed at creation. When you update a rule group, you are limited to this capacity. When you reference a rule group from a firewall policy, Network Firewall reserves this capacity for the rule group.
You can retrieve the capacity that would be required for a rule group before you create the rule group by calling CreateRuleGroup with
DryRunset toTRUE.You can't change or exceed this capacity when you update the rule group, so leave room for your rule group to grow.
Capacity for a stateless rule group
For a stateless rule group, the capacity required is the sum of the capacity requirements of the individual rules that you expect to have in the rule group.
To calculate the capacity requirement of a single rule, multiply the capacity requirement values of each of the rule's match settings:
-
A match setting with no criteria specified has a value of 1.
-
A match setting with
Anyspecified has a value of 1. -
All other match settings have a value equal to the number of elements provided in the setting. For example, a protocol setting ["UDP"] and a source setting ["10.0.0.0/24"] each have a value of 1. A protocol setting ["UDP","TCP"] has a value of 2. A source setting ["10.0.0.0/24","10.0.0.1/24","10.0.0.2/24"] has a value of 3.
A rule with no criteria specified in any of its match settings has a capacity requirement of 1. A rule with protocol setting ["UDP","TCP"], source setting ["10.0.0.0/24","10.0.0.1/24","10.0.0.2/24"], and a single specification or no specification for each of the other match settings has a capacity requirement of 6.
Capacity for a stateful rule group
For a stateful rule group, the minimum capacity required is the number of individual rules that you expect to have in the rule group.
-
-
tags(Optional[TagList], default:None) –The key:value pairs to associate with the resource.
-
dry_run(Optional[Boolean], default:None) –Indicates whether you want Network Firewall to just check the validity of the request, rather than run the request.
If set to
TRUE, Network Firewall checks whether the request can run successfully, but doesn't actually make the requested changes. The call returns the value that the request would return if you ran it with dry run set toFALSE, but doesn't make additions or changes to your resources. This option allows you to make sure that you have the required permissions to run the request and that your request parameters are valid.If set to
FALSE, Network Firewall makes the requested changes to your resources. -
encryption_configuration(Optional[EncryptionConfiguration], default:None) –A complex type that contains settings for encryption of your rule group resources.
-
source_metadata(Optional[SourceMetadata], default:None) –A complex type that contains metadata about the rule group that your own rule group is copied from. You can use the metadata to keep track of updates made to the originating rule group.
-
analyze_rule_group(Optional[Boolean], default:None) –Indicates whether you want Network Firewall to analyze the stateless rules in the rule group for rule behavior such as asymmetric routing. If set to
TRUE, Network Firewall runs the analysis and then creates the rule group for you. To run the stateless rule group analyzer without creating the rule group, setDryRuntoTRUE. -
summary_configuration(Optional[SummaryConfiguration], default:None) –An object that contains a
RuleOptionsarray of strings. You useRuleOptionsto determine which of the following RuleSummary values are returned in response toDescribeRuleGroupSummary.-
Metadata- returns -
Msg -
SID
-
Raises:
-
InsufficientCapacityException–Amazon Web Services doesn't currently have enough available capacity to fulfill your request. Try your request later.
-
InternalServerError–Your request is valid, but Network Firewall couldn't perform the operation because of a system problem. Retry your request.
-
InvalidRequestException–The operation failed because of a problem with your request. Examples include:
-
You specified an unsupported parameter name or value.
-
You tried to update a property with a value that isn't among the available types.
-
Your request references an ARN that is malformed, or corresponds to a resource that isn't valid in the context of the request.
-
-
LimitExceededException–Unable to perform the operation because doing so would violate a limit setting.
-
ThrottlingException–Unable to process the request due to throttling limitations.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_network_firewall/_services/async_network_firewall.py
1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 | |