forked from nasa/cumulus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpython_reference_workflow.tf
51 lines (41 loc) · 1.47 KB
/
python_reference_workflow.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
resource "aws_sfn_activity" "ecs_task_python_processing_service" {
name = "${var.prefix}-EcsTaskPythonProcess"
tags = local.tags
}
data "aws_ecr_repository" "cumulus_process_activity" {
name = "cumulus-process-activity"
}
module "python_processing_service" {
source = "../../tf-modules/cumulus_ecs_service"
prefix = var.prefix
name = "PythonProcess"
tags = local.tags
cluster_arn = module.cumulus.ecs_cluster_arn
desired_count = 1
image = "${data.aws_ecr_repository.cumulus_process_activity.repository_url}:${var.cumulus_process_activity_version}"
cpu = 400
memory_reservation = 700
environment = {
AWS_DEFAULT_REGION = data.aws_region.current.name
ACTIVITY_ARN = aws_sfn_activity.ecs_task_python_processing_service.id
}
command = [
"/usr/local/bin/python",
"process_activity.py"
]
}
module "python_reference_workflow" {
source = "../../tf-modules/workflow"
prefix = var.prefix
name = "PythonReferenceWorkflow"
workflow_config = module.cumulus.workflow_config
system_bucket = var.system_bucket
tags = local.tags
state_machine_definition = templatefile(
"${path.module}/python_reference_workflow.asl.json",
{
python_reference_task_arn: aws_lambda_function.python_reference_task.arn,
python_processing_service_id: aws_sfn_activity.ecs_task_python_processing_service.id
}
)
}