Skip to content

Commit e47770e

Browse files
fix: address Copilot PR review comments on PR #8
- Keep gitleaks/osv-scanner enabled in CI (only disable trivy/grype/semgrep) - Type ComputeStrategy.type and SessionHandle.strategyType as ComputeType - Trim/filter ECS_SUBNETS to handle whitespace and trailing commas - Handle undefined exit code in ECS pollSession (container never started) - Scope iam:PassRole to specific ECS task/execution role ARNs - Validate all-or-nothing ECS props in TaskOrchestrator constructor - Remove dead hasEcsBlueprint detection; document env-flag driven approach - Add comment noting strategy_type as additive event field
1 parent 49ea161 commit e47770e

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

cdk/src/constructs/task-orchestrator.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,13 @@ export class TaskOrchestrator extends Construct {
187187
const handlersDir = path.join(__dirname, '..', 'handlers');
188188
const maxConcurrent = props.maxConcurrentTasksPerUser ?? 3;
189189

190+
// Validate ECS props are all-or-nothing
191+
const ecsProps = [props.ecsClusterArn, props.ecsTaskDefinitionArn, props.ecsSubnets, props.ecsSecurityGroup, props.ecsContainerName];
192+
const ecsPropsProvided = ecsProps.filter(p => p !== undefined);
193+
if (ecsPropsProvided.length > 0 && ecsPropsProvided.length < ecsProps.length) {
194+
throw new Error('ECS compute strategy requires all of: ecsClusterArn, ecsTaskDefinitionArn, ecsSubnets, ecsSecurityGroup, ecsContainerName');
195+
}
196+
190197
this.fn = new lambda.NodejsFunction(this, 'OrchestratorFn', {
191198
entry: path.join(handlersDir, 'orchestrate-task.ts'),
192199
handler: 'handler',

0 commit comments

Comments
 (0)