How inline AWS::StackName in step funciton name?

stepFunctions:
  stateMachines:
    mystep:
      name: !Sub "${AWS::StackName}mystep"

And I got exception Invalid variable reference syntax for variable AWS::StackName. You can only reference env vars, options, & files. You can check our docs for more info.

When !Sub "#{AWS::StackName}mystep" is used I got State machine [mystep] is malformed. Please check the README for more info. ValidationError: child “name” fails because [“name” must be a string]

For "#{AWS::StackName}mystep" or #{StackName}mystep If got Error: The CloudFormation template is invalid: Template format error: Resource name #{StackName}mystep is non alphanumeric.

The same error with if I replace StackName with Region