Skip to content

Commit

Permalink
update state machine name
Browse files Browse the repository at this point in the history
  • Loading branch information
joelbalcaen committed Apr 24, 2024
1 parent 92f3e26 commit c75cccf
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions state_machines/email_form_fill/state_machine.tf
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ resource "aws_iam_role_policy" "sfn_lambda_invoke_access" {


resource "aws_sfn_state_machine" "sfn_state_machine" {
name = "my-state-machine"
name = "esta-rfp-form-filler"
role_arn = aws_iam_role.iam_for_sfn.arn
definition = jsonencode({
"Comment": "A description of my state machine",
"Comment": "Retrieves attachments from an email and invokes an AI with the email attachments and a predefied set of promts. A form document is then filled with the AI responses and sent back to the user.",
"StartAt": "Map SES email",
"States": {
"Map SES email": {
Expand Down Expand Up @@ -238,8 +238,9 @@ resource "aws_sfn_state_machine" "sfn_state_machine" {
"Next": "Get promps responses",
"ResultPath": "$.Body",
"ResultSelector": {
"Body.$": "States.StringToJson($.Body)"
}
"parsed_JSON.$": "States.StringToJson($.Body)"
},
"Comment": "Gets the promps s3 object and convert the escaped JSON to JSON"
},
"Get promps responses": {
"Type": "Map",
Expand Down Expand Up @@ -282,7 +283,7 @@ resource "aws_sfn_state_machine" "sfn_state_machine" {
}
},
"End": true,
"ItemsPath": "$.Body.Body.prompts"
"ItemsPath": "$.Body.parsed_JSON.prompts"
}
}
}
Expand Down

0 comments on commit c75cccf

Please sign in to comment.