t3-code-android-nightly/.repos/alchemy-effect/packages/alchemy/test/AWS/EMRServerless/probe.test.ts
Julius Marminge 6f9cea00ae
chore(refs): sync Effect and Alchemy references to 4.0.1 and beta.80 (#16170)
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-05 13:22:30 -07:00

34 lines
1.4 KiB
TypeScript

import * as AWS from "@/AWS";
import * as Test from "@/Test/Alchemy";
import * as emr from "@distilled.cloud/aws/emr-serverless";
import { expect } from "alchemy-test";
import * as Effect from "effect/Effect";
const { test } = Test.make({ providers: AWS.providers() });
// Ungated platform-gate probe: `emr-serverless:GetResourceDashboard` is
// currently denied by the SERVICE for every caller — even a principal with
// `Action: "*"` (AdministratorAccess) receives
// AccessDeniedException: User: … is not authorized to perform:
// emr-serverless:GetResourceDashboard
// with no resource in the message, so the denial is service-side (the
// operation backs the console/interactive-session dashboards), not an IAM
// policy gap. This probe pins that behavior: if it ever starts failing, the
// operation has launched publicly and the Bindings test's expectation for
// the GetResourceDashboard runtime probe should be upgraded to a
// success/not-found assertion.
test.provider(
"getResourceDashboard is service-gated (typed AccessDenied)",
() =>
Effect.gen(function* () {
const error = yield* Effect.flip(
emr.getResourceDashboard({
applicationId: "00abcdefabcdef01",
resourceId: "00abcdefabcdef01",
resourceType: "SPARK_DRIVER",
}),
);
expect(error._tag).toBe("AccessDeniedException");
}),
{ tags: ["provider:aws", "provider:aws:emrserverless", "live"] },
);