associate_web_acl
async
¶
associate_web_acl(
web_acl_id: ResourceId,
resource_arn: ResourceArn,
*,
config_overrides: Optional[AsyncWAFRegionalClientConfig] = None,
) -> AssociateWebACLResponse
This is AWS WAF Classic Regional documentation. For more information, see AWS WAF Classic in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API and see the AWS WAF Developer Guide. With the latest version, AWS WAF has a single set of endpoints for regional and global use.
Associates a web ACL with a resource, either an application load balancer or Amazon API Gateway stage.
Parameters:
-
web_acl_id(ResourceId) –A unique identifier (ID) for the web ACL.
-
resource_arn(ResourceArn) –The ARN (Amazon Resource Name) of the resource to be protected, either an application load balancer or Amazon API Gateway stage.
The ARN should be in one of the following formats:
-
For an Application Load Balancer:
arn:aws:elasticloadbalancing:region:account-id:loadbalancer/app/load-balancer-name/load-balancer-id -
For an Amazon API Gateway stage:
arn:aws:apigateway:region::/restapis/api-id/stages/stage-name
-
Raises:
-
WAFInternalErrorException–The operation failed because of a system problem, even though the request was valid. Retry your request.
-
WAFInvalidAccountException–The operation failed because you tried to create, update, or delete an object by using an invalid account identifier.
-
WAFInvalidParameterException–The operation failed because AWS WAF didn't recognize a parameter in the request. For example:
-
You specified an invalid parameter name.
-
You specified an invalid value.
-
You tried to update an object (
ByteMatchSet,IPSet,Rule, orWebACL) using an action other thanINSERTorDELETE. -
You tried to create a
WebACLwith aDefaultActionTypeother thanALLOW,BLOCK, orCOUNT. -
You tried to create a
RateBasedRulewith aRateKeyvalue other thanIP. -
You tried to update a
WebACLwith aWafActionTypeother thanALLOW,BLOCK, orCOUNT. -
You tried to update a
ByteMatchSetwith aFieldToMatchTypeother than HEADER, METHOD, QUERY_STRING, URI, or BODY. -
You tried to update a
ByteMatchSetwith aFieldofHEADERbut no value forData. -
Your request references an ARN that is malformed, or corresponds to a resource with which a web ACL cannot be associated.
-
-
WAFNonexistentItemException–The operation failed because the referenced object doesn't exist.
-
WAFUnavailableEntityException–The operation failed because the entity referenced is temporarily unavailable. Retry your request.
-
UnknownServiceError–The service returned an error code this client does not model.