blib/lib/Paws/WAFV2/CreateRuleGroup.pm untested

filter: Statementstmt 0.0% 0 / 17 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 2 Podpod n/a totaltotal 0.0% 0 / 19 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1  
2 package Paws::WAFV2::CreateRuleGroup;
3 use Moose;
4 has Capacity => (is => 'ro', isa => 'Int', required => 1);
5 has CustomResponseBodies => (is => 'ro', isa => 'Paws::WAFV2::CustomResponseBodies');
6 has Description => (is => 'ro', isa => 'Str');
7 has Name => (is => 'ro', isa => 'Str', required => 1);
8 has Rules => (is => 'ro', isa => 'ArrayRef[Paws::WAFV2::Rule]');
9 has Scope => (is => 'ro', isa => 'Str', required => 1);
10 has Tags => (is => 'ro', isa => 'ArrayRef[Paws::WAFV2::Tag]');
11 has VisibilityConfig => (is => 'ro', isa => 'Paws::WAFV2::VisibilityConfig', required => 1);
12  
13 use MooseX::ClassAttribute;
14  
15 class_has _api_call => (isa => 'Str', is => 'ro', default => 'CreateRuleGroup');
16 class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::WAFV2::CreateRuleGroupResponse');
17 class_has _result_key => (isa => 'Str', is => 'ro');
18 1;
19  
20 ### main pod documentation begin ###
21  
22 =head1 NAME
23  
24 Paws::WAFV2::CreateRuleGroup - Arguments for method CreateRuleGroup on L<Paws::WAFV2>
25  
26 =head1 DESCRIPTION
27  
28 This class represents the parameters used for calling the method CreateRuleGroup on the
29 L<AWS WAFV2|Paws::WAFV2> service. Use the attributes of this class
30 as arguments to method CreateRuleGroup.
31  
32 You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to CreateRuleGroup.
33  
34 =head1 SYNOPSIS
35  
36 my $wafv2 = Paws->service('WAFV2');
37 my $CreateRuleGroupResponse = $wafv2->CreateRuleGroup(
38 Capacity => 1,
39 Name => 'MyEntityName',
40 Scope => 'CLOUDFRONT',
41 VisibilityConfig => {
42 CloudWatchMetricsEnabled => 1,
43 MetricName => 'MyMetricName', # min: 1, max: 255
44 SampledRequestsEnabled => 1,
45  
46 },
47 CustomResponseBodies => {
48 'MyEntityName' => {
49 Content => 'MyResponseContent', # min: 1, max: 10240
50 ContentType =>
51 'TEXT_PLAIN', # values: TEXT_PLAIN, TEXT_HTML, APPLICATION_JSON
52  
53 }, # key: min: 1, max: 128
54 }, # OPTIONAL
55 Description => 'MyEntityDescription', # OPTIONAL
56 Rules => [
57 {
58 Name => 'MyEntityName', # min: 1, max: 128
59 Priority => 1,
60 Statement => {
61 AndStatement => {
62 Statements => [ <Statement>, ... ],
63  
64 }, # OPTIONAL
65 ByteMatchStatement => {
66 FieldToMatch => {
67 AllQueryArguments => {
68  
69 }, # OPTIONAL
70 Body => {
71  
72 }, # OPTIONAL
73 JsonBody => {
74 MatchPattern => {
75 All => {
76  
77 }, # OPTIONAL
78 IncludedPaths => [
79 'MyJsonPointerPath', ... # min: 1, max: 512
80 ], # min: 1; OPTIONAL
81 },
82 MatchScope => 'ALL', # values: ALL, KEY, VALUE
83 InvalidFallbackBehavior => 'MATCH'
84 , # values: MATCH, NO_MATCH, EVALUATE_AS_STRING; OPTIONAL
85 }, # OPTIONAL
86 Method => {
87  
88 }, # OPTIONAL
89 QueryString => {
90  
91 }, # OPTIONAL
92 SingleHeader => {
93 Name => 'MyFieldToMatchData', # min: 1, max: 64
94  
95 }, # OPTIONAL
96 SingleQueryArgument => {
97 Name => 'MyFieldToMatchData', # min: 1, max: 64
98  
99 }, # OPTIONAL
100 UriPath => {
101  
102 }, # OPTIONAL
103 },
104 PositionalConstraint => 'EXACTLY'
105 , # values: EXACTLY, STARTS_WITH, ENDS_WITH, CONTAINS, CONTAINS_WORD
106 SearchString => 'BlobSearchString',
107 TextTransformations => [
108 {
109 Priority => 1,
110 Type => 'NONE'
111 , # values: NONE, COMPRESS_WHITE_SPACE, HTML_ENTITY_DECODE, LOWERCASE, CMD_LINE, URL_DECODE, BASE64_DECODE, HEX_DECODE, MD5, REPLACE_COMMENTS, ESCAPE_SEQ_DECODE, SQL_HEX_DECODE, CSS_DECODE, JS_DECODE, NORMALIZE_PATH, NORMALIZE_PATH_WIN, REMOVE_NULLS, REPLACE_NULLS, BASE64_DECODE_EXT, URL_DECODE_UNI, UTF8_TO_UNICODE
112  
113 },
114 ...
115 ], # min: 1
116  
117 }, # OPTIONAL
118 GeoMatchStatement => {
119 CountryCodes => [
120 'AF',
121 ... # values: AF, AX, AL, DZ, AS, AD, AO, AI, AQ, AG, AR, AM, AW, AU, AT, AZ, BS, BH, BD, BB, BY, BE, BZ, BJ, BM, BT, BO, BQ, BA, BW, BV, BR, IO, BN, BG, BF, BI, KH, CM, CA, CV, KY, CF, TD, CL, CN, CX, CC, CO, KM, CG, CD, CK, CR, CI, HR, CU, CW, CY, CZ, DK, DJ, DM, DO, EC, EG, SV, GQ, ER, EE, ET, FK, FO, FJ, FI, FR, GF, PF, TF, GA, GM, GE, DE, GH, GI, GR, GL, GD, GP, GU, GT, GG, GN, GW, GY, HT, HM, VA, HN, HK, HU, IS, IN, ID, IR, IQ, IE, IM, IL, IT, JM, JP, JE, JO, KZ, KE, KI, KP, KR, KW, KG, LA, LV, LB, LS, LR, LY, LI, LT, LU, MO, MK, MG, MW, MY, MV, ML, MT, MH, MQ, MR, MU, YT, MX, FM, MD, MC, MN, ME, MS, MA, MZ, MM, NA, NR, NP, NL, NC, NZ, NI, NE, NG, NU, NF, MP, NO, OM, PK, PW, PS, PA, PG, PY, PE, PH, PN, PL, PT, PR, QA, RE, RO, RU, RW, BL, SH, KN, LC, MF, PM, VC, WS, SM, ST, SA, SN, RS, SC, SL, SG, SX, SK, SI, SB, SO, ZA, GS, SS, ES, LK, SD, SR, SJ, SZ, SE, CH, SY, TW, TJ, TZ, TH, TL, TG, TK, TO, TT, TN, TR, TM, TC, TV, UG, UA, AE, GB, US, UM, UY, UZ, VU, VE, VN, VG, VI, WF, EH, YE, ZM, ZW
122 ], # min: 1; OPTIONAL
123 ForwardedIPConfig => {
124 FallbackBehavior => 'MATCH', # values: MATCH, NO_MATCH
125 HeaderName => 'MyForwardedIPHeaderName', # min: 1, max: 255
126  
127 }, # OPTIONAL
128 }, # OPTIONAL
129 IPSetReferenceStatement => {
130 ARN => 'MyResourceArn', # min: 20, max: 2048
131 IPSetForwardedIPConfig => {
132 FallbackBehavior => 'MATCH', # values: MATCH, NO_MATCH
133 HeaderName => 'MyForwardedIPHeaderName', # min: 1, max: 255
134 Position => 'FIRST', # values: FIRST, LAST, ANY
135  
136 }, # OPTIONAL
137 }, # OPTIONAL
138 LabelMatchStatement => {
139 Key => 'MyLabelMatchKey', # min: 1, max: 1024
140 Scope => 'LABEL', # values: LABEL, NAMESPACE
141  
142 }, # OPTIONAL
143 ManagedRuleGroupStatement => {
144 Name => 'MyEntityName', # min: 1, max: 128
145 VendorName => 'MyVendorName', # min: 1, max: 128
146 ExcludedRules => [
147 {
148 Name => 'MyEntityName', # min: 1, max: 128
149  
150 },
151 ...
152 ], # OPTIONAL
153 ScopeDownStatement => <Statement>,
154 }, # OPTIONAL
155 NotStatement => {
156 Statement => <Statement>,
157  
158 }, # OPTIONAL
159 OrStatement => {
160 Statements => [ <Statement>, ... ],
161  
162 }, # OPTIONAL
163 RateBasedStatement => {
164 AggregateKeyType => 'IP', # values: IP, FORWARDED_IP
165 Limit => 1, # min: 100, max: 2000000000
166 ForwardedIPConfig => {
167 FallbackBehavior => 'MATCH', # values: MATCH, NO_MATCH
168 HeaderName => 'MyForwardedIPHeaderName', # min: 1, max: 255
169  
170 }, # OPTIONAL
171 ScopeDownStatement => <Statement>,
172 }, # OPTIONAL
173 RegexPatternSetReferenceStatement => {
174 ARN => 'MyResourceArn', # min: 20, max: 2048
175 FieldToMatch => {
176 AllQueryArguments => {
177  
178 }, # OPTIONAL
179 Body => {
180  
181 }, # OPTIONAL
182 JsonBody => {
183 MatchPattern => {
184 All => {
185  
186 }, # OPTIONAL
187 IncludedPaths => [
188 'MyJsonPointerPath', ... # min: 1, max: 512
189 ], # min: 1; OPTIONAL
190 },
191 MatchScope => 'ALL', # values: ALL, KEY, VALUE
192 InvalidFallbackBehavior => 'MATCH'
193 , # values: MATCH, NO_MATCH, EVALUATE_AS_STRING; OPTIONAL
194 }, # OPTIONAL
195 Method => {
196  
197 }, # OPTIONAL
198 QueryString => {
199  
200 }, # OPTIONAL
201 SingleHeader => {
202 Name => 'MyFieldToMatchData', # min: 1, max: 64
203  
204 }, # OPTIONAL
205 SingleQueryArgument => {
206 Name => 'MyFieldToMatchData', # min: 1, max: 64
207  
208 }, # OPTIONAL
209 UriPath => {
210  
211 }, # OPTIONAL
212 },
213 TextTransformations => [
214 {
215 Priority => 1,
216 Type => 'NONE'
217 , # values: NONE, COMPRESS_WHITE_SPACE, HTML_ENTITY_DECODE, LOWERCASE, CMD_LINE, URL_DECODE, BASE64_DECODE, HEX_DECODE, MD5, REPLACE_COMMENTS, ESCAPE_SEQ_DECODE, SQL_HEX_DECODE, CSS_DECODE, JS_DECODE, NORMALIZE_PATH, NORMALIZE_PATH_WIN, REMOVE_NULLS, REPLACE_NULLS, BASE64_DECODE_EXT, URL_DECODE_UNI, UTF8_TO_UNICODE
218  
219 },
220 ...
221 ], # min: 1
222  
223 }, # OPTIONAL
224 RuleGroupReferenceStatement => {
225 ARN => 'MyResourceArn', # min: 20, max: 2048
226 ExcludedRules => [
227 {
228 Name => 'MyEntityName', # min: 1, max: 128
229  
230 },
231 ...
232 ], # OPTIONAL
233 }, # OPTIONAL
234 SizeConstraintStatement => {
235 ComparisonOperator => 'EQ', # values: EQ, NE, LE, LT, GE, GT
236 FieldToMatch => {
237 AllQueryArguments => {
238  
239 }, # OPTIONAL
240 Body => {
241  
242 }, # OPTIONAL
243 JsonBody => {
244 MatchPattern => {
245 All => {
246  
247 }, # OPTIONAL
248 IncludedPaths => [
249 'MyJsonPointerPath', ... # min: 1, max: 512
250 ], # min: 1; OPTIONAL
251 },
252 MatchScope => 'ALL', # values: ALL, KEY, VALUE
253 InvalidFallbackBehavior => 'MATCH'
254 , # values: MATCH, NO_MATCH, EVALUATE_AS_STRING; OPTIONAL
255 }, # OPTIONAL
256 Method => {
257  
258 }, # OPTIONAL
259 QueryString => {
260  
261 }, # OPTIONAL
262 SingleHeader => {
263 Name => 'MyFieldToMatchData', # min: 1, max: 64
264  
265 }, # OPTIONAL
266 SingleQueryArgument => {
267 Name => 'MyFieldToMatchData', # min: 1, max: 64
268  
269 }, # OPTIONAL
270 UriPath => {
271  
272 }, # OPTIONAL
273 },
274 Size => 1, # max: 21474836480
275 TextTransformations => [
276 {
277 Priority => 1,
278 Type => 'NONE'
279 , # values: NONE, COMPRESS_WHITE_SPACE, HTML_ENTITY_DECODE, LOWERCASE, CMD_LINE, URL_DECODE, BASE64_DECODE, HEX_DECODE, MD5, REPLACE_COMMENTS, ESCAPE_SEQ_DECODE, SQL_HEX_DECODE, CSS_DECODE, JS_DECODE, NORMALIZE_PATH, NORMALIZE_PATH_WIN, REMOVE_NULLS, REPLACE_NULLS, BASE64_DECODE_EXT, URL_DECODE_UNI, UTF8_TO_UNICODE
280  
281 },
282 ...
283 ], # min: 1
284  
285 }, # OPTIONAL
286 SqliMatchStatement => {
287 FieldToMatch => {
288 AllQueryArguments => {
289  
290 }, # OPTIONAL
291 Body => {
292  
293 }, # OPTIONAL
294 JsonBody => {
295 MatchPattern => {
296 All => {
297  
298 }, # OPTIONAL
299 IncludedPaths => [
300 'MyJsonPointerPath', ... # min: 1, max: 512
301 ], # min: 1; OPTIONAL
302 },
303 MatchScope => 'ALL', # values: ALL, KEY, VALUE
304 InvalidFallbackBehavior => 'MATCH'
305 , # values: MATCH, NO_MATCH, EVALUATE_AS_STRING; OPTIONAL
306 }, # OPTIONAL
307 Method => {
308  
309 }, # OPTIONAL
310 QueryString => {
311  
312 }, # OPTIONAL
313 SingleHeader => {
314 Name => 'MyFieldToMatchData', # min: 1, max: 64
315  
316 }, # OPTIONAL
317 SingleQueryArgument => {
318 Name => 'MyFieldToMatchData', # min: 1, max: 64
319  
320 }, # OPTIONAL
321 UriPath => {
322  
323 }, # OPTIONAL
324 },
325 TextTransformations => [
326 {
327 Priority => 1,
328 Type => 'NONE'
329 , # values: NONE, COMPRESS_WHITE_SPACE, HTML_ENTITY_DECODE, LOWERCASE, CMD_LINE, URL_DECODE, BASE64_DECODE, HEX_DECODE, MD5, REPLACE_COMMENTS, ESCAPE_SEQ_DECODE, SQL_HEX_DECODE, CSS_DECODE, JS_DECODE, NORMALIZE_PATH, NORMALIZE_PATH_WIN, REMOVE_NULLS, REPLACE_NULLS, BASE64_DECODE_EXT, URL_DECODE_UNI, UTF8_TO_UNICODE
330  
331 },
332 ...
333 ], # min: 1
334  
335 }, # OPTIONAL
336 XssMatchStatement => {
337 FieldToMatch => {
338 AllQueryArguments => {
339  
340 }, # OPTIONAL
341 Body => {
342  
343 }, # OPTIONAL
344 JsonBody => {
345 MatchPattern => {
346 All => {
347  
348 }, # OPTIONAL
349 IncludedPaths => [
350 'MyJsonPointerPath', ... # min: 1, max: 512
351 ], # min: 1; OPTIONAL
352 },
353 MatchScope => 'ALL', # values: ALL, KEY, VALUE
354 InvalidFallbackBehavior => 'MATCH'
355 , # values: MATCH, NO_MATCH, EVALUATE_AS_STRING; OPTIONAL
356 }, # OPTIONAL
357 Method => {
358  
359 }, # OPTIONAL
360 QueryString => {
361  
362 }, # OPTIONAL
363 SingleHeader => {
364 Name => 'MyFieldToMatchData', # min: 1, max: 64
365  
366 }, # OPTIONAL
367 SingleQueryArgument => {
368 Name => 'MyFieldToMatchData', # min: 1, max: 64
369  
370 }, # OPTIONAL
371 UriPath => {
372  
373 }, # OPTIONAL
374 },
375 TextTransformations => [
376 {
377 Priority => 1,
378 Type => 'NONE'
379 , # values: NONE, COMPRESS_WHITE_SPACE, HTML_ENTITY_DECODE, LOWERCASE, CMD_LINE, URL_DECODE, BASE64_DECODE, HEX_DECODE, MD5, REPLACE_COMMENTS, ESCAPE_SEQ_DECODE, SQL_HEX_DECODE, CSS_DECODE, JS_DECODE, NORMALIZE_PATH, NORMALIZE_PATH_WIN, REMOVE_NULLS, REPLACE_NULLS, BASE64_DECODE_EXT, URL_DECODE_UNI, UTF8_TO_UNICODE
380  
381 },
382 ...
383 ], # min: 1
384  
385 }, # OPTIONAL
386 },
387 VisibilityConfig => {
388 CloudWatchMetricsEnabled => 1,
389 MetricName => 'MyMetricName', # min: 1, max: 255
390 SampledRequestsEnabled => 1,
391  
392 },
393 Action => {
394 Allow => {
395 CustomRequestHandling => {
396 InsertHeaders => [
397 {
398 Name => 'MyCustomHTTPHeaderName', # min: 1, max: 64
399 Value => 'MyCustomHTTPHeaderValue', # min: 1, max: 255
400  
401 },
402 ...
403 ], # min: 1
404  
405 }, # OPTIONAL
406 }, # OPTIONAL
407 Block => {
408 CustomResponse => {
409 ResponseCode => 1, # min: 200, max: 600
410 CustomResponseBodyKey => 'MyEntityName', # min: 1, max: 128
411 ResponseHeaders => [
412 {
413 Name => 'MyCustomHTTPHeaderName', # min: 1, max: 64
414 Value => 'MyCustomHTTPHeaderValue', # min: 1, max: 255
415  
416 },
417 ...
418 ], # min: 1
419 }, # OPTIONAL
420 }, # OPTIONAL
421 Count => {
422 CustomRequestHandling => {
423 InsertHeaders => [
424 {
425 Name => 'MyCustomHTTPHeaderName', # min: 1, max: 64
426 Value => 'MyCustomHTTPHeaderValue', # min: 1, max: 255
427  
428 },
429 ...
430 ], # min: 1
431  
432 }, # OPTIONAL
433 }, # OPTIONAL
434 }, # OPTIONAL
435 OverrideAction => {
436 Count => {
437 CustomRequestHandling => {
438 InsertHeaders => [
439 {
440 Name => 'MyCustomHTTPHeaderName', # min: 1, max: 64
441 Value => 'MyCustomHTTPHeaderValue', # min: 1, max: 255
442  
443 },
444 ...
445 ], # min: 1
446  
447 }, # OPTIONAL
448 }, # OPTIONAL
449 None => {
450  
451 }, # OPTIONAL
452 }, # OPTIONAL
453 RuleLabels => [
454 {
455 Name => 'MyLabelName', # min: 1, max: 1024
456  
457 },
458 ...
459 ], # OPTIONAL
460 },
461 ...
462 ], # OPTIONAL
463 Tags => [
464 {
465 Key => 'MyTagKey', # min: 1, max: 128
466 Value => 'MyTagValue', # max: 256
467  
468 },
469 ...
470 ], # OPTIONAL
471 );
472  
473 # Results:
474 my $Summary = $CreateRuleGroupResponse->Summary;
475  
476 # Returns a L<Paws::WAFV2::CreateRuleGroupResponse> object.
477  
478 Values for attributes that are native types (Int, String, Float, etc) can passed as-is (scalar values). Values for complex Types (objects) can be passed as a HashRef. The keys and values of the hashref will be used to instance the underlying object.
479 For the AWS API documentation, see L<https://docs.aws.amazon.com/goto/WebAPI/wafv2/CreateRuleGroup>
480  
481 =head1 ATTRIBUTES
482  
483  
484 =head2 B<REQUIRED> Capacity => Int
485  
486 The web ACL capacity units (WCUs) required for this rule group.
487  
488 When you create your own rule group, you define this, and you cannot
489 change it after creation. When you add or modify the rules in a rule
490 group, WAF enforces this limit. You can check the capacity for a set of
491 rules using CheckCapacity.
492  
493 WAF uses WCUs to calculate and control the operating resources that are
494 used to run your rules, rule groups, and web ACLs. WAF calculates
495 capacity differently for each rule type, to reflect the relative cost
496 of each rule. Simple rules that cost little to run use fewer WCUs than
497 more complex rules that use more processing power. Rule group capacity
498 is fixed at creation, which helps users plan their web ACL WCU usage
499 when they use a rule group. The WCU limit for web ACLs is 1,500.
500  
501  
502  
503 =head2 CustomResponseBodies => L<Paws::WAFV2::CustomResponseBodies>
504  
505 A map of custom response keys and content bodies. When you create a
506 rule with a block action, you can send a custom response to the web
507 request. You define these for the rule group, and then use them in the
508 rules that you define in the rule group.
509  
510 For information about customizing web requests and responses, see
511 Customizing web requests and responses in WAF
512 (https://docs.aws.amazon.com/waf/latest/developerguide/waf-custom-request-response.html)
513 in the WAF Developer Guide
514 (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html).
515  
516 For information about the limits on count and size for custom request
517 and response settings, see WAF quotas
518 (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) in
519 the WAF Developer Guide
520 (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html).
521  
522  
523  
524 =head2 Description => Str
525  
526 A description of the rule group that helps with identification.
527  
528  
529  
530 =head2 B<REQUIRED> Name => Str
531  
532 The name of the rule group. You cannot change the name of a rule group
533 after you create it.
534  
535  
536  
537 =head2 Rules => ArrayRef[L<Paws::WAFV2::Rule>]
538  
539 The Rule statements used to identify the web requests that you want to
540 allow, block, or count. Each rule includes one top-level statement that
541 WAF uses to identify matching web requests, and parameters that govern
542 how WAF handles them.
543  
544  
545  
546 =head2 B<REQUIRED> Scope => Str
547  
548 Specifies whether this is for an Amazon CloudFront distribution or for
549 a regional application. A regional application can be an Application
550 Load Balancer (ALB), an Amazon API Gateway REST API, or an AppSync
551 GraphQL API.
552  
553 To work with CloudFront, you must also specify the Region US East (N.
554 Virginia) as follows:
555  
556 =over
557  
558 =item *
559  
560 CLI - Specify the Region when you use the CloudFront scope:
561 C<--scope=CLOUDFRONT --region=us-east-1>.
562  
563 =item *
564  
565 API and SDKs - For all calls, use the Region endpoint us-east-1.
566  
567 =back
568  
569  
570 Valid values are: C<"CLOUDFRONT">, C<"REGIONAL">
571  
572 =head2 Tags => ArrayRef[L<Paws::WAFV2::Tag>]
573  
574 An array of key:value pairs to associate with the resource.
575  
576  
577  
578 =head2 B<REQUIRED> VisibilityConfig => L<Paws::WAFV2::VisibilityConfig>
579  
580 Defines and enables Amazon CloudWatch metrics and web request sample
581 collection.
582  
583  
584  
585  
586 =head1 SEE ALSO
587  
588 This class forms part of L<Paws>, documenting arguments for method CreateRuleGroup in L<Paws::WAFV2>
589  
590 =head1 BUGS and CONTRIBUTIONS
591  
592 The source code is located here: L<https://github.com/pplu/aws-sdk-perl>
593  
594 Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues>
595  
596 =cut
597