Skip to content

Commit 6da7a3d

Browse files
author
awstools
committed
feat(client-wafv2): AssociateWebACL, UpdateWebACL and PutLoggingConfiguration will now throw WAFFeatureNotIncludedInPricingPlanException when the request contains a feature that is not included in the CloudFront pricing plan of the WebACL.
1 parent c7dd6fd commit 6da7a3d

File tree

9 files changed

+186
-26
lines changed

9 files changed

+186
-26
lines changed

clients/client-wafv2/src/commands/AssociateWebACLCommand.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ export interface AssociateWebACLCommandOutput extends AssociateWebACLResponse, _
7777
* @see {@link AssociateWebACLCommandOutput} for command's `response` shape.
7878
* @see {@link WAFV2ClientResolvedConfig | config} for WAFV2Client's `config` shape.
7979
*
80+
* @throws {@link WAFFeatureNotIncludedInPricingPlanException} (client fault)
81+
* <p>The operation failed because the specified WAF feature isn't supported by the CloudFront pricing plan associated with the web ACL.</p>
82+
*
8083
* @throws {@link WAFInternalErrorException} (server fault)
8184
* <p>Your request is valid, but WAF couldn’t perform the operation because of a system
8285
* problem. Retry your request. </p>

clients/client-wafv2/src/commands/GetWebACLCommand.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import { Command as $Command } from "@smithy/smithy-client";
44
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
55

66
import { commonParams } from "../endpoint/EndpointParameters";
7-
import { GetWebACLRequest, GetWebACLResponse } from "../models/models_0";
7+
import { GetWebACLRequest } from "../models/models_0";
8+
import { GetWebACLResponse } from "../models/models_1";
89
import { GetWebACL } from "../schemas/schemas_0";
910
import { ServiceInputTypes, ServiceOutputTypes, WAFV2ClientResolvedConfig } from "../WAFV2Client";
1011

clients/client-wafv2/src/commands/PutLoggingConfigurationCommand.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,9 @@ export interface PutLoggingConfigurationCommandOutput extends PutLoggingConfigur
282282
* @see {@link PutLoggingConfigurationCommandOutput} for command's `response` shape.
283283
* @see {@link WAFV2ClientResolvedConfig | config} for WAFV2Client's `config` shape.
284284
*
285+
* @throws {@link WAFFeatureNotIncludedInPricingPlanException} (client fault)
286+
* <p>The operation failed because the specified WAF feature isn't supported by the CloudFront pricing plan associated with the web ACL.</p>
287+
*
285288
* @throws {@link WAFInternalErrorException} (server fault)
286289
* <p>Your request is valid, but WAF couldn’t perform the operation because of a system
287290
* problem. Retry your request. </p>

clients/client-wafv2/src/commands/UpdateWebACLCommand.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1201,6 +1201,9 @@ export interface UpdateWebACLCommandOutput extends UpdateWebACLResponse, __Metad
12011201
* expired. You can retrieve the available versions for the managed rule group by calling
12021202
* <a>ListAvailableManagedRuleGroupVersions</a>.</p>
12031203
*
1204+
* @throws {@link WAFFeatureNotIncludedInPricingPlanException} (client fault)
1205+
* <p>The operation failed because the specified WAF feature isn't supported by the CloudFront pricing plan associated with the web ACL.</p>
1206+
*
12041207
* @throws {@link WAFInternalErrorException} (server fault)
12051208
* <p>Your request is valid, but WAF couldn’t perform the operation because of a system
12061209
* problem. Retry your request. </p>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
// smithy-typescript generated code
22
export * from "./models_0";
3+
export * from "./models_1";

clients/client-wafv2/src/models/models_0.ts

