@devries-cameron20 / t3code Mirror · read-only
Fork 0

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

main
ts 50 lines 1.87 KB
Raw
1 import type * as acm from "@distilled.cloud/aws/acm";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4
5 /**
6 * The full import request. `PrivateKey` is sensitive — pass it as
7 * `Redacted.make(bytes)` so it never leaks into logs or traces. Pass
8 * `CertificateArn` to re-import (rotate) an existing imported certificate;
9 * omit it to import a new one.
10 */
11 export interface ImportCertificateRequest extends acm.ImportCertificateRequest {}
12
13 /**
14 * Runtime binding for `acm:ImportCertificate`.
15 *
16 * An account-level operation (no certificate argument) that imports an
17 * externally issued certificate into ACM in `us-east-1` — the classic
18 * rotation flow where a function obtains a renewed certificate from an
19 * outside CA and re-imports it over the existing ACM entry by passing its
20 * `CertificateArn`. Provide the implementation with
21 * `Effect.provide(AWS.ACM.ImportCertificateHttp)`.
22 * ### Importing Certificates
23 * **Example:** Rotate an Externally Issued Certificate
24 * ```typescript
25 * // init — account-level binding takes no resource
26 * const importCertificate = yield* AWS.ACM.ImportCertificate();
27 *
28 * // runtime — re-import a renewed certificate over the existing ARN
29 * const encoder = new TextEncoder();
30 * const result = yield* importCertificate({
31 * CertificateArn: existingArn,
32 * Certificate: encoder.encode(certificatePem),
33 * PrivateKey: Redacted.make(encoder.encode(privateKeyPem)),
34 * CertificateChain: encoder.encode(chainPem),
35 * });
36 * ```
37 *
38 * @binding
39 */
40 export interface ImportCertificate extends Binding.Service<
41 ImportCertificate,
42 "AWS.ACM.ImportCertificate",
43 () => Effect.Effect<
44 (
45 request: ImportCertificateRequest,
46 ) => Effect.Effect<acm.ImportCertificateResponse, acm.ImportCertificateError>
47 >
48 > {}
49
50 export const ImportCertificate = Binding.Service<ImportCertificate>("AWS.ACM.ImportCertificate");