AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Updates the specified WebACL. While updating a web ACL, WAF provides continuous coverage to the resources that you have associated with the web ACL.

This operation completely replaces the mutable specifications that you already have for the web ACL with the ones that you provide to this call.

To modify a web ACL, do the following:

  1. Retrieve it by calling GetWebACL

  2. Update its settings as needed

  3. Provide the complete web ACL specification to this call

A web ACL defines a collection of rules to use to inspect and control web requests. Each rule has a statement that defines what to look for in web requests and an action that WAF applies to requests that match the statement. In the web ACL, you assign a default action to take (allow, block) for any request that does not match any of the rules. The rules in a web ACL can be a combination of the types Rule, RuleGroup, and managed rule group. You can associate a web ACL with one or more Amazon Web Services resources to protect. The resources can be an Amazon CloudFront distribution, an Amazon API Gateway REST API, an Application Load Balancer, an AppSync GraphQL API, an Amazon Cognito user pool, an App Runner service, or an Amazon Web Services Verified Access instance.

Temporary inconsistencies during updates

When you create or change a web ACL or other WAF resources, the changes take a small amount of time to propagate to all areas where the resources are stored. The propagation time can be from a few seconds to a number of minutes.

The following are examples of the temporary inconsistencies that you might notice during change propagation:

Note:

This is an asynchronous operation using the standard naming convention for .NET 4.5 or higher. For .NET 3.5 the operation is implemented as a pair of methods using the standard naming convention of BeginUpdateWebACL and EndUpdateWebACL.

Namespace: Amazon.WAFV2
Assembly: AWSSDK.WAFV2.dll
Version: 3.x.y.z

Syntax

C#
public virtual Task<UpdateWebACLResponse> UpdateWebACLAsync(
         UpdateWebACLRequest request,
         CancellationToken cancellationToken
)

Parameters

request
Type: Amazon.WAFV2.Model.UpdateWebACLRequest

Container for the necessary parameters to execute the UpdateWebACL service method.

cancellationToken
Type: System.Threading.CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Return Value


The response from the UpdateWebACL service method, as returned by WAFV2.

Exceptions

ExceptionCondition
WAFConfigurationWarningException The operation failed because you are inspecting the web request body, headers, or cookies without specifying how to handle oversize components. Rules that inspect the body must either provide an OversizeHandling configuration or they must be preceded by a SizeConstraintStatement that blocks the body content from being too large. Rules that inspect the headers or cookies must provide an OversizeHandling configuration. Provide the handling configuration and retry your operation. Alternately, you can suppress this warning by adding the following tag to the resource that you provide to this operation: Tag (key:WAF:OversizeFieldsHandlingConstraintOptOut, value:true).
WAFDuplicateItemException WAF couldn’t perform the operation because the resource that you tried to save is a duplicate of an existing one.
WAFExpiredManagedRuleGroupVersionException The operation failed because the specified version for the managed rule group has expired. You can retrieve the available versions for the managed rule group by calling ListAvailableManagedRuleGroupVersions.
WAFInternalErrorException Your request is valid, but WAF couldn’t perform the operation because of a system problem. Retry your request.
WAFInvalidOperationException The operation isn't valid.
WAFInvalidParameterException The operation failed because WAF didn't recognize a parameter in the request. For example: You specified a parameter name or value that isn't valid. Your nested statement isn't valid. You might have tried to nest a statement that can’t be nested. You tried to update a WebACL with a DefaultAction that isn't among the types available at DefaultAction. Your request references an ARN that is malformed, or corresponds to a resource with which a web ACL can't be associated.
WAFInvalidResourceException WAF couldn’t perform the operation because the resource that you requested isn’t valid. Check the resource, and try again.
WAFLimitsExceededException WAF couldn’t perform the operation because you exceeded your resource limit. For example, the maximum number of WebACL objects that you can create for an Amazon Web Services account. For more information, see WAF quotas in the WAF Developer Guide.
WAFNonexistentItemException WAF couldn’t perform the operation because your resource doesn't exist. If you've just created a resource that you're using in this operation, you might just need to wait a few minutes. It can take from a few seconds to a number of minutes for changes to propagate.
WAFOptimisticLockException WAF couldn’t save your changes because you tried to update or delete a resource that has changed since you last retrieved it. Get the resource again, make any changes you need to make to the new copy, and retry your operation.
WAFSubscriptionNotFoundException You tried to use a managed rule group that's available by subscription, but you aren't subscribed to it yet.
WAFUnavailableEntityException WAF couldn’t retrieve a resource that you specified for this operation. If you've just created a resource that you're using in this operation, you might just need to wait a few minutes. It can take from a few seconds to a number of minutes for changes to propagate. Verify the resources that you are specifying in your request parameters and then retry the operation.

Version Information

.NET:
Supported in: 8.0 and newer, Core 3.1

.NET Standard:
Supported in: 2.0

.NET Framework:
Supported in: 4.5 and newer

See Also