Skip to content

get_permission_policy async

get_permission_policy(
    resource_arn: ResourceArn,
    *,
    config_overrides: Optional[AsyncWAFV2ClientConfig] = None,
) -> GetPermissionPolicyResponse

Returns the IAM policy that is attached to the specified rule group.

You must be the owner of the rule group to perform this operation.

Parameters:

  • resource_arn (ResourceArn) –

    The Amazon Resource Name (ARN) of the rule group for which you want to get the policy.

Raises:

  • WAFInternalErrorException –

    Your request is valid, but WAF couldn’t perform the operation because of a system problem. Retry your request.

  • 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 get_permission_policy(
    self,
    resource_arn: "capo_wafv2.types.resource_arn.ResourceArn",
    *,
    config_overrides: Optional[AsyncWAFV2ClientConfig] = None,
) -> "capo_wafv2.types.get_permission_policy_response.GetPermissionPolicyResponse":
    """<p>Returns the IAM policy that is attached to the specified rule group.</p> <p>You must be the owner of the rule group to perform this operation.</p>

    Args:
        resource_arn: <p>The Amazon Resource Name (ARN) of the rule group for which you want to get the policy.</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_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.get_permission_policy_request.GetPermissionPolicyRequest]",
    ) -> AsyncOperationResponse[
        "capo_wafv2.types.get_permission_policy_response.GetPermissionPolicyResponse"
    ]:
        import capo_wafv2._operations.awswaf_20190729.get_permission_policy

        (
            output,
            http_response,
        ) = await capo_wafv2._operations.awswaf_20190729.get_permission_policy.async_get_permission_policy(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetPermissionPolicy")
    )
    input_: capo_wafv2.types.get_permission_policy_request.GetPermissionPolicyRequest = {
        "resource_arn": resource_arn
    }

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output