| 1 | import * as elasticache from "@distilled.cloud/aws/elasticache"; |
| 2 | import * as Layer from "effect/Layer"; |
| 3 | import { |
| 4 | makeElastiCacheCacheHttpBinding, |
| 5 | SERVERLESS_SNAPSHOT_ARN_WILDCARD, |
| 6 | } from "./BindingHttp.ts"; |
| 7 | import { CreateServerlessCacheSnapshot } from "./CreateServerlessCacheSnapshot.ts"; |
| 8 | |
| 9 | export const CreateServerlessCacheSnapshotHttp = Layer.effect( |
| 10 | CreateServerlessCacheSnapshot, |
| 11 | makeElastiCacheCacheHttpBinding({ |
| 12 | tag: "AWS.ElastiCache.CreateServerlessCacheSnapshot", |
| 13 | operation: elasticache.createServerlessCacheSnapshot, |
| 14 | // AddTagsToResource authorizes tag-on-create for the snapshot. |
| 15 | actions: [ |
| 16 | "elasticache:CreateServerlessCacheSnapshot", |
| 17 | "elasticache:AddTagsToResource", |
| 18 | ], |
| 19 | // The action authorizes against both the source cache and the |
| 20 | // to-be-created snapshot (whose name-based ARN is runtime data). |
| 21 | extraResources: [SERVERLESS_SNAPSHOT_ARN_WILDCARD], |
| 22 | }), |
| 23 | ); |