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 AWS from "@alchemy.run/aws"; |
| 2 | import * as GCP from "@alchemy.run/gcp"; |
| 3 | import * as Effect from "effect/Effect"; |
| 4 | import { serveProbes } from "../../GCP/bindingHost.ts"; |
| 5 | |
| 6 | /** Queue the Cloud Run host sends to. */ |
| 7 | export const Jobs = AWS.SQS.Queue("FederatedJobs"); |
| 8 | |
| 9 | /** |
| 10 | * Effect-native Cloud Run service binding an AWS queue. It runs as a Google |
| 11 | * service account, so it reaches SQS by assuming a Role with its Google ID |
| 12 | * token, not with an access key. Deployed from {@link ../AWSBindings.test.ts}. |
| 13 | */ |
| 14 | export default class FederatedHost extends GCP.Function<FederatedHost>()( |
| 15 | "FederatedHost", |
| 16 | { main: import.meta.url, location: "us-central1", invokerIamDisabled: true }, |
| 17 | Effect.gen(function* () { |
| 18 | const send = yield* AWS.SQS.SendMessage(Jobs); |
| 19 | return { |
| 20 | fetch: serveProbes({ |
| 21 | send: send({ MessageBody: "hello from cloud run" }), |
| 22 | }), |
| 23 | }; |
| 24 | }).pipe(Effect.provide(AWS.SQS.SendMessageHttp)), |
| 25 | ) {} |