1import * as elasticache from "@distilled.cloud/aws/elasticache";
2import * as Layer from "effect/Layer";
3import {
4 makeElastiCacheAccountHttpBinding,
5 SERVERLESS_SNAPSHOT_ARN_WILDCARD,
6} from "./BindingHttp.ts";
7import { CopyServerlessCacheSnapshot } from "./CopyServerlessCacheSnapshot.ts";
8
9export const CopyServerlessCacheSnapshotHttp = Layer.effect(
10 CopyServerlessCacheSnapshot,
11 makeElastiCacheAccountHttpBinding({
12 tag: "AWS.ElastiCache.CopyServerlessCacheSnapshot",
13 operation: elasticache.copyServerlessCacheSnapshot,
14 // AddTagsToResource authorizes tag-on-create for the target snapshot.
15 actions: [
16 "elasticache:CopyServerlessCacheSnapshot",
17 "elasticache:AddTagsToResource",
18 ],
19 // The action authorizes against both the source and target snapshots,
20 // whose names are runtime data.
21 resources: [SERVERLESS_SNAPSHOT_ARN_WILDCARD],
22 }),
23);