Skip to content

schedule create --region other than us-east-1 targets a scheduler-handler that is never deployed there #1383

Closed

Description

@scttfrdmn

spawn schedule create --region R with any R other than us-east-1 creates a schedule whose every firing targets a function that does not exist.

Evidence (code, main at 5549f3f):

  • cmd/schedule.go:323: lambdaARN := fmt.Sprintf("arn:aws:lambda:%s:%s:function:scheduler-handler", scheduleRegion, accountID). The --region value (the sweep's compute region) becomes the target function's region.
  • scripts/deploy-scheduler-handler.sh deploys scheduler-handler only to us-east-1, on purpose (lines 11-22: "cmd/schedule.go only looks in us-east-1").
  • The schedule record is written to spawn-schedules with the infra config loaded for us-east-1 (LoadInfraAWSConfig(ctx, "us-east-1")). The handler reads SPAWN_SCHEDULES_TABLE with its own region's client, so a handler deployed in R would not find the record either.

Not reproduced live (no AWS calls). EventBridge Scheduler does not validate that the target exists at CreateSchedule time, so the create should succeed and each firing should fail delivery.

Suggested fix: the target is the handler's region (us-east-1, or the infra config's), not --region. --region stays on the record (Region), where the orchestrator already reads it. Add a gate that the target ARN's region is the deploy script's region.

Found while working on #1378, which reads the same table in us-east-1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions