@Override
    public PutPermissionPolicyResult putPermissionPolicy(PutPermissionPolicyRequest request) {
        request = beforeClientExecution(request);
        return executePutPermissionPolicy(request);
    }
<note>
<p>
This is <b>AWS WAF Classic</b> documentation. For more information, see <a
href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS WAF Classic</a> in the
developer guide.
</p>
<p>
<b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a
href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS WAF Developer Guide</a>. With
the latest version, AWS WAF has a single set of endpoints for regional and global use.
</p>
</note>
<p>
Attaches an IAM policy to the specified resource. The only supported use for this action is to share a RuleGroup
across accounts.
</p>
<p>
The <code>PutPermissionPolicy</code> is subject to the following restrictions:
</p>
<ul>
<li>
<p>
You can attach only one policy with each <code>PutPermissionPolicy</code> request.
</p>
</li>
<li>
<p>
The policy must include an <code>Effect</code>, <code>Action</code> and <code>Principal</code>.
</p>
</li>
<li>
<p>
<code>Effect</code> must specify <code>Allow</code>.
</p>
</li>
<li>
<p>
The <code>Action</code> in the policy must be <code>waf:UpdateWebACL</code>,
<code>waf-regional:UpdateWebACL</code>, <code>waf:GetRuleGroup</code> and <code>waf-regional:GetRuleGroup</code>
. Any extra or wildcard actions in the policy will be rejected.
</p>
</li>
<li>
<p>
The policy cannot include a <code>Resource</code> parameter.
</p>
</li>
<li>
<p>
The ARN in the request must be a valid WAF RuleGroup ARN and the RuleGroup must exist in the same region.
</p>
</li>
<li>
<p>
The user making the request must be the owner of the RuleGroup.
</p>
</li>
<li>
<p>
Your policy must be composed using IAM Policy version 2012-10-17.
</p>
</li>
</ul>
<p>
For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html">IAM
Policies</a>.
</p>
<p>
An example of a valid policy parameter is shown in the Examples section below.
</p>

@param putPermissionPolicyRequest
@return Result of the PutPermissionPolicy operation returned by the service.
@throws WAFInternalErrorException
        The operation failed because of a system problem, even though the request was valid. Retry your request.
@throws WAFStaleDataException
        The operation failed because you tried to create, update, or delete an object by using a change token
        that has already been used.
@throws WAFNonexistentItemException
        The operation failed because the referenced object doesn't exist.
@throws WAFInvalidPermissionPolicyException
        The operation failed because the specified policy is not in the proper format. </p>
        <p>
        The policy is subject to the following restrictions:
        </p>
        <ul>
        <li>
        <p>
        You can attach only one policy with each <code>PutPermissionPolicy</code> request.
        </p>
        </li>
        <li>
        <p>
        The policy must include an <code>Effect</code>, <code>Action</code> and <code>Principal</code>.
        </p>
        </li>
        <li>
        <p>
        <code>Effect</code> must specify <code>Allow</code>.
        </p>
        </li>
        <li>
        <p>
        The <code>Action</code> in the policy must be <code>waf:UpdateWebACL</code>,
        <code>waf-regional:UpdateWebACL</code>, <code>waf:GetRuleGroup</code> and
        <code>waf-regional:GetRuleGroup</code> . Any extra or wildcard actions in the policy will be rejected.
        </p>
        </li>
        <li>
        <p>
        The policy cannot include a <code>Resource</code> parameter.
        </p>
        </li>
        <li>
        <p>
        The ARN in the request must be a valid WAF RuleGroup ARN and the RuleGroup must exist in the same region.
        </p>
        </li>
        <li>
        <p>
        The user making the request must be the owner of the RuleGroup.
        </p>
        </li>
        <li>
        <p>
        Your policy must be composed using IAM Policy version 2012-10-17.
        </p>
        </li>
@sample AWSWAFRegional.PutPermissionPolicy
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/waf-regional-2016-11-28/PutPermissionPolicy"
     target="_top">AWS API Documentation</a>
aws-java-sdk-waf/src/main/java/com/amazonaws/services/waf/AWSWAFRegionalClient.java