Error, AWS Step Function DynamoDB Put Item, Map and List inside Map

1

Hello, I'm having troubles inserting an item in DynamoDB with this Structure from Step Functions.

{
    "id":{
        "S":""
    },
    "state_machine_execution_id":{
        "S":""
    },
    "timestamp":{
        "S":""
    },
    "map_param1":{
        "M":{
            "sub_map1":{
                "M":{ }
            },
            "sub_map2":{
                "S":""
            },
            "sub_map3":{
                "M":{ }
            },
            "sub_mapN":{
                "M":{ }
            },
            "List_1":{
                "L":[ ]
            },
            "List_2":{
                "L":[ ]
            }
        }
    }
}

This is the statement that I am trying to make it work without success

{
    "DynamoDB Save Item":{
        "Type":"Task",
        "Resource":"arn:aws:states:::dynamodb:putItem",
        "Parameters":{
            "TableName.$":"$.TableName",
            "Item":{
                "id.$":"$.id",
                "state_machine_execution_id.$":"$$.Execution.Id",
                "timestamp.$":"$.timestamp",
                "map_param1":{
                    "M":{
                        "M.$":"$.var_for_map_params",
                        "List_1":{
                            "L.$":"$.List_1"
                        },
                        "List_2":{
                            "L.$":"$.List_2"
                        }
                    }
                }
            }
        }
    }
}

I'm getting this error

The Parameters "{A lot of data flow} "could not be used to start the Task: [The field \"foo\" is not supported by Step Functions]"

This "foo" field, has nothing to do, if make changes to the Parameters: map_param1 statement in Step Function works example This works ok

"map_param1":{
        "M.$":"$.var_for_map_params"
}

And This works ok too

"map_param1":{
    "M":{
        "List_1":{
            "L.$":"$.List_1"
        },
        "List_2":{
            "L.$":"$.List_2"
        }
    }
}

But not this (the combination)

"map_param1":{
    "M":{
        "M.$":"$.var_for_map_params",
        "List_1":{
            "L.$":"$.List_1"
        },
        "List_2":{
            "L.$":"$.List_2"
        }
    }
}

Can someone help me?
thanks a lot
Regards

gefragt vor 2 Jahren1038 Aufrufe
1 Antwort
0

Your exact definition worked for me with the following input:

{
  "TableName": "Table",
  "id": "id",
  "timestamp": "timestamp",
  "var_for_map_params": "var_for_map_params",
  "List_1": [
    "item1",
    "item2"
  ],
  "List_2": [
    "item1",
    "item2"
  ]
}

Maybe something with the payload itself. Can you share the input?

profile pictureAWS
EXPERTE
Uri
beantwortet vor 2 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen