Making it possible to run one-off square
This commit is contained in:
69
scratch-sessions/fix-julia.clj
Normal file
69
scratch-sessions/fix-julia.clj
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
;; This buffer is for Clojure experiments and evaluation.
|
||||||
|
|
||||||
|
;; Press C-j to evaluate the last expression.
|
||||||
|
|
||||||
|
;; You can also press C-u C-j to evaluate the expression and pretty-print its result.
|
||||||
|
|
||||||
|
|
||||||
|
(d/q '[:find ?tx
|
||||||
|
:in $ [?tx ..]
|
||||||
|
:where [_ :transaction/amount _ false ?tx]]
|
||||||
|
(dc/history ()))
|
||||||
|
|
||||||
|
|
||||||
|
(user/init-repl)
|
||||||
|
|
||||||
|
|
||||||
|
(def attrs-used #{:transaction/bank-account
|
||||||
|
:transaction/date
|
||||||
|
:journal-entry-line/credit
|
||||||
|
:transaction/check-number
|
||||||
|
:transaction/matched-rule
|
||||||
|
:journal-entry/alternate-description
|
||||||
|
:payment/status :db/txInstant :transaction/payment
|
||||||
|
:journal-entry-line/account :transaction/client :journal-entry/date
|
||||||
|
:journal-entry/original-entity :journal-entry/client
|
||||||
|
:journal-entry/line-items :journal-entry/source :transaction/status
|
||||||
|
:transaction-account/account :audit/batch
|
||||||
|
:transaction-account/location :transaction/id :transaction/location
|
||||||
|
:transaction/description-original :journal-entry-line/debit
|
||||||
|
:transaction/approval-status :import-batch/entry
|
||||||
|
:transaction-account/amount :transaction/amount :transaction/accounts
|
||||||
|
:transaction/description-simple :transaction/raw-id
|
||||||
|
:journal-entry/cleared :journal-entry/amount :journal-entry/vendor
|
||||||
|
:audit/user :journal-entry-line/location :transaction/vendor})
|
||||||
|
|
||||||
|
(def attrs-to-undo (set (filter (comp (complement #{"audit" "journal-entry" "journal-entry-line" "db"}) namespace) attrs-used)))
|
||||||
|
|
||||||
|
(def potential-reverts
|
||||||
|
(let [db (d/db auto-ap.datomic/conn)
|
||||||
|
a (:db/id (d/pull db [:db/id] :audit/user))]
|
||||||
|
(for [n (reverse (d/tx-range (d/log auto-ap.datomic/conn)
|
||||||
|
#inst "2022-09-02T14:08:00-07:00"
|
||||||
|
#inst "2022-09-02T14:28:00-07:00"))
|
||||||
|
:when (seq (filter #(and (= a (:a %))
|
||||||
|
(= "admin-Julia Tarabbia" (:v %)))
|
||||||
|
(:data n)))
|
||||||
|
datum (:data n)
|
||||||
|
:let [attr (d/ident db (:a datum))]
|
||||||
|
:when (attrs-to-undo attr)]
|
||||||
|
(if (:added datum)
|
||||||
|
[:db/retract (:e datum) attr (:v datum)]
|
||||||
|
[:db/add (:e datum) attr (:v datum)]))))
|
||||||
|
|
||||||
|
(doseq [[n p] (map vector (range) (partition-all 50 (partition-by second potential-reverts)))
|
||||||
|
:let [transaction (into [] (mapcat identity) p)]]
|
||||||
|
(println "batch " n)
|
||||||
|
@(d/transact
|
||||||
|
auto-ap.datomic/conn
|
||||||
|
(conj transaction
|
||||||
|
{:db/id "datomic.tx"
|
||||||
|
:audit/user (str "Bryce fixup")
|
||||||
|
:db/doc "Fixing a mistake by undoing julia's changes"})))
|
||||||
|
|
||||||
|
(count potential-reverts)
|
||||||
|
|
||||||
|
(take 50 potential-reverts)
|
||||||
|
|
||||||
|
(spit-csv [:e :a :v :added] potential-reverts)
|
||||||
|
|
||||||
11
src/clj/auto_ap/jobs/square.clj
Normal file
11
src/clj/auto_ap/jobs/square.clj
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
(ns auto-ap.jobs.square
|
||||||
|
(:gen-class)
|
||||||
|
(:require [auto-ap.square.core :as square]
|
||||||
|
[auto-ap.utils :refer [heartbeat]]
|
||||||
|
[mount.core :as mount]
|
||||||
|
[auto-ap.datomic :refer [conn]]))
|
||||||
|
|
||||||
|
(defn -main [& _]
|
||||||
|
(mount/start (mount/only #{#'conn}))
|
||||||
|
((heartbeat square/upsert-all "square-loading")))
|
||||||
|
|
||||||
@@ -15,6 +15,7 @@
|
|||||||
[auto-ap.square.core :as square]
|
[auto-ap.square.core :as square]
|
||||||
[auto-ap.background.metrics :as metrics]
|
[auto-ap.background.metrics :as metrics]
|
||||||
[auto-ap.background.mail :as mail]
|
[auto-ap.background.mail :as mail]
|
||||||
|
[auto-ap.jobs.square :as job-square]
|
||||||
[clojure.tools.logging :as log]
|
[clojure.tools.logging :as log]
|
||||||
[config.core :refer [env]]
|
[config.core :refer [env]]
|
||||||
[mount.core :as mount]
|
[mount.core :as mount]
|
||||||
@@ -85,31 +86,37 @@
|
|||||||
(mount/stop))
|
(mount/stop))
|
||||||
|
|
||||||
(defn -main [& _]
|
(defn -main [& _]
|
||||||
(let [without (cond-> []
|
|
||||||
(not (env :run-web? )) (into [#'jetty
|
(let [job (System/getenv "INTEGREAT_JOB")]
|
||||||
#'jetty-stats])
|
(cond (= job "square-import-job")
|
||||||
(not (env :run-background?)) (into [#'square/square-loader
|
(job-square/-main)
|
||||||
#'vendor/refresh-vendor-usages-worker
|
|
||||||
#'ledger/touch-broken-ledger-worker
|
:else
|
||||||
#'mail/import-invoices
|
(let [without (cond-> []
|
||||||
#'ledger/process-txes-worker
|
(not (env :run-web? )) (into [#'jetty
|
||||||
#'ledger/ledger-reconciliation-worker
|
#'jetty-stats])
|
||||||
#'requests/request-listener
|
(not (env :run-background?)) (into [#'square/square-loader
|
||||||
#'sysco/sysco-invoice-importer
|
#'vendor/refresh-vendor-usages-worker
|
||||||
#'auto-ap.background.invoices/close-auto-invoices-worker
|
#'ledger/touch-broken-ledger-worker
|
||||||
#'gq-clients/current-balance-worker
|
#'mail/import-invoices
|
||||||
#'yodlee2/import-worker
|
#'ledger/process-txes-worker
|
||||||
#'yodlee2/account-worker
|
#'ledger/ledger-reconciliation-worker
|
||||||
#'intuit/import-worker
|
#'requests/request-listener
|
||||||
#'intuit/account-worker
|
#'sysco/sysco-invoice-importer
|
||||||
#'plaid/import-worker
|
#'auto-ap.background.invoices/close-auto-invoices-worker
|
||||||
#'migrate/migrate-start]))]
|
#'gq-clients/current-balance-worker
|
||||||
(log/info "starting without " without)
|
#'yodlee2/import-worker
|
||||||
|
#'yodlee2/account-worker
|
||||||
(add-shutdown-hook! shutdown-mount)
|
#'intuit/import-worker
|
||||||
(start-server :port 9000 :bind "0.0.0.0" #_#_:handler (cider-nrepl-handler))
|
#'intuit/account-worker
|
||||||
#_(alter-var-root #'nrepl.middleware.print/*print-fn* (constantly clojure.pprint/pprint))
|
#'plaid/import-worker
|
||||||
(apply mount/start-without without)))
|
#'migrate/migrate-start]))]
|
||||||
|
(log/info "starting without " without)
|
||||||
|
|
||||||
|
(add-shutdown-hook! shutdown-mount)
|
||||||
|
(start-server :port 9000 :bind "0.0.0.0" #_#_:handler (cider-nrepl-handler))
|
||||||
|
#_(alter-var-root #'nrepl.middleware.print/*print-fn* (constantly clojure.pprint/pprint))
|
||||||
|
(apply mount/start-without without)))))
|
||||||
|
|
||||||
(comment
|
(comment
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -37,6 +37,18 @@ resource "aws_ecs_task_definition" "integreat_background_worker" {
|
|||||||
task_role_arn = var.task_role_arn
|
task_role_arn = var.task_role_arn
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resource "aws_ecs_task_definition" "square_import_job" {
|
||||||
|
|
||||||
|
family = "square_import_job_${var.stage}"
|
||||||
|
container_definitions = file("${var.stage}-square-import-job-taskdef.json")
|
||||||
|
memory = 8192
|
||||||
|
cpu = 2048
|
||||||
|
network_mode = "awsvpc"
|
||||||
|
requires_compatibilities = ["FARGATE"]
|
||||||
|
execution_role_arn = var.execution_role_arn
|
||||||
|
task_role_arn = var.task_role_arn
|
||||||
|
}
|
||||||
|
|
||||||
resource "aws_ecs_service" "integreat_app" {
|
resource "aws_ecs_service" "integreat_app" {
|
||||||
name = "integreat_app_${var.stage}"
|
name = "integreat_app_${var.stage}"
|
||||||
cluster = var.ecs_cluster
|
cluster = var.ecs_cluster
|
||||||
|
|||||||
66
terraform/prod-square-import-job-taskdef.json
Normal file
66
terraform/prod-square-import-job-taskdef.json
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"environment": [
|
||||||
|
{
|
||||||
|
"name": "config",
|
||||||
|
"value": "/usr/local/config/prod-background-worker.edn"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "DD_ENV",
|
||||||
|
"value": "prod"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "DD_SERVICE",
|
||||||
|
"value": "square-import-job"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"essential": true,
|
||||||
|
"image": "679918342773.dkr.ecr.us-east-1.amazonaws.com/integreat:prod",
|
||||||
|
"logConfiguration": {
|
||||||
|
"logDriver": "awslogs",
|
||||||
|
"options": {
|
||||||
|
"awslogs-group": "/ecs/integreat-background-worker-prod",
|
||||||
|
"awslogs-region": "us-east-1",
|
||||||
|
"awslogs-stream-prefix": "ecs"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"dockerLabels": {
|
||||||
|
"com.datadoghq.tags.env": "prod",
|
||||||
|
"com.datadoghq.tags.service": "square-import-job"
|
||||||
|
},
|
||||||
|
"mountPoints": [],
|
||||||
|
"name": "integreat-app",
|
||||||
|
"portMappings": [
|
||||||
|
{
|
||||||
|
"containerPort": 9000,
|
||||||
|
"hostPort": 9000,
|
||||||
|
"protocol": "tcp"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"containerPort": 9090,
|
||||||
|
"hostPort": 9090,
|
||||||
|
"protocol": "tcp"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"volumesFrom": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"environment": [
|
||||||
|
{
|
||||||
|
"name": "DD_API_KEY",
|
||||||
|
"value": "ce10d932c47b358e81081ae67bd8c112"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ECS_FARGATE",
|
||||||
|
"value": "true"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "INTEGREAT_JOB",
|
||||||
|
"value": "square-import-job"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"essential": true,
|
||||||
|
"image": "public.ecr.aws/datadog/agent:latest",
|
||||||
|
"name": "datadog-agent"
|
||||||
|
}
|
||||||
|
]
|
||||||
66
terraform/staging-square-import-job-taskdef.json
Normal file
66
terraform/staging-square-import-job-taskdef.json
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"environment": [
|
||||||
|
{
|
||||||
|
"name": "config",
|
||||||
|
"value": "/usr/local/config/staging-background-worker.edn"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "DD_ENV",
|
||||||
|
"value": "staging"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "DD_SERVICE",
|
||||||
|
"value": "square-import-job"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"essential": true,
|
||||||
|
"image": "679918342773.dkr.ecr.us-east-1.amazonaws.com/integreat:staging",
|
||||||
|
"logConfiguration": {
|
||||||
|
"logDriver": "awslogs",
|
||||||
|
"options": {
|
||||||
|
"awslogs-group": "/ecs/integreat-background-worker-staging",
|
||||||
|
"awslogs-region": "us-east-1",
|
||||||
|
"awslogs-stream-prefix": "ecs"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"dockerLabels": {
|
||||||
|
"com.datadoghq.tags.env": "staging",
|
||||||
|
"com.datadoghq.tags.service": "square-import-job"
|
||||||
|
},
|
||||||
|
"mountPoints": [],
|
||||||
|
"name": "integreat-app",
|
||||||
|
"portMappings": [
|
||||||
|
{
|
||||||
|
"containerPort": 9000,
|
||||||
|
"hostPort": 9000,
|
||||||
|
"protocol": "tcp"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"containerPort": 9090,
|
||||||
|
"hostPort": 9090,
|
||||||
|
"protocol": "tcp"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"volumesFrom": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"environment": [
|
||||||
|
{
|
||||||
|
"name": "DD_API_KEY",
|
||||||
|
"value": "ce10d932c47b358e81081ae67bd8c112"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ECS_FARGATE",
|
||||||
|
"value": "true"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "INTEGREAT_JOB",
|
||||||
|
"value": "square-import-job"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"essential": true,
|
||||||
|
"image": "public.ecr.aws/datadog/agent:latest",
|
||||||
|
"name": "datadog-agent"
|
||||||
|
}
|
||||||
|
]
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"version": 4,
|
"version": 4,
|
||||||
"terraform_version": "0.14.4",
|
"terraform_version": "1.2.7",
|
||||||
"serial": 97,
|
"serial": 103,
|
||||||
"lineage": "9b630886-8cee-a57d-c7a2-4f19f13f9c51",
|
"lineage": "9b630886-8cee-a57d-c7a2-4f19f13f9c51",
|
||||||
"outputs": {
|
"outputs": {
|
||||||
"aws_access_key_id": {
|
"aws_access_key_id": {
|
||||||
@@ -92,7 +92,18 @@
|
|||||||
{
|
{
|
||||||
"schema_version": 0,
|
"schema_version": 0,
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"capacity_provider_strategy": [],
|
"capacity_provider_strategy": [
|
||||||
|
{
|
||||||
|
"base": 0,
|
||||||
|
"capacity_provider": "FARGATE_SPOT",
|
||||||
|
"weight": 5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"base": 1,
|
||||||
|
"capacity_provider": "FARGATE",
|
||||||
|
"weight": 1
|
||||||
|
}
|
||||||
|
],
|
||||||
"cluster": "arn:aws:ecs:us-east-1:679918342773:cluster/default",
|
"cluster": "arn:aws:ecs:us-east-1:679918342773:cluster/default",
|
||||||
"deployment_circuit_breaker": [
|
"deployment_circuit_breaker": [
|
||||||
{
|
{
|
||||||
@@ -107,14 +118,14 @@
|
|||||||
],
|
],
|
||||||
"deployment_maximum_percent": 200,
|
"deployment_maximum_percent": 200,
|
||||||
"deployment_minimum_healthy_percent": 100,
|
"deployment_minimum_healthy_percent": 100,
|
||||||
"desired_count": 4,
|
"desired_count": 2,
|
||||||
"enable_ecs_managed_tags": false,
|
"enable_ecs_managed_tags": false,
|
||||||
"enable_execute_command": false,
|
"enable_execute_command": false,
|
||||||
"force_new_deployment": null,
|
"force_new_deployment": null,
|
||||||
"health_check_grace_period_seconds": 600,
|
"health_check_grace_period_seconds": 600,
|
||||||
"iam_role": "aws-service-role",
|
"iam_role": "aws-service-role",
|
||||||
"id": "arn:aws:ecs:us-east-1:679918342773:service/integreat_app_prod",
|
"id": "arn:aws:ecs:us-east-1:679918342773:service/integreat_app_prod",
|
||||||
"launch_type": "FARGATE",
|
"launch_type": "",
|
||||||
"load_balancer": [
|
"load_balancer": [
|
||||||
{
|
{
|
||||||
"container_name": "integreat-app",
|
"container_name": "integreat-app",
|
||||||
@@ -153,11 +164,11 @@
|
|||||||
],
|
],
|
||||||
"tags": {},
|
"tags": {},
|
||||||
"tags_all": {},
|
"tags_all": {},
|
||||||
"task_definition": "arn:aws:ecs:us-east-1:679918342773:task-definition/integreat_app_prod:186",
|
"task_definition": "arn:aws:ecs:us-east-1:679918342773:task-definition/integreat_app_prod:351",
|
||||||
"timeouts": {
|
"timeouts": {
|
||||||
"delete": null
|
"delete": null
|
||||||
},
|
},
|
||||||
"wait_for_steady_state": null
|
"wait_for_steady_state": true
|
||||||
},
|
},
|
||||||
"sensitive_attributes": [],
|
"sensitive_attributes": [],
|
||||||
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiZGVsZXRlIjoxMjAwMDAwMDAwMDAwfX0=",
|
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiZGVsZXRlIjoxMjAwMDAwMDAwMDAwfX0=",
|
||||||
@@ -232,7 +243,7 @@
|
|||||||
],
|
],
|
||||||
"tags": {},
|
"tags": {},
|
||||||
"tags_all": {},
|
"tags_all": {},
|
||||||
"task_definition": "arn:aws:ecs:us-east-1:679918342773:task-definition/integreat_background-worker_prod:164",
|
"task_definition": "arn:aws:ecs:us-east-1:679918342773:task-definition/integreat_background-worker_prod:329",
|
||||||
"timeouts": {
|
"timeouts": {
|
||||||
"delete": null
|
"delete": null
|
||||||
},
|
},
|
||||||
@@ -275,7 +286,7 @@
|
|||||||
],
|
],
|
||||||
"revision": 187,
|
"revision": 187,
|
||||||
"runtime_platform": [],
|
"runtime_platform": [],
|
||||||
"tags": null,
|
"tags": {},
|
||||||
"tags_all": {},
|
"tags_all": {},
|
||||||
"task_role_arn": "arn:aws:iam::679918342773:role/datomic-ddb",
|
"task_role_arn": "arn:aws:iam::679918342773:role/datomic-ddb",
|
||||||
"volume": []
|
"volume": []
|
||||||
@@ -313,6 +324,44 @@
|
|||||||
],
|
],
|
||||||
"revision": 165,
|
"revision": 165,
|
||||||
"runtime_platform": [],
|
"runtime_platform": [],
|
||||||
|
"tags": {},
|
||||||
|
"tags_all": {},
|
||||||
|
"task_role_arn": "arn:aws:iam::679918342773:role/datomic-ddb",
|
||||||
|
"volume": []
|
||||||
|
},
|
||||||
|
"sensitive_attributes": [],
|
||||||
|
"private": "eyJzY2hlbWFfdmVyc2lvbiI6IjEifQ=="
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"mode": "managed",
|
||||||
|
"type": "aws_ecs_task_definition",
|
||||||
|
"name": "square_import_job",
|
||||||
|
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
|
||||||
|
"instances": [
|
||||||
|
{
|
||||||
|
"schema_version": 1,
|
||||||
|
"attributes": {
|
||||||
|
"arn": "arn:aws:ecs:us-east-1:679918342773:task-definition/square_import_job_prod:2",
|
||||||
|
"container_definitions": "[{\"cpu\":0,\"dockerLabels\":{\"com.datadoghq.tags.env\":\"prod\",\"com.datadoghq.tags.service\":\"square-import-job\"},\"environment\":[{\"name\":\"DD_ENV\",\"value\":\"prod\"},{\"name\":\"DD_SERVICE\",\"value\":\"square-import-job\"},{\"name\":\"config\",\"value\":\"/usr/local/config/prod-background-worker.edn\"}],\"essential\":true,\"image\":\"679918342773.dkr.ecr.us-east-1.amazonaws.com/integreat:prod\",\"logConfiguration\":{\"logDriver\":\"awslogs\",\"options\":{\"awslogs-group\":\"/ecs/integreat-background-worker-prod\",\"awslogs-region\":\"us-east-1\",\"awslogs-stream-prefix\":\"ecs\"}},\"mountPoints\":[],\"name\":\"integreat-app\",\"portMappings\":[{\"containerPort\":9000,\"hostPort\":9000,\"protocol\":\"tcp\"},{\"containerPort\":9090,\"hostPort\":9090,\"protocol\":\"tcp\"}],\"volumesFrom\":[]},{\"cpu\":0,\"environment\":[{\"name\":\"DD_API_KEY\",\"value\":\"ce10d932c47b358e81081ae67bd8c112\"},{\"name\":\"ECS_FARGATE\",\"value\":\"true\"},{\"name\":\"INTEGREAT_JOB\",\"value\":\"square-import-job\"}],\"essential\":true,\"image\":\"public.ecr.aws/datadog/agent:latest\",\"mountPoints\":[],\"name\":\"datadog-agent\",\"portMappings\":[],\"volumesFrom\":[]}]",
|
||||||
|
"cpu": "2048",
|
||||||
|
"ephemeral_storage": [],
|
||||||
|
"execution_role_arn": "arn:aws:iam::679918342773:role/ecsTaskExecutionRole",
|
||||||
|
"family": "square_import_job_prod",
|
||||||
|
"id": "square_import_job_prod",
|
||||||
|
"inference_accelerator": [],
|
||||||
|
"ipc_mode": "",
|
||||||
|
"memory": "8192",
|
||||||
|
"network_mode": "awsvpc",
|
||||||
|
"pid_mode": "",
|
||||||
|
"placement_constraints": [],
|
||||||
|
"proxy_configuration": [],
|
||||||
|
"requires_compatibilities": [
|
||||||
|
"FARGATE"
|
||||||
|
],
|
||||||
|
"revision": 2,
|
||||||
|
"runtime_platform": [],
|
||||||
"tags": null,
|
"tags": null,
|
||||||
"tags_all": {},
|
"tags_all": {},
|
||||||
"task_role_arn": "arn:aws:iam::679918342773:role/datomic-ddb",
|
"task_role_arn": "arn:aws:iam::679918342773:role/datomic-ddb",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"version": 4,
|
"version": 4,
|
||||||
"terraform_version": "0.14.4",
|
"terraform_version": "1.2.7",
|
||||||
"serial": 92,
|
"serial": 100,
|
||||||
"lineage": "9b630886-8cee-a57d-c7a2-4f19f13f9c51",
|
"lineage": "9b630886-8cee-a57d-c7a2-4f19f13f9c51",
|
||||||
"outputs": {
|
"outputs": {
|
||||||
"aws_access_key_id": {
|
"aws_access_key_id": {
|
||||||
@@ -92,7 +92,18 @@
|
|||||||
{
|
{
|
||||||
"schema_version": 0,
|
"schema_version": 0,
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"capacity_provider_strategy": [],
|
"capacity_provider_strategy": [
|
||||||
|
{
|
||||||
|
"base": 0,
|
||||||
|
"capacity_provider": "FARGATE_SPOT",
|
||||||
|
"weight": 5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"base": 1,
|
||||||
|
"capacity_provider": "FARGATE",
|
||||||
|
"weight": 1
|
||||||
|
}
|
||||||
|
],
|
||||||
"cluster": "arn:aws:ecs:us-east-1:679918342773:cluster/default",
|
"cluster": "arn:aws:ecs:us-east-1:679918342773:cluster/default",
|
||||||
"deployment_circuit_breaker": [
|
"deployment_circuit_breaker": [
|
||||||
{
|
{
|
||||||
@@ -107,14 +118,14 @@
|
|||||||
],
|
],
|
||||||
"deployment_maximum_percent": 200,
|
"deployment_maximum_percent": 200,
|
||||||
"deployment_minimum_healthy_percent": 100,
|
"deployment_minimum_healthy_percent": 100,
|
||||||
"desired_count": 4,
|
"desired_count": 2,
|
||||||
"enable_ecs_managed_tags": false,
|
"enable_ecs_managed_tags": false,
|
||||||
"enable_execute_command": false,
|
"enable_execute_command": false,
|
||||||
"force_new_deployment": null,
|
"force_new_deployment": null,
|
||||||
"health_check_grace_period_seconds": 600,
|
"health_check_grace_period_seconds": 600,
|
||||||
"iam_role": "aws-service-role",
|
"iam_role": "aws-service-role",
|
||||||
"id": "arn:aws:ecs:us-east-1:679918342773:service/integreat_app_prod",
|
"id": "arn:aws:ecs:us-east-1:679918342773:service/integreat_app_prod",
|
||||||
"launch_type": "FARGATE",
|
"launch_type": "",
|
||||||
"load_balancer": [
|
"load_balancer": [
|
||||||
{
|
{
|
||||||
"container_name": "integreat-app",
|
"container_name": "integreat-app",
|
||||||
@@ -153,11 +164,11 @@
|
|||||||
],
|
],
|
||||||
"tags": {},
|
"tags": {},
|
||||||
"tags_all": {},
|
"tags_all": {},
|
||||||
"task_definition": "arn:aws:ecs:us-east-1:679918342773:task-definition/integreat_app_prod:167",
|
"task_definition": "arn:aws:ecs:us-east-1:679918342773:task-definition/integreat_app_prod:351",
|
||||||
"timeouts": {
|
"timeouts": {
|
||||||
"delete": null
|
"delete": null
|
||||||
},
|
},
|
||||||
"wait_for_steady_state": null
|
"wait_for_steady_state": true
|
||||||
},
|
},
|
||||||
"sensitive_attributes": [],
|
"sensitive_attributes": [],
|
||||||
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiZGVsZXRlIjoxMjAwMDAwMDAwMDAwfX0=",
|
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiZGVsZXRlIjoxMjAwMDAwMDAwMDAwfX0=",
|
||||||
@@ -232,7 +243,7 @@
|
|||||||
],
|
],
|
||||||
"tags": {},
|
"tags": {},
|
||||||
"tags_all": {},
|
"tags_all": {},
|
||||||
"task_definition": "arn:aws:ecs:us-east-1:679918342773:task-definition/integreat_background-worker_prod:145",
|
"task_definition": "arn:aws:ecs:us-east-1:679918342773:task-definition/integreat_background-worker_prod:329",
|
||||||
"timeouts": {
|
"timeouts": {
|
||||||
"delete": null
|
"delete": null
|
||||||
},
|
},
|
||||||
@@ -241,8 +252,8 @@
|
|||||||
"sensitive_attributes": [],
|
"sensitive_attributes": [],
|
||||||
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiZGVsZXRlIjoxMjAwMDAwMDAwMDAwfX0=",
|
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiZGVsZXRlIjoxMjAwMDAwMDAwMDAwfX0=",
|
||||||
"dependencies": [
|
"dependencies": [
|
||||||
"aws_service_discovery_service.background_worker_service",
|
"aws_ecs_task_definition.integreat_background_worker",
|
||||||
"aws_ecs_task_definition.integreat_background_worker"
|
"aws_service_discovery_service.background_worker_service"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -256,8 +267,8 @@
|
|||||||
{
|
{
|
||||||
"schema_version": 1,
|
"schema_version": 1,
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"arn": "arn:aws:ecs:us-east-1:679918342773:task-definition/integreat_app_prod:167",
|
"arn": "arn:aws:ecs:us-east-1:679918342773:task-definition/integreat_app_prod:187",
|
||||||
"container_definitions": "[{\"cpu\":0,\"environment\":[{\"name\":\"config\",\"value\":\"/usr/local/config/prod.edn\"}],\"essential\":true,\"image\":\"679918342773.dkr.ecr.us-east-1.amazonaws.com/integreat\",\"logConfiguration\":{\"logDriver\":\"awslogs\",\"options\":{\"awslogs-group\":\"/ecs/integreat-app-prod\",\"awslogs-region\":\"us-east-1\",\"awslogs-stream-prefix\":\"ecs\"}},\"mountPoints\":[],\"name\":\"integreat-app\",\"portMappings\":[{\"containerPort\":3000,\"hostPort\":3000,\"protocol\":\"tcp\"},{\"containerPort\":9000,\"hostPort\":9000,\"protocol\":\"tcp\"},{\"containerPort\":9090,\"hostPort\":9090,\"protocol\":\"tcp\"}],\"volumesFrom\":[]}]",
|
"container_definitions": "[{\"cpu\":0,\"dockerLabels\":{\"com.datadoghq.tags.env\":\"prod\",\"com.datadoghq.tags.service\":\"integreat-app\"},\"environment\":[{\"name\":\"DD_ENV\",\"value\":\"prod\"},{\"name\":\"DD_SERVICE\",\"value\":\"integreat-app\"},{\"name\":\"config\",\"value\":\"/usr/local/config/prod.edn\"}],\"essential\":true,\"image\":\"679918342773.dkr.ecr.us-east-1.amazonaws.com/integreat\",\"logConfiguration\":{\"logDriver\":\"awslogs\",\"options\":{\"awslogs-group\":\"/ecs/integreat-app-prod\",\"awslogs-region\":\"us-east-1\",\"awslogs-stream-prefix\":\"ecs\"}},\"mountPoints\":[],\"name\":\"integreat-app\",\"portMappings\":[{\"containerPort\":3000,\"hostPort\":3000,\"protocol\":\"tcp\"},{\"containerPort\":9000,\"hostPort\":9000,\"protocol\":\"tcp\"},{\"containerPort\":9090,\"hostPort\":9090,\"protocol\":\"tcp\"}],\"volumesFrom\":[]},{\"cpu\":0,\"environment\":[{\"name\":\"DD_API_KEY\",\"value\":\"ce10d932c47b358e81081ae67bd8c112\"},{\"name\":\"ECS_FARGATE\",\"value\":\"true\"}],\"essential\":true,\"image\":\"public.ecr.aws/datadog/agent:latest\",\"mountPoints\":[],\"name\":\"datadog-agent\",\"portMappings\":[],\"volumesFrom\":[]}]",
|
||||||
"cpu": "2048",
|
"cpu": "2048",
|
||||||
"ephemeral_storage": [],
|
"ephemeral_storage": [],
|
||||||
"execution_role_arn": "arn:aws:iam::679918342773:role/ecsTaskExecutionRole",
|
"execution_role_arn": "arn:aws:iam::679918342773:role/ecsTaskExecutionRole",
|
||||||
@@ -273,7 +284,7 @@
|
|||||||
"requires_compatibilities": [
|
"requires_compatibilities": [
|
||||||
"FARGATE"
|
"FARGATE"
|
||||||
],
|
],
|
||||||
"revision": 167,
|
"revision": 187,
|
||||||
"runtime_platform": [],
|
"runtime_platform": [],
|
||||||
"tags": {},
|
"tags": {},
|
||||||
"tags_all": {},
|
"tags_all": {},
|
||||||
@@ -294,8 +305,8 @@
|
|||||||
{
|
{
|
||||||
"schema_version": 1,
|
"schema_version": 1,
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"arn": "arn:aws:ecs:us-east-1:679918342773:task-definition/integreat_background-worker_prod:145",
|
"arn": "arn:aws:ecs:us-east-1:679918342773:task-definition/integreat_background-worker_prod:165",
|
||||||
"container_definitions": "[{\"cpu\":0,\"environment\":[{\"name\":\"config\",\"value\":\"/usr/local/config/prod-background-worker.edn\"}],\"essential\":true,\"image\":\"679918342773.dkr.ecr.us-east-1.amazonaws.com/integreat\",\"logConfiguration\":{\"logDriver\":\"awslogs\",\"options\":{\"awslogs-group\":\"/ecs/integreat-background-worker-prod\",\"awslogs-region\":\"us-east-1\",\"awslogs-stream-prefix\":\"ecs\"}},\"mountPoints\":[],\"name\":\"integreat-app\",\"portMappings\":[{\"containerPort\":9000,\"hostPort\":9000,\"protocol\":\"tcp\"},{\"containerPort\":9090,\"hostPort\":9090,\"protocol\":\"tcp\"}],\"volumesFrom\":[]}]",
|
"container_definitions": "[{\"cpu\":0,\"dockerLabels\":{\"com.datadoghq.tags.env\":\"prod\",\"com.datadoghq.tags.service\":\"integreat-background-worker\"},\"environment\":[{\"name\":\"DD_ENV\",\"value\":\"prod\"},{\"name\":\"DD_SERVICE\",\"value\":\"integreat-background-worker\"},{\"name\":\"config\",\"value\":\"/usr/local/config/prod-background-worker.edn\"}],\"essential\":true,\"image\":\"679918342773.dkr.ecr.us-east-1.amazonaws.com/integreat:prod\",\"logConfiguration\":{\"logDriver\":\"awslogs\",\"options\":{\"awslogs-group\":\"/ecs/integreat-background-worker-prod\",\"awslogs-region\":\"us-east-1\",\"awslogs-stream-prefix\":\"ecs\"}},\"mountPoints\":[],\"name\":\"integreat-app\",\"portMappings\":[{\"containerPort\":9000,\"hostPort\":9000,\"protocol\":\"tcp\"},{\"containerPort\":9090,\"hostPort\":9090,\"protocol\":\"tcp\"}],\"volumesFrom\":[]},{\"cpu\":0,\"environment\":[{\"name\":\"DD_API_KEY\",\"value\":\"ce10d932c47b358e81081ae67bd8c112\"},{\"name\":\"ECS_FARGATE\",\"value\":\"true\"}],\"essential\":true,\"image\":\"public.ecr.aws/datadog/agent:latest\",\"mountPoints\":[],\"name\":\"datadog-agent\",\"portMappings\":[],\"volumesFrom\":[]}]",
|
||||||
"cpu": "1024",
|
"cpu": "1024",
|
||||||
"ephemeral_storage": [],
|
"ephemeral_storage": [],
|
||||||
"execution_role_arn": "arn:aws:iam::679918342773:role/ecsTaskExecutionRole",
|
"execution_role_arn": "arn:aws:iam::679918342773:role/ecsTaskExecutionRole",
|
||||||
@@ -311,7 +322,7 @@
|
|||||||
"requires_compatibilities": [
|
"requires_compatibilities": [
|
||||||
"FARGATE"
|
"FARGATE"
|
||||||
],
|
],
|
||||||
"revision": 145,
|
"revision": 165,
|
||||||
"runtime_platform": [],
|
"runtime_platform": [],
|
||||||
"tags": {},
|
"tags": {},
|
||||||
"tags_all": {},
|
"tags_all": {},
|
||||||
@@ -323,6 +334,44 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"mode": "managed",
|
||||||
|
"type": "aws_ecs_task_definition",
|
||||||
|
"name": "square_import_job",
|
||||||
|
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
|
||||||
|
"instances": [
|
||||||
|
{
|
||||||
|
"schema_version": 1,
|
||||||
|
"attributes": {
|
||||||
|
"arn": "arn:aws:ecs:us-east-1:679918342773:task-definition/square_import_job_prod:1",
|
||||||
|
"container_definitions": "[{\"cpu\":0,\"dockerLabels\":{\"com.datadoghq.tags.env\":\"prod\",\"com.datadoghq.tags.service\":\"square-import-job\"},\"environment\":[{\"name\":\"DD_ENV\",\"value\":\"prod\"},{\"name\":\"DD_SERVICE\",\"value\":\"square-import-job\"},{\"name\":\"config\",\"value\":\"/usr/local/config/prod-background-worker.edn\"}],\"essential\":true,\"image\":\"679918342773.dkr.ecr.us-east-1.amazonaws.com/integreat:prod\",\"logConfiguration\":{\"logDriver\":\"awslogs\",\"options\":{\"awslogs-group\":\"/ecs/integreat-background-worker-prod\",\"awslogs-region\":\"us-east-1\",\"awslogs-stream-prefix\":\"ecs\"}},\"mountPoints\":[],\"name\":\"integreat-app\",\"portMappings\":[{\"containerPort\":9000,\"hostPort\":9000,\"protocol\":\"tcp\"},{\"containerPort\":9090,\"hostPort\":9090,\"protocol\":\"tcp\"}],\"volumesFrom\":[]},{\"cpu\":0,\"environment\":[{\"name\":\"DD_API_KEY\",\"value\":\"ce10d932c47b358e81081ae67bd8c112\"},{\"name\":\"ECS_FARGATE\",\"value\":\"true\"}],\"essential\":true,\"image\":\"public.ecr.aws/datadog/agent:latest\",\"mountPoints\":[],\"name\":\"datadog-agent\",\"portMappings\":[],\"volumesFrom\":[]}]",
|
||||||
|
"cpu": "2048",
|
||||||
|
"ephemeral_storage": [],
|
||||||
|
"execution_role_arn": "arn:aws:iam::679918342773:role/ecsTaskExecutionRole",
|
||||||
|
"family": "square_import_job_prod",
|
||||||
|
"id": "square_import_job_prod",
|
||||||
|
"inference_accelerator": [],
|
||||||
|
"ipc_mode": "",
|
||||||
|
"memory": "8192",
|
||||||
|
"network_mode": "awsvpc",
|
||||||
|
"pid_mode": "",
|
||||||
|
"placement_constraints": [],
|
||||||
|
"proxy_configuration": [],
|
||||||
|
"requires_compatibilities": [
|
||||||
|
"FARGATE"
|
||||||
|
],
|
||||||
|
"revision": 1,
|
||||||
|
"runtime_platform": [],
|
||||||
|
"tags": null,
|
||||||
|
"tags_all": {},
|
||||||
|
"task_role_arn": "arn:aws:iam::679918342773:role/datomic-ddb",
|
||||||
|
"volume": []
|
||||||
|
},
|
||||||
|
"sensitive_attributes": [],
|
||||||
|
"private": "eyJzY2hlbWFfdmVyc2lvbiI6IjEifQ=="
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"mode": "managed",
|
"mode": "managed",
|
||||||
"type": "aws_iam_access_key",
|
"type": "aws_iam_access_key",
|
||||||
@@ -1086,7 +1135,7 @@
|
|||||||
"receive_wait_time_seconds": 0,
|
"receive_wait_time_seconds": 0,
|
||||||
"redrive_policy": "",
|
"redrive_policy": "",
|
||||||
"sqs_managed_sse_enabled": false,
|
"sqs_managed_sse_enabled": false,
|
||||||
"tags": null,
|
"tags": {},
|
||||||
"tags_all": {},
|
"tags_all": {},
|
||||||
"url": "https://sqs.us-east-1.amazonaws.com/679918342773/integreat-background-request-prod",
|
"url": "https://sqs.us-east-1.amazonaws.com/679918342773/integreat-background-request-prod",
|
||||||
"visibility_timeout_seconds": 30
|
"visibility_timeout_seconds": 30
|
||||||
|
|||||||
Reference in New Issue
Block a user