put_resource_policy
¶
put_resource_policy(
*,
config_overrides: Optional[CloudHSMV2ClientConfig] = None,
resource_arn: Optional[CloudHsmArn] = None,
policy: Optional[ResourcePolicy] = None,
) -> PutResourcePolicyResponse
Creates 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:
-
Backup - The resource policy allows you to describe the backup and restore a cluster from the backup in another Amazon Web Services account.
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.
Parameters:
-
resource_arn(Optional[CloudHsmArn], default:None) –Amazon Resource Name (ARN) of the resource to which you want to attach a policy.
-
policy(Optional[ResourcePolicy], default:None) –The policy you want to associate with a resource.
For an example policy, see Working with shared backups in the CloudHSM User Guide
Raises:
-
CloudHsmAccessDeniedException–The request was rejected because the requester does not have permission to perform the requested operation.
-
CloudHsmInternalFailureException–The request was rejected because of an CloudHSM internal failure. The request can be retried.
-
CloudHsmInvalidRequestException–The request was rejected because it is not a valid request.
-
CloudHsmResourceNotFoundException–The request was rejected because it refers to a resource that cannot be found.
-
CloudHsmServiceException–The request was rejected because an error occurred.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_cloudhsm_v2/_services/cloud_hsmv2.py
1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 | |