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

E1029: StateMachine DefinitionSubstitutions key is the same as the parameter name or resource id #3786

Closed
sudoudaisuke opened this issue Oct 24, 2024 · 0 comments · Fixed by #3792

Comments

@sudoudaisuke
Copy link

sudoudaisuke commented Oct 24, 2024

CloudFormation Lint Version

1.18.1

What operating system are you using?

Ubuntu

Describe the bug

If the key of AWS::StepFunctions::StateMachine DefinitionSubstitutions is the same as the parameter name or resource ID, an E1029 error occurs.
I do not want to use the Sub function. So, I set the DefinitionSubstitutions map to ResouceId: !Ref ResouceId. Then, E1029 is generated when the key is referenced.

$ cfn-lint ./a.yaml
E1029 Found an embedded parameter "${myParam}" outside of an "Fn::Sub" at Resources/TestStateMachine/Properties/Definition/States/Test/Parameters/Key1
a.yaml:28:15

E1029 Found an embedded parameter "${mySnsTopic}" outside of an "Fn::Sub" at Resources/TestStateMachine/Properties/Definition/States/Test/Parameters/Key2
a.yaml:29:15

Expected behavior

pass lint.

Reproduction template

---
AWSTemplateFormatVersion: "2010-09-09"
Parameters:
  myParam:
    Type: String

Resources:
  mySnsTopic:
    Type: AWS::SNS::Topic

  TestStateMachine:
    Type: AWS::StepFunctions::StateMachine
    Properties:
      RoleArn: arn:aws:iam::123456789012:role/abc
      DefinitionSubstitutions:
        # define key as parameter name or resource id
        myParam: !Ref myParam
        # define key as parameter name or resource id
        mySnsTopic: !GetAtt mySnsTopic.TopicName
        # define key as none resource name
        myOkKey: 1234
      Definition:
        StartAt: Test
        States:
          Test:
            End: true
            Parameters:
              Key1: ${myParam} # E1029
              Key2: ${mySnsTopic} # E1029
              Key3: ${myOkKey} # ok
            Type: Pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant