Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Step Functions Label property not supported #8842

Closed
arielalas opened this issue Aug 5, 2024 · 4 comments
Closed

Step Functions Label property not supported #8842

arielalas opened this issue Aug 5, 2024 · 4 comments
Assignees
Labels
bug This issue is a bug. cloudformation package-deploy customization Issues related to CLI customizations (located in /awscli/customizations) p2 This is a standard priority issue response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. third-party This issue is related to third-party libraries or applications.

Comments

@arielalas
Copy link

Describe the bug

When running the following command to deploy a Step Function in localstack:

aws cloudformation deploy --stack-name stack1 --template-file output/us-east-1-combined-cft.json --endpoint-url=http://localhost:4566

I get the following error:

CFn resource failed to deploy: qa-7ps-orchestrator (An error occurred (InvalidDefinition) when calling the CreateStateMachine operation: ASLParserException ['line 1:5677, at "Label", mismatched input \'"Label"\' expecting {\'"Comment"\', \'"Type"\', \'"Choices"\', \'"Default"\', \'"Branches"\', \'"SecondsPath"\', \'"Seconds"\', \'"TimestampPath"\', \'"Timestamp"\', \'"TimeoutSeconds"\', \'"TimeoutSecondsPath"\', \'"HeartbeatSeconds"\', \'"HeartbeatSecondsPath"\', \'"ItemProcessor"\', \'"Iterator"\', \'"ItemSelector"\', \'"MaxConcurrencyPath"\', \'"MaxConcurrency"\', \'"Resource"\', \'"InputPath"\', \'"OutputPath"\', \'"ItemsPath"\', \'"ResultPath"\', \'"Result"\', \'"Parameters"\', \'"ResultSelector"\', \'"ItemReader"\', \'"ToleratedFailureCount"\', \'"ToleratedFailureCountPath"\', \'"ToleratedFailurePercentage"\', \'"ToleratedFailurePercentagePath"\', \'"Next"\', \'"End"\', \'"Cause"\', \'"CausePath"\', \'"Error"\', \'"ErrorPath"\', \'"Retry"\', \'"Catch"\'}', 'line 1:6909, at "Label", mismatched input \'"Label"\' expecting {\'"Comment"\', \'"Type"\', \'"Choices"\', \'"Default"\', \'"Branches"\', \'"SecondsPath"\', \'"Seconds"\', \'"TimestampPath"\', \'"Timestamp"\', \'"TimeoutSeconds"\', \'"TimeoutSecondsPath"\', \'"HeartbeatSeconds"\', \'"HeartbeatSecondsPath"\', \'"ItemProcessor"\', \'"Iterator"\', \'"ItemSelector"\', \'"MaxConcurrencyPath"\', \'"MaxConcurrency"\', \'"Resource"\', \'"InputPath"\', \'"OutputPath"\', \'"ItemsPath"\', \'"ResultPath"\', \'"Result"\', \'"Parameters"\', \'"ResultSelector"\', \'"ItemReader"\', \'"ToleratedFailureCount"\', \'"ToleratedFailureCountPath"\', \'"ToleratedFailurePercentage"\', \'"ToleratedFailurePercentagePath"\', \'"Next"\', \'"End"\', \'"Cause"\', \'"CausePath"\', \'"Error"\', \'"ErrorPath"\', \'"Retry"\', \'"Catch"\'}', 'line 1:7953, at "Label", mismatched input \'"Label"\' expecting {\'"Comment"\', \'"Type"\', \'"Choices"\', \'"Default"\', \'"Branches"\', \'"SecondsPath"\', \'"Seconds"\', \'"TimestampPath"\', \'"Timestamp"\', \'"TimeoutSeconds"\', \'"TimeoutSecondsPath"\', \'"HeartbeatSeconds"\', \'"HeartbeatSecondsPath"\', \'"ItemProcessor"\', \'"Iterator"\', \'"ItemSelector"\', \'"MaxConcurrencyPath"\', \'"MaxConcurrency"\', \'"Resource"\', \'"InputPath"\', \'"OutputPath"\', \'"ItemsPath"\', \'"ResultPath"\', \'"Result"\', \'"Parameters"\', \'"ResultSelector"\', \'"ItemReader"\', \'"ToleratedFailureCount"\', \'"ToleratedFailureCountPath"\', \'"ToleratedFailurePercentage"\', \'"ToleratedFailurePercentagePath"\', \'"Next"\', \'"End"\', \'"Cause"\', \'"CausePath"\', \'"Error"\', \'"ErrorPath"\', \'"Retry"\', \'"Catch"\'}'])

Part of my step function CFT definition includes Label as specified in this document

CFT portion including Label:

 "updateStatustoProvisionedForEks": {
              "ItemProcessor": {
                "ProcessorConfig": {
                  "ExecutionType": "STANDARD",
                  "Mode": "DISTRIBUTED"
                },
                "StartAt": "updateTestStatusToProvisionedForEks",
                "States": {
                  "updateTestStatusToProvisionedForEks": {
                    "End": true,
                    "OutputPath": "$.Payload",
                    "Parameters": {
                      "FunctionName": "arn:aws:lambda:${aws_region}:${aws_account}:function:${update_status_lambda_name}",
                      "Payload": {
                        "Execution.$": "$$.Execution.Id",
                        "status": "PROVISIONED",
                        "testId.$": "$.testId"
                      }
                    },
                    "Resource": "arn:aws:states:::lambda:invoke",
                    "Retry": [
                      {
                        "BackoffRate": 2,
                        "ErrorEquals": [
                          "Lambda.ServiceException",
                          "Lambda.AWSLambdaException",
                          "Lambda.SdkClientException",
                          "Lambda.TooManyRequestsException"
                        ],
                        "IntervalSeconds": 1,
                        "MaxAttempts": 3
                      }
                    ],
                    "Type": "Task"
                  }
                }
              },
              "ItemReader": {
                "Parameters": {
                  "Bucket.$": "$$.Execution.Input.bucket",
                  "Key.$": "$$.Execution.Input.key"
                },
                "ReaderConfig": {
                  "InputType": "JSON"
                },
                "Resource": "arn:aws:states:::s3:getObject"
              },
              "Label": "updateStatustoProvisionedForEks",
              "MaxConcurrency": 1000,
              "Next": "Success (1)",
              "Type": "Map"
            }

