Summary
Replace the commented-out ECS construct in cdk/src/stacks/agent.ts with a proper compute_type context gate.
Problem
Currently, enabling ECS requires manually uncommenting code in agent.ts (lines ~46, ~524-533). This:
Solution
const computeType = app.node.tryGetContext('compute_type') ?? 'agentcore';
// In the stack:
if (computeType === 'ecs') {
new EcsAgentCluster(this, 'EcsAgentCluster', { vpc, ... });
}
The construct is always in source, always compilable, always tested. The context variable governs synthesis:
mise //cdk:synth → agentcore only (default)
mise //cdk:synth -- -c compute_type=ecs → agentcore + ECS resources
Acceptance criteria
Relationship to #120 stack
Prerequisite for #124 (resource-action-map) — the synth-coverage test needs to run with compute_type=ecs to verify ECS resource types are mapped. Without this issue, ECS resources never appear in the synthesized template.
Blocked by: #123 (compute-ecs policy must exist)
Blocks: #124 (ECS coverage in resource-action-map)
Summary
Replace the commented-out ECS construct in
cdk/src/stacks/agent.tswith a propercompute_typecontext gate.Problem
Currently, enabling ECS requires manually uncommenting code in
agent.ts(lines ~46, ~524-533). This:Solution
The construct is always in source, always compilable, always tested. The context variable governs synthesis:
mise //cdk:synth→ agentcore only (default)mise //cdk:synth -- -c compute_type=ecs→ agentcore + ECS resourcesAcceptance criteria
if (computeType === 'ecs')mise //cdk:synth(default) produces same template as today (no ECS resources)mise //cdk:synth -- -c compute_type=ecsproduces template with ECS resourcesmise //cdk:testpasses for both configurationsRelationship to #120 stack
Prerequisite for #124 (resource-action-map) — the synth-coverage test needs to run with
compute_type=ecsto verify ECS resource types are mapped. Without this issue, ECS resources never appear in the synthesized template.Blocked by: #123 (compute-ecs policy must exist)
Blocks: #124 (ECS coverage in resource-action-map)