Skip to content

bug: stepfunction sends sqs Message without MessageAttributes #11109

@SchmitzChristian

Description

@SchmitzChristian

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When a step function send a sqs message it is always without MessageAttributes when changing from legacy provider to the new one.

Also I have to add the events service when changing to new provider, is this intentional?

Expected Behavior

Step function send sqs with configured MessageAttributes

How are you starting LocalStack?

With a docker-compose file

Steps To Reproduce

How are you starting localstack (e.g., bin/localstack command, arguments, or docker-compose.yml)

docker compose file:

version: '3.8'
services:
  localstack:
    image: localstack/localstack:3.5.0
    ports:
      - "4570:4566"
    volumes:
      - ./localstack/init-localstack.sh:/etc/localstack/init/ready.d/init-localstack.sh
      - /var/run/docker.sock:/var/run/docker.sock
      - /var/lib/localstack:/var/lib/localstack
    environment:
      - SERVICES=stepfunctions,sqs,events
      - START_WEB=0
      - DEBUG=1

init-localstack.sh:

`#!/usr/bin/env bash

awslocal sqs create-queue --queue-name test-token --region eu-central-1

awslocal stepfunctions create-state-machine \
  --name test-state-machine \
  --region eu-central-1 \
  --role-arn arn:aws:iam::012345678901:role/DummyRole \
  --definition '{
  "StartAt": "first",
  "States": {
    "first": {
      "Type": "Task",
      "Resource": "arn:aws:states:::sqs:sendMessage.waitForTaskToken",
      "Parameters": {
        "QueueUrl": "http://localstack:4566/000000000000/test-token",
        "MessageBody": {"TaskToken.$": "$$.Task.Token"},
        "MessageAttributes": {
          "task_token": {
            "DataType": "String",
            "StringValue.$": "$$.Task.Token"
          },
          "test": {
            "DataType": "String",
             "StringValue": "testMessageAttribute"
          }
        }
      },
      "ResultSelector": {
        "result.$": "States.StringToJson($.result)"
      },
      "End": true
    }
  }
}'

Client commands (e.g., AWS SDK code snippet, or sequence of "awslocal" commands)

awslocal stepfunctions start-execution --state-machine-arn "arn:aws:states:eu-central-1:000000000000:stateMachine:test-state-machine"

Note: start the esecution with awslocal does not work for me right now, with typescript it works...

After that get the SQS message with your preferred method

Environment

- OS: Ubuntu 22.04 
- LocalStack version: 3.5.0
  LocalStack build date: 2024-06-13
  LocalStack build git hash: 54edb407d

Anything else?

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions