martysweet / cfn-lint

A CloudFormation JSON and YAML Validator
MIT License
163 stars 38 forks source link

Fn::Split and Fn::Sub combination false positive #221

Closed romaninsh closed 5 years ago

romaninsh commented 5 years ago
Resource: Resources > B3AdminIdentityPool > Properties > IdentityPoolName
Message: Fn::Split does not support function 'Fn::Sub' here
Documentation: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-split.html

code:

  B3AdminIdentityPool:
    Type: AWS::Cognito::IdentityPool
    Properties:
      IdentityPoolName: 
         Fn::Join: 
          - "_"
          - Fn::Split: 
            - "-"
            - !Sub ${Infra}-b3-admin

valid syntax replacing "-" with "_" in a string.

martysweet commented 5 years ago

Thanks for the issue, Fn::Sub needs to be added to the following list.

https://github.com/martysweet/cfn-lint/blob/c2690b1c603131ebc104a3153daab74811e54ff8/data/aws_intrinsic_functions.json#L16