Smaws_Client_CloudHSMV2.PutResourcePolicyCreates or updates an CloudHSM resource policy. A resource policy helps you to define the IAM entity (for example, an Amazon Web Services account) that can manage your CloudHSM resources. The following resources support CloudHSM resource policies:
In order to share a backup, it must be in a 'READY' state and you must own it.
While you can share a backup using the CloudHSM PutResourcePolicy operation, we recommend using Resource Access Manager (RAM) instead. Using RAM provides multiple benefits as it creates the policy for you, allows multiple resources to be shared at one time, and increases the discoverability of shared resources. If you use PutResourcePolicy and want consumers to be able to describe the backups you share with them, you must promote the backup to a standard RAM Resource Share using the RAM PromoteResourceShareCreatedFromPolicy API operation. For more information, see Working with shared backups in the CloudHSM User Guide
Cross-account use: No. You cannot perform this operation on an CloudHSM resource in a different Amazon Web Services account.
val error_to_string :
[ Smaws_Lib.Protocols.AwsJson.error
| `CloudHsmAccessDeniedException of Types.cloud_hsm_access_denied_exception
| `CloudHsmInternalFailureException of
Types.cloud_hsm_internal_failure_exception
| `CloudHsmInvalidRequestException of
Types.cloud_hsm_invalid_request_exception
| `CloudHsmResourceNotFoundException of
Types.cloud_hsm_resource_not_found_exception
| `CloudHsmServiceException of Types.cloud_hsm_service_exception ] ->
stringval request :
'http_type Smaws_Lib.Context.t ->
Types.put_resource_policy_request ->
(Types.put_resource_policy_response,
[> Smaws_Lib.Protocols.AwsJson.error
| `CloudHsmAccessDeniedException of Types.cloud_hsm_access_denied_exception
| `CloudHsmInternalFailureException of
Types.cloud_hsm_internal_failure_exception
| `CloudHsmInvalidRequestException of
Types.cloud_hsm_invalid_request_exception
| `CloudHsmResourceNotFoundException of
Types.cloud_hsm_resource_not_found_exception
| `CloudHsmServiceException of Types.cloud_hsm_service_exception ])
Stdlib.resultval request_with_metadata :
'http_type Smaws_Lib.Context.t ->
Types.put_resource_policy_request ->
(Types.put_resource_policy_response Smaws_Lib.Response.t,
[> Smaws_Lib.Protocols.AwsJson.error
| `CloudHsmAccessDeniedException of Types.cloud_hsm_access_denied_exception
| `CloudHsmInternalFailureException of
Types.cloud_hsm_internal_failure_exception
| `CloudHsmInvalidRequestException of
Types.cloud_hsm_invalid_request_exception
| `CloudHsmResourceNotFoundException of
Types.cloud_hsm_resource_not_found_exception
| `CloudHsmServiceException of Types.cloud_hsm_service_exception ]
* Smaws_Lib.Response.metadata)
Stdlib.result