1import type * as cloudhsm from "@distilled.cloud/aws/cloudhsm-v2";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4
5/**
6 * Runtime binding for the `PutResourcePolicy` operation (IAM action
7 * `cloudhsm:PutResourcePolicy`).
8 *
9 * Creates or replaces the resource policy on a CloudHSM backup, sharing a
10 * `READY` backup you own with other accounts (AWS recommends RAM for
11 * discoverable multi-resource shares; this is the direct API). Provide the
12 * implementation with `Effect.provide(AWS.CloudHSMV2.PutResourcePolicyHttp)`.
13 * ### Sharing Backups
14 * **Example:** Share A Backup With Another Account
15 * ```typescript
16 * const putResourcePolicy = yield* AWS.CloudHSMV2.PutResourcePolicy();
17 *
18 * yield* putResourcePolicy({
19 * ResourceArn: backupArn,
20 * Policy: JSON.stringify({
21 * Version: "2012-10-17",
22 * Statement: [{
23 * Effect: "Allow",
24 * Principal: { AWS: "arn:aws:iam::123456789012:root" },
25 * Action: ["cloudhsm:DescribeBackups"],
26 * Resource: backupArn,
27 * }],
28 * }),
29 * });
30 * ```
31 *
32 * @binding
33 */
34export interface PutResourcePolicy extends Binding.Service<
35 PutResourcePolicy,
36 "AWS.CloudHSMV2.PutResourcePolicy",
37 () => Effect.Effect<
38 (
39 request: cloudhsm.PutResourcePolicyRequest,
40 ) => Effect.Effect<
41 cloudhsm.PutResourcePolicyResponse,
42 cloudhsm.PutResourcePolicyError
43 >
44 >
45> {}
46export const PutResourcePolicy = Binding.Service<PutResourcePolicy>(
47 "AWS.CloudHSMV2.PutResourcePolicy",
48);