'Error: Unable to upload artifact PitchAiIngest referenced by CodeUri parameter of PitchAiIngest resource

Pretty new to AWS Lambda function, and this is my time to get my hands dirty. I got this error in the title when I wanted to docker build my function. And here is how I configured my function:

  PitchAiIngest:
    Type: AWS::Serverless::Function
    Properties:
      FunctionName: !Sub pitch-ai-ingest-${Environment}
      Handler: lambda_function.lambda_handler
      Runtime: python3.7
      CodeUri: pitchai_ingest/
      Description: get pitchai information from API and publish to dynamodb
      MemorySize: 128
      Timeout: 900
      Role: !GetAtt LambdaRole.Arn
      Environment:
        Variables:
          LOGGING_LEVEL: INFO
          APP_NAME: pitch-ai-ingest
          APP_ENV: !Ref Environment
          DYNAMO_DB: !Ref PitchAiEventDynamoDBTable
          PLAYER_DB: !Ref PitchAiPlayerDynamoDBTable 
          PITCH_SQS: !Ref PitchAiIngestQueue
      Tags:
        env: !Ref Environment
        service: pitch-ai-service
        function_name: !Sub pitch-ai-ingest-${Environment}

Roughly speaking, I post the snippet above in file cfn-tempate.yml under the same directory of folder pitchai_ingest (including Lambda handler).

What should I do to fix it?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source