Lines changed: 46 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3570,6 +3570,52 @@ export interface AssociateWebACLRequest {
35703570
*/
35713571
export interface AssociateWebACLResponse {}
35723572

3573+
/**
3574+
* <p>A WAF feature that is not supported by the CloudFront pricing plan associated with the web ACL.</p>
3575+
* @public
3576+
*/
3577+
export interface DisallowedFeature {
3578+
/**
3579+
* <p>The name of the disallowed WAF feature.</p>
3580+
* @public
3581+
*/
3582+
Feature?: string | undefined;
3583+
3584+
/**
3585+
* <p>The name of the CloudFront pricing plan required to use the WAF feature.</p>
3586+
* @public
3587+
*/
3588+
RequiredPricingPlan?: string | undefined;
3589+
}
3590+
3591+
/**
3592+
* <p>The operation failed because the specified WAF feature isn't supported by the CloudFront pricing plan associated with the web ACL.</p>
3593+
* @public
3594+
*/
3595+
export class WAFFeatureNotIncludedInPricingPlanException extends __BaseException {
3596+
readonly name: "WAFFeatureNotIncludedInPricingPlanException" = "WAFFeatureNotIncludedInPricingPlanException";
3597+
readonly $fault: "client" = "client";
3598+
Message?: string | undefined;
3599+
/**
3600+
* <p>The names of the disallowed WAF features.</p>
3601+
* @public
3602+
*/
3603+
DisallowedFeatures?: DisallowedFeature[] | undefined;
3604+
/**
3605+
* @internal
3606+
*/
3607+
constructor(opts: __ExceptionOptionType<WAFFeatureNotIncludedInPricingPlanException, __BaseException>) {
3608+
super({
3609+
name: "WAFFeatureNotIncludedInPricingPlanException",
3610+
$fault: "client",
3611+
...opts,
3612+
});
3613+
Object.setPrototypeOf(this, WAFFeatureNotIncludedInPricingPlanException.prototype);
3614+
this.Message = opts.Message;
3615+
this.DisallowedFeatures = opts.DisallowedFeatures;
3616+
}
3617+
}
3618+
35733619
/**
35743620
* <p>Your request is valid, but WAF couldn’t perform the operation because of a system
35753621
* problem. Retry your request. </p>
@@ -9791,28 +9837,3 @@ export interface GetWebACLForResourceResponse {
97919837
*/
97929838
WebACL?: WebACL | undefined;
97939839
}
9794-
9795-
/**
9796-
* @public
9797-
*/
9798-
export interface GetWebACLResponse {
9799-
/**
9800-
* <p>The web ACL specification. You can modify the settings in this web ACL and use it to
9801-
* update this web ACL or create a new one.</p>
9802-
* @public
9803-
*/
9804-
WebACL?: WebACL | undefined;
9805-
9806-
/**
9807-
* <p>A token used for optimistic locking. WAF returns a token to your <code>get</code> and <code>list</code> requests, to mark the state of the entity at the time of the request. To make changes to the entity associated with the token, you provide the token to operations like <code>update</code> and <code>delete</code>. WAF uses the token to ensure that no changes have been made to the entity since you last retrieved it. If a change has been made, the update fails with a <code>WAFOptimisticLockException</code>. If this happens, perform another <code>get</code>, and use the new token returned by that operation. </p>
9808-
* @public
9809-
*/
9810-
LockToken?: string | undefined;
9811-
9812-
/**
9813-
* <p>The URL to use in SDK integrations with Amazon Web Services managed rule groups. For example, you can use the integration SDKs with the account takeover prevention managed rule group <code>AWSManagedRulesATPRuleSet</code> and the account creation fraud prevention managed rule group <code>AWSManagedRulesACFPRuleSet</code>. This is only populated if you are using a rule group in your web ACL that integrates with your applications in this way. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-application-integration.html">WAF client application integration</a>
9814-
* in the <i>WAF Developer Guide</i>.</p>
9815-
* @public
9816-
*/
9817-
ApplicationIntegrationURL?: string | undefined;
9818-
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// smithy-typescript generated code
2+
import { WebACL } from "./models_0";
3+
4+
/**
5+
* @public
6+
*/
7+
export interface GetWebACLResponse {
8+
/**
9+
* <p>The web ACL specification. You can modify the settings in this web ACL and use it to
10+
* update this web ACL or create a new one.</p>
11+
* @public
12+
*/
13+
WebACL?: WebACL | undefined;
14+
15+
/**
16+
* <p>A token used for optimistic locking. WAF returns a token to your <code>get</code> and <code>list</code> requests, to mark the state of the entity at the time of the request. To make changes to the entity associated with the token, you provide the token to operations like <code>update</code> and <code>delete</code>. WAF uses the token to ensure that no changes have been made to the entity since you last retrieved it. If a change has been made, the update fails with a <code>WAFOptimisticLockException</code>. If this happens, perform another <code>get</code>, and use the new token returned by that operation. </p>
17+
* @public
18+
*/
19+
LockToken?: string | undefined;
20+
21+
/**
22+
* <p>The URL to use in SDK integrations with Amazon Web Services managed rule groups. For example, you can use the integration SDKs with the account takeover prevention managed rule group <code>AWSManagedRulesATPRuleSet</code> and the account creation fraud prevention managed rule group <code>AWSManagedRulesACFPRuleSet</code>. This is only populated if you are using a rule group in your web ACL that integrates with your applications in this way. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-application-integration.html">WAF client application integration</a>
23+
* in the <i>WAF Developer Guide</i>.</p>
24+
* @public
25+
*/
26+
ApplicationIntegrationURL?: string | undefined;
27+
}

clients/client-wafv2/src/schemas/schemas_0.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,11 @@ const _DAPIK = "DeleteAPIKey";
103103
const _DAPIKR = "DeleteAPIKeyRequest";
104104
const _DAPIKRe = "DeleteAPIKeyResponse";
105105
const _DB = "DefaultBehavior";
106+
const _DF = "DisallowedFeature";
106107
const _DFMRG = "DeleteFirewallManagerRuleGroups";
107108
const _DFMRGR = "DeleteFirewallManagerRuleGroupsRequest";
108109
const _DFMRGRe = "DeleteFirewallManagerRuleGroupsResponse";
110+
const _DFi = "DisallowedFeatures";
109111
const _DIPS = "DeleteIPSet";
110112
const _DIPSR = "DeleteIPSetRequest";
111113
const _DIPSRe = "DeleteIPSetResponse";
@@ -167,6 +169,7 @@ const _FT = "FieldType";
167169
const _FTM = "FieldToMatch";
168170
const _FTP = "FieldToProtect";
169171
const _FV = "FailureValues";
172+
const _Fe = "Feature";
170173
const _Fi = "Filter";
171174
const _Fil = "Filters";
172175
const _GDAPIK = "GetDecryptedAPIKey";
@@ -421,6 +424,7 @@ const _RN = "RuleName";
421424
const _RNWRG = "RuleNameWithinRuleGroup";
422425
const _RNe = "ReleaseNotes";
423426
const _RPP = "RegistrationPagePath";
427+
const _RPPe = "RequiredPricingPlan";
424428
const _RPS = "RegexPatternSet";
425429
const _RPSRS = "RegexPatternSetReferenceStatement";
426430
const _RPSS = "RegexPatternSetSummary";
@@ -528,6 +532,7 @@ const _WAFAIE = "WAFAssociatedItemException";
528532
const _WAFCWE = "WAFConfigurationWarningException";
529533
const _WAFDIE = "WAFDuplicateItemException";
530534
const _WAFEMRGVE = "WAFExpiredManagedRuleGroupVersionException";
535+
const _WAFFNIIPPE = "WAFFeatureNotIncludedInPricingPlanException";
531536
const _WAFIEE = "WAFInternalErrorException";
532537
const _WAFIOE = "WAFInvalidOperationException";
533538
const _WAFIPE = "WAFInvalidParameterException";
@@ -566,6 +571,7 @@ import {
566571
WAFConfigurationWarningException as __WAFConfigurationWarningException,
567572
WAFDuplicateItemException as __WAFDuplicateItemException,
568573
WAFExpiredManagedRuleGroupVersionException as __WAFExpiredManagedRuleGroupVersionException,
574+
WAFFeatureNotIncludedInPricingPlanException as __WAFFeatureNotIncludedInPricingPlanException,
569575
WAFInternalErrorException as __WAFInternalErrorException,
570576
WAFInvalidOperationException as __WAFInvalidOperationException,
571577
WAFInvalidParameterException as __WAFInvalidParameterException,
@@ -794,6 +800,7 @@ export var DescribeManagedRuleGroupResponse: StaticStructureSchema = [
794800
[_VNe, _STA, _C, _R, _LN, _ALv, _CL],
795801
[0, 0, 1, () => RuleSummaries, 0, () => LabelSummaries, () => LabelSummaries],
796802
];
803+
export var DisallowedFeature: StaticStructureSchema = [3, n0, _DF, 0, [_Fe, _RPPe], [0, 0]];
797804
export var DisassociateWebACLRequest: StaticStructureSchema = [3, n0, _DWACLRi, 0, [_RA], [0]];
798805
export var DisassociateWebACLResponse: StaticStructureSchema = [3, n0, _DWACLRis, 0, [], []];
799806
export var EmailField: StaticStructureSchema = [3, n0, _EF, 0, [_I], [0]];
@@ -1524,6 +1531,21 @@ TypeRegistry.for(n0).registerError(
15241531
__WAFExpiredManagedRuleGroupVersionException
15251532
);
15261533

1534+
export var WAFFeatureNotIncludedInPricingPlanException: StaticErrorSchema = [
1535+
-3,
1536+
n0,
1537+
_WAFFNIIPPE,
1538+
{
1539+
[_e]: _c,
1540+
},
1541+
[_Me, _DFi],
1542+
[0, () => DisallowedFeatures],
1543+
];
1544+
TypeRegistry.for(n0).registerError(
1545+
WAFFeatureNotIncludedInPricingPlanException,
1546+
__WAFFeatureNotIncludedInPricingPlanException
1547+
);
1548+
15271549
export var WAFInternalErrorException: StaticErrorSchema = [
15281550
-3,
15291551
n0,
@@ -1789,6 +1811,7 @@ export var CountryCodes = 64 | 0;
17891811

17901812
export var CustomHTTPHeaders: StaticListSchema = [1, n0, _CHTTPHu, 0, () => CustomHTTPHeader];
17911813
export var DataProtections: StaticListSchema = [1, n0, _DPa, 0, () => DataProtection];
1814+
export var DisallowedFeatures: StaticListSchema = [1, n0, _DFi, 0, () => DisallowedFeature];
17921815
export var ExcludedRules: StaticListSchema = [1, n0, _ERx, 0, () => ExcludedRule];
17931816
export var FieldToProtectKeys = 64 | 0;
17941817

codegen/sdk-codegen/aws-models/wafv2.json

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1806,6 +1806,9 @@
18061806
"target": "com.amazonaws.wafv2#AssociateWebACLResponse"
18071807
},
18081808
"errors": [
1809+
{
1810+
"target": "com.amazonaws.wafv2#WAFFeatureNotIncludedInPricingPlanException"
1811+
},
18091812
{
18101813
"target": "com.amazonaws.wafv2#WAFInternalErrorException"
18111814
},
@@ -5520,6 +5523,37 @@
55205523
"smithy.api#output": {}
55215524
}
55225525
},
5526+
"com.amazonaws.wafv2#DisallowedFeature": {
5527+
"type": "structure",
5528+
"members": {
5529+
"Feature": {
5530+
"target": "com.amazonaws.wafv2#PricingPlanFeatureName",
5531+
"traits": {
5532+
"smithy.api#documentation": "<p>The name of the disallowed WAF feature.</p>"
5533+
}
5534+
},
5535+
"RequiredPricingPlan": {
5536+
"target": "com.amazonaws.wafv2#RequiredPricingPlanName",
5537+
"traits": {
5538+
"smithy.api#documentation": "<p>The name of the CloudFront pricing plan required to use the WAF feature.</p>"
5539+
}
5540+
}
5541+
},
5542+
"traits": {
5543+
"smithy.api#documentation": "<p>A WAF feature that is not supported by the CloudFront pricing plan associated with the web ACL.</p>"
5544+
}
5545+
},
5546+
"com.amazonaws.wafv2#DisallowedFeatures": {
5547+
"type": "list",
5548+
"member": {
5549+
"target": "com.amazonaws.wafv2#DisallowedFeature"
5550+
},
5551+
"traits": {
5552+
"smithy.api#length": {
5553+
"min": 1
5554+
}
5555+
}
5556+
},
55235557
"com.amazonaws.wafv2#DisassociateWebACL": {
55245558
"type": "operation",
55255559
"input": {
@@ -9934,6 +9968,16 @@
99349968
}
99359969
}
99369970
},
9971+
"com.amazonaws.wafv2#PricingPlanFeatureName": {
9972+
"type": "string",
9973+
"traits": {
9974+
"smithy.api#length": {
9975+
"min": 1,
9976+
"max": 128
9977+
},
9978+
"smithy.api#pattern": "^[\\w\\-]+$"
9979+
}
9980+
},
99379981
"com.amazonaws.wafv2#ProductDescription": {
99389982
"type": "string",
99399983
"traits": {
@@ -9990,6 +10034,9 @@
999010034
"target": "com.amazonaws.wafv2#PutLoggingConfigurationResponse"
999110035
},
999210036
"errors": [
10037+
{
10038+
"target": "com.amazonaws.wafv2#WAFFeatureNotIncludedInPricingPlanException"
10039+
},
999310040
{
999410041
"target": "com.amazonaws.wafv2#WAFInternalErrorException"
999510042
},
@@ -10886,6 +10933,16 @@
1088610933
"smithy.api#documentation": "<p>The criteria for inspecting account creation requests, used by the ACFP rule group to validate and track account creation attempts. </p>\n <p>This is part of the <code>AWSManagedRulesACFPRuleSet</code> configuration in <code>ManagedRuleGroupConfig</code>.</p>\n <p>In these settings, you specify how your application accepts account creation attempts\n by providing the request payload type and the names of the fields \n within the request body where the username, password, email, and primary address and phone number fields are provided. </p>"
1088710934
}
1088810935
},
10936+
"com.amazonaws.wafv2#RequiredPricingPlanName": {
10937+
"type": "string",
10938+
"traits": {
10939+
"smithy.api#length": {
10940+
"min": 1,
10941+
"max": 64
10942+
},
10943+
"smithy.api#pattern": "^[\\w\\-]+$"
10944+
}
10945+
},
1088910946
"com.amazonaws.wafv2#ResourceArn": {
1089010947
"type": "string",
1089110948
"traits": {
@@ -12881,6 +12938,9 @@
1288112938
{
1288212939
"target": "com.amazonaws.wafv2#WAFExpiredManagedRuleGroupVersionException"
1288312940
},
12941+
{
12942+
"target": "com.amazonaws.wafv2#WAFFeatureNotIncludedInPricingPlanException"
12943+
},
1288412944
{
1288512945
"target": "com.amazonaws.wafv2#WAFInternalErrorException"
1288612946
},
@@ -13218,6 +13278,24 @@
1321813278
"smithy.api#error": "client"
1321913279
}
1322013280
},
13281+
"com.amazonaws.wafv2#WAFFeatureNotIncludedInPricingPlanException": {
13282+
"type": "structure",
13283+
"members": {
13284+
"Message": {
13285+
"target": "com.amazonaws.wafv2#ErrorMessage"
13286+
},
13287+
"DisallowedFeatures": {
13288+
"target": "com.amazonaws.wafv2#DisallowedFeatures",
13289+
"traits": {
13290+
"smithy.api#documentation": "<p>The names of the disallowed WAF features.</p>"
13291+
}
13292+
}
13293+
},
13294+
"traits": {
13295+
"smithy.api#documentation": "<p>The operation failed because the specified WAF feature isn't supported by the CloudFront pricing plan associated with the web ACL.</p>",
13296+
"smithy.api#error": "client"
13297+
}
13298+
},
1322113299
"com.amazonaws.wafv2#WAFInternalErrorException": {
1322213300
"type": "structure",
1322313301
"members": {

0 commit comments

Comments
 (0)