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
KeyARNof 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
KeyARNof 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.ServiceQuotaExceededExceptionPaymentCryptographyControlPlane.Client.exceptions.ServiceUnavailableExceptionPaymentCryptographyControlPlane.Client.exceptions.ValidationExceptionPaymentCryptographyControlPlane.Client.exceptions.ConflictExceptionPaymentCryptographyControlPlane.Client.exceptions.AccessDeniedExceptionPaymentCryptographyControlPlane.Client.exceptions.ResourceNotFoundExceptionPaymentCryptographyControlPlane.Client.exceptions.ThrottlingExceptionPaymentCryptographyControlPlane.Client.exceptions.InternalServerExceptionPaymentCryptographyControlPlane.Client.exceptions.PublicPolicyException