Retrieves an array of the Amazon Resource Names (ARNs) for the resources that are associated with the specified web ACL.
For Amazon CloudFront, don't use this call. Instead, use the CloudFront call ListDistributionsByWebACLId. For information, see ListDistributionsByWebACLId in the Amazon CloudFront API Reference.
Required permissions for customer-managed IAM policies
This call requires permissions that are specific to the protected resource type. For details, see Permissions for ListResourcesForWebACL in the WAF Developer Guide.
Parameters:
-
web_acl_arn
(ResourceArn)
–
The Amazon Resource Name (ARN) of the web ACL.
-
resource_type
(Optional[ResourceType], default:
None
)
–
Retrieves the web ACLs that are used by the specified resource type.
For Amazon CloudFront, don't use this call. Instead, use the CloudFront call ListDistributionsByWebACLId. For information, see ListDistributionsByWebACLId in the Amazon CloudFront API Reference.
If you don't provide a resource type, the call uses the resource type APPLICATION_LOAD_BALANCER.
Default: APPLICATION_LOAD_BALANCER
Raises:
-
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.
-
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.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_wafv2/_services/async_wafv2.py
| async def list_resources_for_web_acl(
self,
web_acl_arn: "capo_wafv2.types.resource_arn.ResourceArn",
*,
config_overrides: Optional[AsyncWAFV2ClientConfig] = None,
resource_type: Optional["capo_wafv2.types.resource_type.ResourceType"] = None,
) -> "capo_wafv2.types.list_resources_for_web_acl_response.ListResourcesForWebACLResponse":
"""<p>Retrieves an array of the Amazon Resource Names (ARNs) for the resources that are associated with the specified web ACL. </p> <p>For Amazon CloudFront, don't use this call. Instead, use the CloudFront call <code>ListDistributionsByWebACLId</code>. For information, see <a href="https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_ListDistributionsByWebACLId.html">ListDistributionsByWebACLId</a> in the <i>Amazon CloudFront API Reference</i>. </p> <p> <b>Required permissions for customer-managed IAM policies</b> </p> <p>This call requires permissions that are specific to the protected resource type. For details, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/security_iam_service-with-iam.html#security_iam_action-ListResourcesForWebACL">Permissions for ListResourcesForWebACL</a> in the <i>WAF Developer Guide</i>.</p>
Args:
web_acl_arn: <p>The Amazon Resource Name (ARN) of the web ACL.</p>
resource_type: <p>Retrieves the web ACLs that are used by the specified resource type. </p> <p>For Amazon CloudFront, don't use this call. Instead, use the CloudFront call <code>ListDistributionsByWebACLId</code>. For information, see <a href="https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_ListDistributionsByWebACLId.html">ListDistributionsByWebACLId</a> in the <i>Amazon CloudFront API Reference</i>. </p> <note> <p>If you don't provide a resource type, the call uses the resource type <code>APPLICATION_LOAD_BALANCER</code>. </p> </note> <p>Default: <code>APPLICATION_LOAD_BALANCER</code> </p>
Raises:
capo_wafv2.errors.waf_internal_error_exception.WAFInternalErrorException: <p>Your request is valid, but WAF couldn’t perform the operation because of a system problem. Retry your request. </p>
capo_wafv2.errors.waf_invalid_operation_exception.WAFInvalidOperationException: <p>The operation isn't valid. </p>
capo_wafv2.errors.waf_invalid_parameter_exception.WAFInvalidParameterException: <p>The operation failed because WAF didn't recognize a parameter in the request. For example: </p> <ul> <li> <p>You specified a parameter name or value that isn't valid.</p> </li> <li> <p>Your nested statement isn't valid. You might have tried to nest a statement that can’t be nested. </p> </li> <li> <p>You tried to update a <code>WebACL</code> with a <code>DefaultAction</code> that isn't among the types available at <a>DefaultAction</a>.</p> </li> <li> <p>Your request references an ARN that is malformed, or corresponds to a resource with which a web ACL can't be associated.</p> </li> </ul>
capo_wafv2.errors.waf_nonexistent_item_exception.WAFNonexistentItemException: <p>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. </p>
capo_wafv2.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_wafv2.types.list_resources_for_web_acl_request.ListResourcesForWebACLRequest]",
) -> AsyncOperationResponse[
"capo_wafv2.types.list_resources_for_web_acl_response.ListResourcesForWebACLResponse"
]:
import capo_wafv2._operations.awswaf_20190729.list_resources_for_web_acl
(
output,
http_response,
) = await capo_wafv2._operations.awswaf_20190729.list_resources_for_web_acl.async_list_resources_for_web_acl(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("ListResourcesForWebACL")
)
input_: capo_wafv2.types.list_resources_for_web_acl_request.ListResourcesForWebACLRequest = {
"web_acl_arn": web_acl_arn
}
if resource_type is not None:
input_["resource_type"] = resource_type
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|