The best way to control Claude Code, Codex and more from any computer or phone

main
ts 56 lines 2.03 KB
Raw
1 import * as AWS from "@alchemy.run/aws";
2 import { expect } from "@alchemy.run/test";
3 import * as Test from "@alchemy.run/test/Alchemy";
4 import * as ElastiCache from "@distilled.cloud/aws/elasticache";
5 import * as Effect from "effect/Effect";
6 import {
7 assertReplicationGroupGone,
8 getProvisionedNetwork,
9 shareProvisionedNetwork,
10 } from "./ProvisionedFixture.ts";
11
12 const { test, beforeAll, afterAll } = Test.make({
13 providers: AWS.providers(),
14 });
15 shareProvisionedNetwork({ beforeAll, afterAll });
16 test.provider.skipIf(!!process.env.FAST)(
17 "create, update, verify, and destroy a provisioned Redis OSS replication group",
18 (stack) =>
19 Effect.gen(function* () {
20 yield* stack.destroy();
21 const net = yield* getProvisionedNetwork;
22 const deploy = (description: string) =>
23 stack.deploy(
24 Effect.gen(function* () {
25 const cache = yield* AWS.ElastiCache.ReplicationGroup("Cache", {
26 description,
27 engine: "redis",
28 nodeType: "cache.t4g.micro",
29 subnetGroupName: net.subnetGroupName,
30 securityGroupIds: [net.securityGroupId],
31 replicasPerNodeGroup: 0,
32 transitEncryptionEnabled: true,
33 tags: { fixture: "elasticache-provisioned-redis" },
34 });
35 return { cache };
36 }),
37 );
38
39 const { cache } = yield* deploy("alchemy Redis OSS cache");
40 const created = yield* ElastiCache.describeReplicationGroups({
41 ReplicationGroupId: cache.replicationGroupId,
42 });
43 expect(created.ReplicationGroups?.[0]?.Engine).toBe("redis");
44 expect(created.ReplicationGroups?.[0]?.Status).toBe("available");
45
46 const { cache: updated } = yield* deploy("alchemy Redis OSS cache v2");
47 expect(updated.replicationGroupId).toBe(cache.replicationGroupId);
48
49 yield* stack.destroy();
50 yield* assertReplicationGroupGone(cache.replicationGroupId);
51 }),
52 {
53 tags: ["provider:aws", "provider:aws:ec2", "provider:aws:elasticache", "live"],
54 timeout: 2_700_000,
55 },
56 );