Skip to content

Commit

Permalink
fix: address typo in task definition variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
Luigi Di Fraia authored and luigidifraiawork committed Jun 14, 2024
1 parent d6e737b commit ba98a1c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def lambda_handler(event, context):
pipeline_enabled = None
TASK_CLUSTER = None
TASK_CONTAINER = None
TASK_DEFINITON = None
TASK_DEFINITION = None
TASK_SUBNET = None
TASK_SECURITYGROUP = None
response = ssm.get_parameters(
Expand All @@ -22,7 +22,7 @@ def lambda_handler(event, context):
'PIPELINE_ECS_MAX_TASKS',
'PIPELINE_ECS_CLUSTER',
'PIPELINE_ECS_TASK_CONTAINER',
'PIPELINE_ECS_TASK_DEFINITON',
'PIPELINE_ECS_TASK_DEFINITION',
'PIPELINE_ECS_TASK_SECURITYGROUP',
'PIPELINE_ECS_TASK_SUBNET',
'PIPELINE_S3_DEST_PREFIX'
Expand All @@ -42,21 +42,21 @@ def lambda_handler(event, context):
TASK_CLUSTER = param['Value']
if param['Name'] == 'PIPELINE_ECS_TASK_CONTAINER':
TASK_CONTAINER = param['Value']
if param['Name'] == 'PIPELINE_ECS_TASK_DEFINITON':
if param['Name'] == 'PIPELINE_ECS_TASK_DEFINITION':
taskdef = param['Value']
TASK_DEFINITON = taskdef[:taskdef.rindex(':')]
TASK_DEFINITION = taskdef[:taskdef.rindex(':')]
if param['Name'] == 'PIPELINE_ECS_TASK_SUBNET':
TASK_SUBNET = param['Value']
if param['Name'] == 'PIPELINE_ECS_TASK_SECURITYGROUP':
TASK_SECURITYGROUP = param['Value']
if param['Name'] == 'PIPELINE_S3_DEST_PREFIX':
S3_DEST_PREFIX = param['Value']
if (sqs_url and pipeline_enabled and max_tasks and
TASK_CLUSTER and TASK_CONTAINER and TASK_DEFINITON and TASK_SUBNET and TASK_SECURITYGROUP):
TASK_CLUSTER and TASK_CONTAINER and TASK_DEFINITION and TASK_SUBNET and TASK_SECURITYGROUP):
max_tasks = int(max_tasks)
else:
raise Exception("Required SSM: PIPELINE_ECS_MAX_TASKS,PIPELINE_UNPROCESSED_SQS_URL,PIPELINE_ENABLED,PIPELINE_ECS_CLUSTER,"
"PIPELINE_ECS_TASK_CONTAINER,PIPELINE_ECS_TASK_DEFINITON,PIPELINE_ECS_TASK_SUBNET,PIPELINE_ECS_TASK_SECURITYGROUP,PIPELINE_S3_DEST_PREFIX")
"PIPELINE_ECS_TASK_CONTAINER,PIPELINE_ECS_TASK_DEFINITION,PIPELINE_ECS_TASK_SUBNET,PIPELINE_ECS_TASK_SECURITYGROUP,PIPELINE_S3_DEST_PREFIX")
if (pipeline_enabled != "1"):
print("ECS Pipeline is Disabled. Not starting tasks via Lambda.")
return
Expand Down Expand Up @@ -89,7 +89,7 @@ def lambda_handler(event, context):
}
],
cluster=TASK_CLUSTER,
taskDefinition=TASK_DEFINITON,
taskDefinition=TASK_DEFINITION,
overrides={
'containerOverrides': [
{
Expand Down
2 changes: 1 addition & 1 deletion terraform/fargate-examples/queue-processing/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ resource "aws_ssm_parameter" "ecs_cluster_name" {
}

resource "aws_ssm_parameter" "ecs_task_definition" {
name = "PIPELINE_ECS_TASK_DEFINITON"
name = "PIPELINE_ECS_TASK_DEFINITION"
type = "String"
value = module.ecs_service.task_definition_arn

Expand Down

0 comments on commit ba98a1c

Please sign in to comment.