-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
## Summary Relates to: #2351, #2472 ### Time to review: __5 mins__ ## Changes proposed There are two goals to this PR: 1. Make a material change that gets us closer in line with the platform. Specifically we are pulling in navapbc/template-infra#745 2. Updates the step functions in advance of adding another step function - for the terraform in ECS stuff ## Context for reviewers The majority of the diff is security related, specifically: - via guidance from @lorenyu, the permissions for managing the step function and workflow triggers were moved off of the task exec role. that's the diff on `infra/modules/service/access-control.tf` - those permissions were moved to `infra/modules/service/scheduler_role.tf` and `infra/modules/service/workflow_orchestrator_role.tf` The rest of the diff is around easy of configuration: - `infra/modules/service/scheduled_jobs.tf` represents the new, highly configurable, way to create scheduled jobs - `infra/api/app-config/env-config/scheduled_jobs.tf` shows how two scheduled jobs are configured ## Additional information <img width="1238" alt="image" src="https://github.com/user-attachments/assets/24e6e50e-74b0-4cf8-b61b-bad34af90118"> <img width="1237" alt="image" src="https://github.com/user-attachments/assets/aa297341-8d7d-4ac7-bcc9-ef102df25e05">
- Loading branch information
1 parent
6a5627c
commit 02868b5
Showing
15 changed files
with
329 additions
and
310 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
locals { | ||
# The `task_command` is what you want your scheduled job to run, for example: ["poetry", "run", "flask"]. | ||
# Schedule expression defines the frequency at which the job should run. | ||
# The syntax for `schedule_expression` is explained in the following documentation: | ||
# https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-scheduled-rule-pattern.html | ||
# The `state` is the state of the scheduled job. It can be either "ENABLED" or "DISABLED". | ||
|
||
# See api/src/data_migration/command/load_transform.py for argument specifications. | ||
load-transform-args = { | ||
# Runs, but with everything disabled. | ||
dev = [ | ||
"poetry", | ||
"run", | ||
"flask", | ||
"data-migration", | ||
"load-transform", | ||
"--no-load", | ||
"--no-transform", | ||
"--no-set-current", | ||
], | ||
staging = [ | ||
"poetry", | ||
"run", | ||
"flask", | ||
"data-migration", | ||
"load-transform", | ||
"--load", | ||
"--transform", | ||
"--set-current", | ||
], | ||
prod = [ | ||
"poetry", | ||
"run", | ||
"flask", | ||
"data-migration", | ||
"load-transform", | ||
"--load", | ||
"--transform", | ||
"--set-current", | ||
], | ||
} | ||
scheduled_jobs = { | ||
copy-oracle-data = { | ||
task_command = ["poetry", "run", "flask", "data-migration", "copy-oracle-data"] | ||
schedule_expression = "rate(2 minutes)" | ||
state = "ENABLED" | ||
} | ||
load-transform = { | ||
task_command = local.load-transform-args[var.environment] | ||
schedule_expression = "rate(1 days)" | ||
state = "ENABLED" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.