1import * as compute from "@distilled.cloud/gcp/compute_v1";
2import * as Layer from "effect/Layer";
3import { makeInstanceHttpBinding } from "./BindingHttp.ts";
4import { StopInstance } from "./StopInstance.ts";
5
6/**
7 * HTTP implementation of {@link StopInstance}.
8 *
9 * Grants `roles/compute.instanceAdmin.v1` on the bound instance only,
10 * because no narrower predefined role contains `compute.instances.stop`.
11 *
12 * @layer
13 * @provides GCP.Compute.StopInstance
14 */
15export const StopInstanceHttp = Layer.effect(
16 StopInstance,
17 makeInstanceHttpBinding({
18 tag: "GCP.Compute.StopInstance",
19 iam: { role: "roles/compute.instanceAdmin.v1", on: "compute.instance" },
20 operation: compute.stopInstances,
21 }),
22);