diff --git a/fargate/compute-node-provisioner/terraform/infrastructure/compute-gateway-lambda/lambda_function.py b/fargate/compute-node-provisioner/terraform/infrastructure/compute-gateway-lambda/lambda_function.py index 967abbd..8bc9810 100644 --- a/fargate/compute-node-provisioner/terraform/infrastructure/compute-gateway-lambda/lambda_function.py +++ b/fargate/compute-node-provisioner/terraform/infrastructure/compute-gateway-lambda/lambda_function.py @@ -19,6 +19,14 @@ def lambda_handler(event, context): event['isBase64Encoded'] = False json_body = json.loads(event['body']) integration_id = json_body['integrationId'] + + # cancel always defaults to false + # workflow manager will kill a process if cancel: true is sent + cancel = False + # Check if cancel was sent in body + if 'cancel' in json_body: + cancel = json_body['cancel'] + sqs_url = os.environ['SQS_URL'] # gets api key secrets @@ -45,7 +53,7 @@ def lambda_handler(event, context): api_key, api_secret = list(d.items())[0] print(api_key, api_secret) - message = {"integrationId": integration_id, "api_key": api_key, "api_secret" : api_secret} + message = {"integrationId": integration_id, "api_key": api_key, "api_secret" : api_secret, "cancel": cancel} sqs = boto3_client('sqs') response = sqs.send_message(QueueUrl=sqs_url, MessageBody=json.dumps(message))