amazon web services – How to pass input within AWS Step Functions using Go Lambdas?-ThrowExceptions

Exception or error:

I’m constructing my first state machine using AWS Step Functions and inside the state machine I’m invoking Go Lambdas. I’m starting the execution of the state machine from another Lambda that passes some input I’d like to reference inside different parts of the state machine. I notice I’m losing that input between the LambdaFunctionScheduled stage and the LambdaFunctionStarted stage and as a result I don’t seem to have an event in my Lambda where I can grab the pieces of info I need. Am I missing a step?

Here is the state machine I’m creating in Terraform:

resource "aws_sfn_state_machine" "bulk_state_machine" {
      name     = "bulk_state_machine"
      role_arn = "${aws_iam_role.bulk_state_machine_role.arn}"

      definition = <<EOF
      "Comment": "A state machine to orchestrate a series of Lambdas that complete the bulk provisioning process",
      "StartAt": "CreateBuckets",
      "States": {
        "CreateBuckets": {
          "Type": "Task",
          "Resource": "${aws_lambda_function.createBulkProvisionBuckets.arn}",
          "End": true

And this is the struct of input I’m marshalling into JSON and sending along as input in the Lambda that begins execution of the Step Function:

sfnInput := models.BulkSFNInput{
        DefaultRegion: brand.DefaultRegion,
        OtherRegions:  brand.OtherRegions,
        ACMARN:        brand.ACMARN,

Image of my step function details

How to solve:

Leave a Reply

Your email address will not be published. Required fields are marked *