Skip to content

Commit

Permalink
copy the rfp form
Browse files Browse the repository at this point in the history
  • Loading branch information
joelbalcaen committed Apr 24, 2024
1 parent 802ff40 commit 04a2d55
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions state_machines/email_form_fill/state_machine.tf
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,22 @@ resource "aws_sfn_state_machine" "sfn_state_machine" {
}
}
},
{
"StartAt": "Create copy of the RFP Form",
"States": {
"Create copy of the RFP Form": {
"Type": "Task",
"End": true,
"Parameters": {
"CopySource.$": "States.Format('{}/rfp/standard/rfp.docx', $.bucket)",
"Bucket.$": "$.bucket",
"Key.$": "States.Format('rfp/{}/formulaire_ao.docx', $.email_id)"
},
"Resource": "arn:aws:states:::aws-sdk:s3:copyObject",
"Comment": "Copy the form to be filled into this execution's email folder"
}
}
},
{
"StartAt": "Download email attachments",
"States": {
Expand Down Expand Up @@ -147,24 +163,27 @@ resource "aws_sfn_state_machine" "sfn_state_machine" {
"Choice": {
"Choices": [
{
"Variable": "$",
"Next": "Rich PDF Ingestion",
"StringMatches": "*.pdf",
"Next": "Rich PDF Ingestion"
"Variable": "$"
}
],
"Default": "Pass",
"Type": "Choice"
},
"Pass": {
"End": true,
"Type": "Pass"
"Type": "Pass",
"Comment": "Attachment is not PDF, no other processing needed."
},
"Rich PDF Ingestion": {
"End": true,
"OutputPath": "$.Payload",
"Parameters": {
"FunctionName": "arn:aws:lambda:us-east-1:446872271111:function:rich_pdf_ingestion:$LATEST",
"Payload.$": "$"
"Payload": {
"path.$": "$"
}
},
"Resource": "arn:aws:states:::lambda:invoke",
"Retry": [
Expand Down

0 comments on commit 04a2d55

Please sign in to comment.