Home > Net >  Template format error: YAML not well-formed
Template format error: YAML not well-formed

Time:12-24

I'm getting Template format error: YAML not well-formed on the final line of this resource but no idea where I'm going wrong.

  LambdaPermission:
    Type: AWS::Lambda::Permission
    Properties:
      Action: lambda:InvokeFunction
      FunctionName: !GetAtt LambdaFunction.Arn
      Principal: apigateway.amazonaws.com
      SourceArn: !Join
        - ''
        - - !Sub 'arn:aws:execute-api:${AWS::Region}:${AWS::AccountId}:'
          - Fn::ImportValue:
            !Sub ${ParentStack}-api
          - '/*'

CodePudding user response:

There should be a tab after ImportValue:

  LambdaPermission:
    Type: AWS::Lambda::Permission
    Properties:
      Action: lambda:InvokeFunction
      FunctionName: !GetAtt LambdaFunction.Arn
      Principal: apigateway.amazonaws.com
      SourceArn: !Join
        - ''
        - - !Sub 'arn:aws:execute-api:${AWS::Region}:${AWS::AccountId}:'
          - Fn::ImportValue:
              !Sub ${ParentStack}-api
          - '/*'
  • Related