PaymentCryptographyControlPlane / Client / put_resource_policy

put_resource_policy

PaymentCryptographyControlPlane.Client.put_resource_policy(**kwargs)

Attaches or replaces a resource-based policy on an Amazon Web Services Payment Cryptography key. A resource-based policy can grant cross-account access to your key.

If the policy would grant public access, the request fails with a PublicPolicyException.

To remove a resource-based policy from a key, use DeleteResourcePolicy.

Cross-account use: This operation can’t be used across different Amazon Web Services accounts.

Related operations:

See also: AWS API Documentation

Request Syntax

response = client.put_resource_policy(
    ResourceArn='string',
    Policy='string'
)
Parameters:
  • ResourceArn (string) –

    [REQUIRED]

    The KeyARN of the key to attach the resource-based policy to.

  • Policy (string) –

    [REQUIRED]

    The resource-based policy to attach to the key, in JSON format.

Return type:

dict

Returns:

Response Syntax

{
    'ResourceArn': 'string',
    'Policy': 'string'
}

Response Structure

  • (dict) –

    • ResourceArn (string) –

      The KeyARN of the key that the resource-based policy was attached to.

    • Policy (string) –

      The resource-based policy that was attached to the key.

Exceptions

  • PaymentCryptographyControlPlane.Client.exceptions.ServiceQuotaExceededException

  • PaymentCryptographyControlPlane.Client.exceptions.ServiceUnavailableException

  • PaymentCryptographyControlPlane.Client.exceptions.ValidationException

  • PaymentCryptographyControlPlane.Client.exceptions.ConflictException

  • PaymentCryptographyControlPlane.Client.exceptions.AccessDeniedException

  • PaymentCryptographyControlPlane.Client.exceptions.ResourceNotFoundException

  • PaymentCryptographyControlPlane.Client.exceptions.ThrottlingException

  • PaymentCryptographyControlPlane.Client.exceptions.InternalServerException

  • PaymentCryptographyControlPlane.Client.exceptions.PublicPolicyException