Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Issue #2548] Swap analytics to new step function pattern #2546

Merged
merged 3 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions infra/analytics/app-config/env-config/environment-variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@ locals {
# This is a map rather than a list so that variables can be easily
# overridden per environment using terraform's `merge` function
default_extra_environment_variables = {
MB_DB_TYPE = "postgres"
MB_DB_USER = "metabaseuser"
MB_DB_DBNAME = "metabase"
MB_DB_TYPE = "postgres"
MB_DB_USER = "metabaseuser"
MB_DB_DBNAME = "metabase"
PY_RUN_APPROACH = "local"
SPRINT_FILE = "/tmp/sprint-data.json"
ISSUE_FILE = "/tmp/issue-data.json"
OUTPUT_DIR = "/tmp/"
}

# Configuration for secrets
Expand Down
4 changes: 4 additions & 0 deletions infra/analytics/app-config/env-config/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ output "service_config" {
}
}

output "scheduled_jobs" {
value = local.scheduled_jobs
}

output "domain" {
value = var.domain
}
15 changes: 15 additions & 0 deletions infra/analytics/app-config/env-config/scheduled_jobs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
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".

scheduled_jobs = {
sprint-reports = {
task_command = ["make", "gh-data-export", "sprint-reports"]
schedule_expression = "rate(1 days)"
state = "ENABLED"
}
}
}
4 changes: 4 additions & 0 deletions infra/analytics/service/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ module "service" {
cpu = 1024
memory = 2048

readonly_root_filesystem = false

# This is a task based service, not a web server, so we don't need to run any instances of the service at rest.
desired_instance_count = 0

Expand All @@ -123,6 +125,8 @@ module "service" {
app_access_policy_arn = data.aws_iam_policy.app_db_access_policy[0].arn
migrator_access_policy_arn = data.aws_iam_policy.migrator_db_access_policy[0].arn

scheduled_jobs = local.environment_config.scheduled_jobs

db_vars = {
security_group_ids = data.aws_rds_cluster.db_cluster[0].vpc_security_group_ids
connection_info = {
Expand Down
110 changes: 0 additions & 110 deletions infra/analytics/service/sfn_sprint_reports.tf

This file was deleted.

Loading