The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 06:00 UTC
| 1 | import * as sns from "@distilled.cloud/aws/sns"; |
| 2 | import * as Binding from "alchemy/Binding"; |
| 3 | import * as Effect from "effect/Effect"; |
| 4 | import type { Topic } from "./Topic.ts"; |
| 5 | |
| 6 | export interface AddPermissionRequest extends Omit<sns.AddPermissionInput, "TopicArn"> {} |
| 7 | |
| 8 | /** |
| 9 | * Runtime binding for `sns:AddPermission`. |
| 10 | * |
| 11 | * Bind this operation to a {@link Topic} inside a function runtime to grant |
| 12 | * other AWS accounts access to topic actions by adding a labeled statement |
| 13 | * to the topic's access policy. The binding grants the host function |
| 14 | * `sns:AddPermission` on the topic. Provide the `AddPermissionHttp` layer on |
| 15 | * the Function to implement the binding. |
| 16 | * ### Managing Topic Permissions |
| 17 | * **Example:** Allow Another Account to Publish |
| 18 | * ```typescript |
| 19 | * // init (provide SNS.AddPermissionHttp on the Function) |
| 20 | * const addPermission = yield* SNS.AddPermission(topic); |
| 21 | * |
| 22 | * // runtime |
| 23 | * yield* addPermission({ |
| 24 | * Label: "PartnerPublish", |
| 25 | * AWSAccountId: ["123456789012"], |
| 26 | * ActionName: ["Publish"], |
| 27 | * }); |
| 28 | * ``` |
| 29 | * |
| 30 | * @binding |
| 31 | */ |
| 32 | export interface AddPermission extends Binding.Service< |
| 33 | AddPermission, |
| 34 | "AWS.SNS.AddPermission", |
| 35 | ( |
| 36 | topic: Topic, |
| 37 | ) => Effect.Effect< |
| 38 | ( |
| 39 | request: AddPermissionRequest, |
| 40 | ) => Effect.Effect<sns.AddPermissionResponse, sns.AddPermissionError> |
| 41 | > |
| 42 | > {} |
| 43 | |
| 44 | export const AddPermission = Binding.Service<AddPermission>("AWS.SNS.AddPermission"); |