1import * as kafka from "@distilled.cloud/aws/kafka";
2import * as Layer from "effect/Layer";
3import { makeKafkaClusterHttpBinding } from "./BindingHttp.ts";
4import { CreateTopic } from "./CreateTopic.ts";
5
6export const CreateTopicHttp = Layer.effect(
7 CreateTopic,
8 makeKafkaClusterHttpBinding({
9 tag: "AWS.Kafka.CreateTopic",
10 operation: kafka.createTopic,
11 // The control-plane action authorizes against the topic ARN; the
12 // kafka-cluster analogs cover the underlying Kafka admin operation.
13 actions: [
14 "kafka:CreateTopic",
15 "kafka-cluster:Connect",
16 "kafka-cluster:CreateTopic",
17 ],
18 topicScoped: true,
19 }),
20);