Expected Behavior

I expect that the CFT deployment do not fail because there is a Label specified in the step function's definition

Current Behavior

CFT deployment fails because there is a Label property in the step function's definition

Reproduction Steps

  1. Bring up localstack container
  2. Save this CFT locally
{
  "AWSTemplateFormatVersion": "2010-09-09",
  "Resources": {
    "qa-7ps-orchestrator": {
      "Properties": {
        "Definition": {
          "Comment": "Test Orchestrator",
          "StartAt": "updateStatus",
          "States": {
            "Success (1)": {
              "Type": "Succeed"
            },
            "updateStatus": {
              "ItemProcessor": {
                "ProcessorConfig": {
                  "ExecutionType": "STANDARD",
                  "Mode": "DISTRIBUTED"
                },
                "StartAt": "setProvisioningStatus",
                "States": {
                  "handleProvisioningError": {
                    "End": true,
                    "Parameters": {
                      "error.$": "$.error",
                      "testId.$": "$.testId"
                    },
                    "Type": "Pass"
                  },
                  "setProvisioningStatus": {
                    "Catch": [
                      {
                        "ErrorEquals": [
                          "States.ALL"
                        ],
                        "Next": "handleProvisioningError",
                        "ResultPath": "$.error"
                      }
                    ],
                    "End": true,
                    "Parameters": {
                      "FunctionName": "arn:aws:lambda:${aws_region}:${aws_account}:function:${update_status_lambda_name}",
                      "Payload": {
                        "status": "PROVISIONING",
                        "testId.$": "$.testId"
                      }
                    },
                    "Resource": "arn:aws:states:::lambda:invoke",
                    "ResultSelector": {
                      "status.$": "$.Payload.status",
                      "testId.$": "$.Payload.testId"
                    },
                    "Retry": [
                      {
                        "BackoffRate": 2,
                        "ErrorEquals": [
                          "Lambda.ServiceException",
                          "Lambda.AWSLambdaException",
                          "Lambda.SdkClientException",
                          "Lambda.TooManyRequestsException",
                          "Extension.Crash"
                        ],
                        "IntervalSeconds": 2,
                        "MaxAttempts": 6
                      }
                    ],
                    "Type": "Task"
                  }
                }
              },
              "ItemReader": {
                "Parameters": {
                  "Bucket.$": "$.bucket",
                  "Key.$": "$.key"
                },
                "ReaderConfig": {
                  "InputType": "JSON"
                },
                "Resource": "arn:aws:states:::s3:getObject"
              },
              "ItemsPath": "$.testSets",
              "Label": "updateStatus",
              "MaxConcurrency": 1000,
              "Next": "Success (1)",
              "ResultPath": "$.testSets",
              "Type": "Map"
            }
          }
        },
        "RoleArn": "arn:aws:iam::499000064181:role/BA7PSTESTPLATFORM/7ps-orchestrator-qa-role",
        "StateMachineName": "qa-7ps-orchestrator"
      },
      "Type": "AWS::StepFunctions::StateMachine"
    }
  }
}
  1. Run command aws cloudformation deploy --stack-name stack1 --template-file {path-to-cft} --endpoint-url=http://localhost:4566

Possible Solution

No response

Additional Information/Context

No response

CLI version used

aws-cli/2.15.45 Python/3.11.9 Darwin/23.5.0 source/x86_64 prompt/off

Environment details (OS name and version, etc.)

MacOs 14.5 (23F79), Processor 2.3 GHz 8-Core Intel Core i9

@arielalas arielalas added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Aug 5, 2024
@tim-finnigan tim-finnigan self-assigned this Aug 5, 2024
@tim-finnigan
Copy link
Contributor

Thanks for reaching out. I think this issue is specific to localstack, as it has been reported several times in their repository. It looks like this may have been recently fixed in the last few weeks ago via: localstack/localstack#11073. Have you tried using 3.6.0? If you're still having issues I suggest reaching out in their repository.


When I ran aws cloudformation deploy --stack-name stack1 --template-file template.json with your template, I received the error:

An error occurred (ValidationError) when calling the CreateChangeSet operation: Template format error: Resource name qa-7ps-orchestrator is non alphanumeric.

So it looks the dashes need to be removed there for this to run. For further investigation on the CLI side we would like to see your debug logs (with any sensitive info redacted) by adding --debug to the command.

@tim-finnigan tim-finnigan added cloudformation package-deploy response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. third-party This issue is related to third-party libraries or applications. customization Issues related to CLI customizations (located in /awscli/customizations) p2 This is a standard priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Aug 5, 2024
@arielalas
Copy link
Author

@tim-finnigan thank you for your response, I was able to confirm that this issue is resolved using localstack version3.6.0. Thank you very much!

@tim-finnigan
Copy link
Contributor

Thanks for letting us know! I'll go ahead and close this issue.

Copy link

github-actions bot commented Aug 6, 2024

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. cloudformation package-deploy customization Issues related to CLI customizations (located in /awscli/customizations) p2 This is a standard priority issue response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. third-party This issue is related to third-party libraries or applications.
Projects
None yet
Development

No branches or pull requests

2 participants