From d61d3301ef2e33176dc6f7e350d716c77b955ffa Mon Sep 17 00:00:00 2001 From: Sayee Kulkarni Date: Thu, 26 Nov 2026 13:48:09 +0000 Subject: [PATCH] feat(runtime): allow public BYO access-point mounts --- docs/china-regions.md | 4 + src/core/project/manager.test.ts | 119 ++++++++++++++ src/core/project/manager.tsx | 40 ++++- src/core/project/templates/export.test.ts | 29 ++++ src/core/project/templates/export.ts | 6 + .../project/add/runtime/index.test.ts | 43 +++++ src/handlers/project/add/runtime/index.ts | 2 +- src/projectSchemas/runtime.test.ts | 153 +++++++++++++++--- src/projectSchemas/runtime.ts | 9 +- 9 files changed, 377 insertions(+), 28 deletions(-) diff --git a/docs/china-regions.md b/docs/china-regions.md index fb94028e69..032ca287f6 100644 --- a/docs/china-regions.md +++ b/docs/china-regions.md @@ -41,5 +41,9 @@ China target fails with an explicit message. Those `add` subcommands say "not available in China regions" in their help, and the `agentcore add` menu warns when the project has a China deployment target. +- **PUBLIC filesystem mounts:** The EFS and S3 Files access-point PUBLIC-mode preview is + available only in commercial regions. `agentcore add runtime` rejects PUBLIC EFS or S3 Files + mounts when the project targets China, and `agentcore deploy` rechecks the saved runtime + configuration. - **Telemetry** is always disabled when the ambient AWS region or any deployment target is a China region. diff --git a/src/core/project/manager.test.ts b/src/core/project/manager.test.ts index a4121077c9..047f3532bb 100644 --- a/src/core/project/manager.test.ts +++ b/src/core/project/manager.test.ts @@ -18,6 +18,7 @@ import { credentialProviderNameEnvVarName, } from "../../projectSchemas/credential"; import { ProjectSpecSchema } from "../../projectSchemas/project"; +import type { FilesystemConfiguration } from "../../projectSchemas/runtime"; import { ENV_LOCAL_RELATIVE_PATH } from "./envLocal"; import { readEnvFile } from "../../io/envFile"; import { @@ -29,6 +30,7 @@ import { LITELLM_MODEL_ID_REQUIRED_CN_MESSAGE, MEMORY_STRIPPED_CN_MESSAGE, MODEL_PROVIDER_RUNTIMES_CN_MESSAGE, + PUBLIC_BYO_ACCESS_POINT_MOUNTS_CN_MESSAGE, chinaModelProviderRestriction, modelProviderOverridableCnMessage, } from "./manager"; @@ -939,6 +941,26 @@ describe("FsProjectManager.addResource", () => { describe("China (aws-cn) deployment targets", () => { const MCP_PYTHON_FASTMCP = resolveRuntimeTemplateShortcut("mcp-python-fastmcp"); + const EFS_ACCESS_POINT_MOUNT: FilesystemConfiguration = { + efsAccessPoint: { + accessPointArn: + "arn:aws:elasticfilesystem:cn-north-1:111122223333:access-point/fsap-0123456789abcdef0", + mountPath: "/mnt/efs", + }, + }; + const S3_FILES_ACCESS_POINT_MOUNT: FilesystemConfiguration = { + s3FilesAccessPoint: { + accessPointArn: + "arn:aws:s3files:cn-north-1:111122223333:file-system/fs-0123456789abcdef0/access-point/fsap-0123456789abcdef0", + mountPath: "/mnt/s3files", + }, + }; + // Both the add and deploy China guards cover EFS and S3 Files access-point mounts. + const PUBLIC_ACCESS_POINT_MOUNTS: [string, FilesystemConfiguration][] = [ + ["EFS", EFS_ACCESS_POINT_MOUNT], + ["S3 Files", S3_FILES_ACCESS_POINT_MOUNT], + ]; + async function projectWithTarget( region: string, missingToolAfterCreate?: string, @@ -987,6 +1009,55 @@ describe("FsProjectManager.addResource", () => { return { subject, project, checkedTools, deployCalls }; } + test.each(PUBLIC_ACCESS_POINT_MOUNTS)( + "rejects a public %s access-point mount before scaffolding", + async (_label, mount) => { + await inTempDirectory(); + const { subject, project, checkedTools } = await projectWithTarget( + "cn-north-1", + undefined, + MCP_PYTHON_FASTMCP, + ); + + await expect( + runAdd(subject, project, { + resourceType: "runtime", + resourceConfig: { + name: "cn_public_mount", + networkMode: "PUBLIC", + platformVersion: "V2", + filesystemConfigurations: [mount], + scaffoldRuntimeInput: { ...MCP_PYTHON_FASTMCP, runtimeName: "cn_public_mount" }, + }, + }), + ).rejects.toThrow( + new RegionUnsupportedFeatureError(PUBLIC_BYO_ACCESS_POINT_MOUNTS_CN_MESSAGE), + ); + + expect(checkedTools).toEqual([]); + }, + ); + + test("lets a VPC-mode EFS access-point mount past the China gate at add", async () => { + await inTempDirectory(); + const { subject, project } = await projectWithTarget("cn-north-1", "uv", MCP_PYTHON_FASTMCP); + + // The China guard blocks only PUBLIC access-point mounts; a VPC mount gets past it to the + // dependency checks, which stop on the injected missing tool rather than the region gate. + await expect( + runAdd(subject, project, { + resourceType: "runtime", + resourceConfig: { + name: "cn_vpc_mount", + networkMode: "VPC", + networkConfig: { subnets: ["subnet-12345678"], securityGroups: ["sg-12345678"] }, + filesystemConfigurations: [EFS_ACCESS_POINT_MOUNT], + scaffoldRuntimeInput: { ...MCP_PYTHON_FASTMCP, runtimeName: "cn_vpc_mount" }, + }, + }), + ).rejects.toThrow("uv is missing"); + }); + test("rejects a model-provider template before scaffolding", async () => { await inTempDirectory(); const { subject, project, checkedTools } = await projectWithTarget("cn-north-1"); @@ -1203,6 +1274,10 @@ describe("FsProjectManager.addResource", () => { bedrockManagedAgents?: boolean; tags?: Record; additionalPolicies?: string[]; + networkMode?: string; + networkConfig?: unknown; + platformVersion?: string; + filesystemConfigurations?: unknown[]; }[]; harnesses: unknown[]; memories?: unknown[]; @@ -1234,6 +1309,50 @@ describe("FsProjectManager.addResource", () => { } } + test.each(PUBLIC_ACCESS_POINT_MOUNTS)( + "deploy to a China target rejects a public %s access-point mount", + async (_label, mount) => { + await inTempDirectory(); + const { subject, project, deployCalls } = await projectWithTarget( + "cn-north-1", + undefined, + MCP_PYTHON_FASTMCP, + ); + await editSpec(project, (spec) => { + spec.runtimes[0]!.networkMode = "PUBLIC"; + spec.runtimes[0]!.platformVersion = "V2"; + spec.runtimes[0]!.filesystemConfigurations = [mount]; + }); + + const { error } = await deployOutcome(subject, project); + expect(error).toBeInstanceOf(RegionUnsupportedFeatureError); + expect(String(error)).toContain("runtime 'mcp_python_fastmcp'"); + expect(String(error)).toContain(PUBLIC_BYO_ACCESS_POINT_MOUNTS_CN_MESSAGE); + expect(deployCalls).toEqual([]); + }, + ); + + test("deploy to a China target allows a VPC-mode EFS access-point mount", async () => { + await inTempDirectory(); + const { subject, project, deployCalls } = await projectWithTarget( + "cn-north-1", + undefined, + MCP_PYTHON_FASTMCP, + ); + await editSpec(project, (spec) => { + spec.runtimes[0]!.networkMode = "VPC"; + spec.runtimes[0]!.networkConfig = { + subnets: ["subnet-12345678"], + securityGroups: ["sg-12345678"], + }; + spec.runtimes[0]!.filesystemConfigurations = [EFS_ACCESS_POINT_MOUNT]; + }); + + const { error } = await deployOutcome(subject, project); + expect(error).toBeUndefined(); + expect(deployCalls).toHaveLength(1); + }); + test("deploy to a China target hard-fails on a persisted commercial model provider", async () => { await inTempDirectory(); const { subject, project, deployCalls } = await projectWithTarget("cn-north-1"); diff --git a/src/core/project/manager.tsx b/src/core/project/manager.tsx index 2526cb29f3..02c89c3ac3 100644 --- a/src/core/project/manager.tsx +++ b/src/core/project/manager.tsx @@ -73,7 +73,7 @@ import { EvaluatorSchema } from "../../projectSchemas/evaluator"; import { OnlineEvalConfigSchema } from "../../projectSchemas/online-eval-config"; import { PaymentConnectorSchema, PaymentManagerSchema } from "../../projectSchemas/payment"; import { PolicyEngineSchema, PolicySchema } from "../../projectSchemas/policy"; -import { RuntimeEndpointSchema } from "../../projectSchemas/runtime"; +import { RuntimeEndpointSchema, type ProjectRuntime } from "../../projectSchemas/runtime"; import { defaultExportProjectName, enclosingProjectRoot, projectSpecPath } from "./fsUtils"; import { parseArn } from "../arn"; import { @@ -260,6 +260,24 @@ export function isAddableInChina(kind: ChinaAddKind): boolean { return CN_SUPPORTED_ADD_KINDS.has(kind); } +/** + * Returns true when a runtime uses the PUBLIC Preview path for EFS or S3 Files access-point mounts. + * China blocks this path because the preview is unavailable there; VPC access-point mounts remain valid. + * It deliberately does not re-check platformVersion: the runtime schema (projectSchemas/runtime.ts) + * only accepts a PUBLIC access-point mount when platformVersion is V2, so PUBLIC + such a mount + * already implies V2. + */ +function hasPublicByoAccessPointMount( + runtime: Pick, +): boolean { + return ( + runtime.networkMode === "PUBLIC" && + (runtime.filesystemConfigurations ?? []).some( + (mount) => "efsAccessPoint" in mount || "s3FilesAccessPoint" in mount, + ) + ); +} + /** * The project spec collections deployable to a China region — the spec-file * counterpart of {@link CN_SUPPORTED_RESOURCE_TYPES} (toolRuntimes render as @@ -273,6 +291,15 @@ const CN_SUPPORTED_SPEC_COLLECTIONS = new Set([ "toolRuntimes", ]); +/** + * Shown when a runtime's PUBLIC EFS or S3 Files access-point mount is added to, or deployed + * to, a China (aws-cn) region. The PUBLIC-mode access-point preview is not available there; + * the VPC route to the same mounts keeps working. + */ +export const PUBLIC_BYO_ACCESS_POINT_MOUNTS_CN_MESSAGE = + "PUBLIC EFS and S3 Files access-point mounts are not available in China regions " + + "(cn-north-1, cn-northwest-1). Use VPC mode or deploy to a supported commercial region."; + /** * Shown when a Gateway Target of type `connector` is added to, or deployed from, a * project with a China (aws-cn) target. The curated connectors are a static CLI @@ -674,6 +701,9 @@ export class FsProjectManager implements ProjectManager { if (input.resourceType === "harness") { throw new RegionUnsupportedFeatureError(HARNESS_CN_MESSAGE); } + if (input.resourceType === "runtime" && hasPublicByoAccessPointMount(input.resourceConfig)) { + throw new RegionUnsupportedFeatureError(PUBLIC_BYO_ACCESS_POINT_MOUNTS_CN_MESSAGE); + } // One allowlist decides what is refused (CN_SUPPORTED_ADD_KINDS); the // input decides which message: a connector-backed Gateway Target gets // its own, every other blocked kind the generic one. @@ -1635,6 +1665,14 @@ export class FsProjectManager implements ProjectManager { // modelProvider (BYO, provider-free, hand-edited, or scaffolded by an // older CLI) cannot be classified and only get an informational note. if (isChinaRegion(target.region)) { + const publicByoMountRuntimes = project.spec.runtimes.filter(hasPublicByoAccessPointMount); + if (publicByoMountRuntimes.length > 0) { + throw new RegionUnsupportedFeatureError( + `Cannot deploy to China region ${target.region}: ` + + `${publicByoMountRuntimes.map((runtime) => `runtime '${runtime.name}'`).join(", ")} uses ` + + `PUBLIC EFS or S3 Files access-point mounts. ${PUBLIC_BYO_ACCESS_POINT_MOUNTS_CN_MESSAGE}`, + ); + } const bmaRuntimes = project.spec.runtimes.filter( (runtime) => runtime.bedrockManagedAgents === true, ); diff --git a/src/core/project/templates/export.test.ts b/src/core/project/templates/export.test.ts index e4e971840f..b3d3c33ee3 100644 --- a/src/core/project/templates/export.test.ts +++ b/src/core/project/templates/export.test.ts @@ -1193,6 +1193,35 @@ describe("mapHarnessToExportPlan runtime spec entry", () => { expect(result.runtime.executionRoleArn).toBeUndefined(); }); + test("stamps platformVersion V2 for a PUBLIC access-point mount so the runtime validates", () => { + // A deployed PUBLIC harness carrying access-point mounts reaches the mapper as a HarnessSpec. + // The harness spec has no platformVersion, and a PUBLIC access-point mount is invalid without + // V2, so the exporter must stamp it or the exported runtime is rejected later. + const vpcSpec = harness({ + networkMode: "VPC", + networkConfig: { subnets: ["subnet-12345678"], securityGroups: ["sg-12345678"] }, + efsAccessPoints: [ + { + accessPointArn: + "arn:aws:elasticfilesystem:us-east-1:111122223333:access-point/fsap-0123456789abcdef0", + mountPath: "/mnt/tools", + }, + ], + }); + const publicSpec: HarnessSpec = { ...vpcSpec, networkMode: "PUBLIC", networkConfig: undefined }; + + const result = plan({ spec: publicSpec }); + + expect(result.runtime.networkMode).toBe("PUBLIC"); + expect(result.runtime.platformVersion).toBe("V2"); + expect(result.runtime.networkConfig).toBeUndefined(); + + // The exported runtime must validate inside a project spec rather than be rejected later. + const spec = projectSpec(); + spec.runtimes.push(result.runtime); + expect(() => ProjectSpecSchema.parse(spec)).not.toThrow(z.ZodError); + }); + test("the produced entry validates inside a project spec", () => { const result = plan({}); const spec = projectSpec(); diff --git a/src/core/project/templates/export.ts b/src/core/project/templates/export.ts index ffdbcab99e..f306430354 100644 --- a/src/core/project/templates/export.ts +++ b/src/core/project/templates/export.ts @@ -192,6 +192,9 @@ export function mapHarnessToExportPlan(input: HarnessExportInput): HarnessExport spec.timeoutSeconds !== undefined; const filesystemConfigurations = buildFilesystemConfigurations(spec); + const hasAccessPointMount = filesystemConfigurations.some( + (mount) => "efsAccessPoint" in mount || "s3FilesAccessPoint" in mount, + ); const envVars = Object.entries(spec.environmentVariables ?? {}).map(([name, value]) => ({ name, value, @@ -272,6 +275,9 @@ export function mapHarnessToExportPlan(input: HarnessExportInput): HarnessExport runtimeVersion: "PYTHON_3_14", ...(envVars.length > 0 && { envVars }), ...(spec.networkMode && { networkMode: spec.networkMode }), + // A PUBLIC access-point mount requires platformVersion V2 (projectSchemas/runtime.ts). The + // harness spec carries no platformVersion, so set it here or the exported runtime is rejected. + ...(spec.networkMode === "PUBLIC" && hasAccessPointMount && { platformVersion: "V2" as const }), ...(networkConfig && { networkConfig }), ...(spec.authorizerType && { authorizerType: spec.authorizerType }), ...(spec.authorizerConfiguration && { diff --git a/src/handlers/project/add/runtime/index.test.ts b/src/handlers/project/add/runtime/index.test.ts index f27904dab1..76946f5cd4 100644 --- a/src/handlers/project/add/runtime/index.test.ts +++ b/src/handlers/project/add/runtime/index.test.ts @@ -694,6 +694,49 @@ describe("project add runtime", () => { expect(await runtimeOf(projectRoot, "s3_agent")).toMatchSnapshot(); }); + test("public EFS and S3 Files mounts are written to the spec entry", async () => { + const { projectRoot, cleanup } = await initProject(); + cleanups.push(cleanup); + await run([ + "add", + "runtime", + "--name", + "public_mounts", + "--language", + "python", + "--network-mode", + "PUBLIC", + "--platform-version", + "V2", + "--filesystem-configurations", + JSON.stringify([ + { + efsAccessPoint: { + accessPointArn: + "arn:aws:elasticfilesystem:us-east-1:123456789012:access-point/fsap-0123456789abcdef0", + mountPath: "/mnt/efs", + }, + }, + { + s3FilesAccessPoint: { + accessPointArn: + "arn:aws:s3files:us-east-1:123456789012:file-system/fs-0123456789abcdef01/access-point/fsap-0123456789abcdef1", + mountPath: "/mnt/s3", + }, + }, + ]), + ]); + + expect(await runtimeOf(projectRoot, "public_mounts")).toMatchObject({ + networkMode: "PUBLIC", + platformVersion: "V2", + filesystemConfigurations: [ + { efsAccessPoint: { mountPath: "/mnt/efs" } }, + { s3FilesAccessPoint: { mountPath: "/mnt/s3" } }, + ], + }); + }); + test("an existing folder keeps the user's files; only missing docs are added", async () => { const { projectRoot, cleanup } = await initProject(); cleanups.push(cleanup); diff --git a/src/handlers/project/add/runtime/index.ts b/src/handlers/project/add/runtime/index.ts index 62724a5a5f..a5e6fbcac4 100644 --- a/src/handlers/project/add/runtime/index.ts +++ b/src/handlers/project/add/runtime/index.ts @@ -175,7 +175,7 @@ export const createAddRuntimeHandler = (config: AddProjectResourceConfig) => ), flag( "filesystem-configurations", - "filesystem mount configurations (JSON); an s3BucketMount needs --platform-version V2", + "filesystem mount configurations (JSON); EFS and S3 Files access-point mounts use VPC, or --network-mode PUBLIC with --platform-version V2 (Preview, commercial Regions only)", z.string().optional(), { group: ENVIRONMENT }, ), diff --git a/src/projectSchemas/runtime.test.ts b/src/projectSchemas/runtime.test.ts index 06d635ae03..9919eeb8b1 100644 --- a/src/projectSchemas/runtime.test.ts +++ b/src/projectSchemas/runtime.test.ts @@ -247,36 +247,141 @@ describe("runtime custom validation", () => { }).success, ).toBe(false); }); - it("enforces filesystem counts, VPC dependency, and unique mount paths", () => { + // Access-point (EFS / S3 Files) network-mode and platform-version rules, mirroring the service's + // VolumeConfigurationValidator: VPC is always allowed; PUBLIC needs V2; anything else is rejected. + describe("filesystem access-point mounts", () => { + const BYO_NETWORK_MESSAGE = + "efsAccessPoint and s3FilesAccessPoint filesystem mounts require networkMode: VPC, or networkMode: PUBLIC with platformVersion: V2"; const efsAccessPoint = { efsAccessPoint: { accessPointArn: "arn:aws:elasticfilesystem:us-east-1:123456789012:access-point/fsap-0123456789abcdef0", - mountPath: "/mnt/data", + mountPath: "/mnt/efs", }, }; - expect( - ProjectRuntimeSchema.safeParse({ - ...codeZipAgent, - filesystemConfigurations: [efsAccessPoint], - }).success, - ).toBe(false); - expect( - ProjectRuntimeSchema.safeParse({ - ...codeZipAgent, - networkMode: "VPC", - networkConfig, - filesystemConfigurations: [{ sessionStorage: { mountPath: "/mnt/data/" } }, efsAccessPoint], - }).success, - ).toBe(false); - expect( - ProjectRuntimeSchema.safeParse({ - ...codeZipAgent, - filesystemConfigurations: Array.from({ length: 6 }, (_, index) => ({ - sessionStorage: { mountPath: `/mnt/data${index}` }, - })), - }).success, - ).toBe(false); + const s3FilesAccessPoint = { + s3FilesAccessPoint: { + accessPointArn: + "arn:aws:s3files:us-east-1:123456789012:file-system/fs-0123456789abcdef01/access-point/fsap-0123456789abcdef1", + mountPath: "/mnt/s3", + }, + }; + const byoCases = [ + ["efsAccessPoint", efsAccessPoint], + ["s3FilesAccessPoint", s3FilesAccessPoint], + ] as const; + const issues = (overrides: object) => + ProjectRuntimeSchema.safeParse({ ...codeZipAgent, ...overrides }).error?.issues ?? []; + const messages = (overrides: object) => issues(overrides).map((issue) => issue.message); + + it.each(byoCases)("accepts a %s mount in PUBLIC mode on V2", (_name, mount) => { + expect( + ProjectRuntimeSchema.safeParse({ + ...codeZipAgent, + networkMode: "PUBLIC", + platformVersion: "V2", + filesystemConfigurations: [mount], + }).success, + ).toBe(true); + }); + + it.each(byoCases)("accepts a %s mount in VPC mode on any platform version", (_name, mount) => { + expect( + ProjectRuntimeSchema.safeParse({ + ...codeZipAgent, + networkMode: "VPC", + networkConfig, + filesystemConfigurations: [mount], + }).success, + ).toBe(true); + }); + + it.each(byoCases)("rejects a %s mount in PUBLIC mode on V1", (_name, mount) => { + expect( + issues({ networkMode: "PUBLIC", platformVersion: "V1", filesystemConfigurations: [mount] }), + ).toContainEqual( + expect.objectContaining({ + path: ["filesystemConfigurations"], + message: BYO_NETWORK_MESSAGE, + }), + ); + }); + + it.each(byoCases)("rejects a %s mount when networkMode is omitted", (_name, mount) => { + // The service reads an explicit networkMode and treats unset as neither VPC nor PUBLIC, so it + // rejects. Unset is not an implicit PUBLIC here. + expect(issues({ filesystemConfigurations: [mount] })).toContainEqual( + expect.objectContaining({ + path: ["filesystemConfigurations"], + message: BYO_NETWORK_MESSAGE, + }), + ); + }); + + it("rejects a PUBLIC mount when platformVersion is omitted", () => { + // PUBLIC-mode access-point mounts need V2; the service resolves an unset version to V1. + expect( + issues({ networkMode: "PUBLIC", filesystemConfigurations: [efsAccessPoint] }), + ).toContainEqual( + expect.objectContaining({ + path: ["filesystemConfigurations"], + message: BYO_NETWORK_MESSAGE, + }), + ); + }); + + it("caps EFS access points at two", () => { + const mounts = Array.from({ length: 3 }, (_, index) => ({ + efsAccessPoint: { ...efsAccessPoint.efsAccessPoint, mountPath: `/mnt/efs${index}` }, + })); + expect( + messages({ + networkMode: "PUBLIC", + platformVersion: "V2", + filesystemConfigurations: mounts, + }), + ).toContain("Maximum 2 efsAccessPoint configurations allowed"); + }); + + it("caps S3 Files access points at two", () => { + const mounts = Array.from({ length: 3 }, (_, index) => ({ + s3FilesAccessPoint: { + ...s3FilesAccessPoint.s3FilesAccessPoint, + mountPath: `/mnt/s3_${index}`, + }, + })); + expect( + messages({ + networkMode: "PUBLIC", + platformVersion: "V2", + filesystemConfigurations: mounts, + }), + ).toContain("Maximum 2 s3FilesAccessPoint configurations allowed"); + }); + + it("allows at most one sessionStorage configuration", () => { + expect( + messages({ + filesystemConfigurations: [ + { sessionStorage: { mountPath: "/mnt/a" } }, + { sessionStorage: { mountPath: "/mnt/b" } }, + ], + }), + ).toContain("Maximum 1 sessionStorage configuration allowed"); + }); + + it("rejects mounts that reuse a mount path across types", () => { + expect( + messages({ + networkMode: "PUBLIC", + platformVersion: "V2", + filesystemConfigurations: [ + { sessionStorage: { mountPath: "/mnt/efs/" } }, + efsAccessPoint, + ], + }), + ).toContain("Filesystem mount paths must be unique"); + }); }); it("applies the CodeBuild security-group cap only to container builds", () => { const securityGroups = Array.from( diff --git a/src/projectSchemas/runtime.ts b/src/projectSchemas/runtime.ts index d11dbcaae8..45ea83d28b 100644 --- a/src/projectSchemas/runtime.ts +++ b/src/projectSchemas/runtime.ts @@ -556,11 +556,16 @@ export const ProjectRuntimeSchema = z }); } const hasByo = efsCount > 0 || s3Count > 0; - if (hasByo && data.networkMode !== "VPC") { + // The service accepts BYO access-point mounts only in VPC mode, or in PUBLIC mode on V2 (the + // public endpoint path). It reads an explicit networkMode (unset is neither) and the effective + // platform version (unset runs as V1), so gate on the same explicit PUBLIC + V2 here. See + // YggdrasillControlPlaneService VolumeConfigurationValidator.validateByoStorageNetworkMode. + const isPublicV2 = data.networkMode === "PUBLIC" && data.platformVersion === "V2"; + if (hasByo && data.networkMode !== "VPC" && !isPublicV2) { ctx.addIssue({ code: "custom", message: - "efsAccessPoint and s3FilesAccessPoint filesystem mounts require networkMode: VPC", + "efsAccessPoint and s3FilesAccessPoint filesystem mounts require networkMode: VPC, or networkMode: PUBLIC with platformVersion: V2", path: ["filesystemConfigurations"], }); }