Open indranilbanerjee2014 opened 3 years ago
In the Decoupled Microservices Lab, sam build command fails in the 3rd lab Scatter-Gather - https://async-messaging.workshop.aws/scatter-gather.html
Below is the error I get
indranil:~/environment/wild-rydes-async-messaging/lab-3 $ sam build Building codeuri: request-for-quotes-service/ runtime: python3.7 metadata: {} functions: ['RequestForQuotesService'] Running PythonPipBuilder:ResolveDependencies
Build Failed Error: PythonPipBuilder:ResolveDependencies - list index out of range
template.yaml file is pasted below
AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 Description: > re:invent2019 ARC314-R Lab-3
Sample SAM Template for re:invent2019 ARC314-R Lab-3
Globals: Function: Timeout: 70
Resources: RequestForQuotesService: Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction Properties: CodeUri: request-for-quotes-service/ Handler: app.lambda_handler Runtime: python3.7 Environment: Variables: TABLE_NAME: !Ref RidesBookingTable TOPIC_ARN: !Ref RequestForQuotesTopic Policies:
SNSPublishMessagePolicy: # https://github.com/awslabs/serverless-application-model/blob/develop/samtranslator/policy_templates_data/policy_templates.json TopicName: !GetAtt RequestForQuotesTopic.TopicName Events: RideBooking: Type: Api # More info about API Event Source: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#api Properties: Path: /submit-instant-ride-rfq Method: post
QueryForQuotesService: Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction Properties: CodeUri: query-for-quotes-service/ Handler: app.lambda_handler Runtime: python3.7 Environment: Variables: TABLE_NAME: !Ref RidesBookingTable TOPIC_ARN: !Ref RequestForQuotesTopic Policies:
SNSPublishMessagePolicy: # https://github.com/awslabs/serverless-application-model/blob/develop/samtranslator/policy_templates_data/policy_templates.json TopicName: !GetAtt RequestForQuotesTopic.TopicName Events: RideBooking: Type: Api # More info about API Event Source: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#api Properties: Path: /query-instant-ride-rfq/{id} Method: get
RidesBookingTable: Type: AWS::DynamoDB::Table Properties: TableName: RidesBookingTable AttributeDefinitions:
RequestForQuotesTopic: Type: AWS::SNS::Topic Properties: TopicName: request-for-quotes-topic
RequestForQuotesResponseQueue: Type: AWS::SQS::Queue Properties: QueueName: RequestForQuotesResponseQueue VisibilityTimeout: 120
UnicornManagementResource1: Type: AWS::Serverless::Function Properties: CodeUri: generic-unicorn-management-service/ Handler: app.lambda_handler Runtime: python3.7 Environment: Variables: SERVICE_NAME: UnicornManagementResource1 QUEUE_URL: !Ref RequestForQuotesResponseQueue Policies:
SQSSendMessagePolicy: # https://github.com/awslabs/serverless-application-model/blob/develop/samtranslator/policy_templates_data/policy_templates.json QueueName: !GetAtt RequestForQuotesResponseQueue.QueueName Events: SqsJobQueue: Type: SNS Properties: Topic: !Ref RequestForQuotesTopic
UnicornManagementResource2: Type: AWS::Serverless::Function Properties: CodeUri: generic-unicorn-management-service/ Handler: app.lambda_handler Runtime: python3.7 Environment: Variables: SERVICE_NAME: UnicornManagementResource2 QUEUE_URL: !Ref RequestForQuotesResponseQueue Policies:
UnicornManagementResource3: Type: AWS::Serverless::Function Properties: CodeUri: generic-unicorn-management-service/ Handler: app.lambda_handler Runtime: python3.7 Environment: Variables: SERVICE_NAME: UnicornManagementResource3 QUEUE_URL: !Ref RequestForQuotesResponseQueue Policies:
UnicornManagementResource4: Type: AWS::Serverless::Function Properties: CodeUri: generic-unicorn-management-service/ Handler: app.lambda_handler Runtime: python3.7 Environment: Variables: SERVICE_NAME: UnicornManagementResource4 QUEUE_URL: !Ref RequestForQuotesResponseQueue Policies:
UnicornManagementResource5: Type: AWS::Serverless::Function Properties: CodeUri: generic-unicorn-management-service/ Handler: app.lambda_handler Runtime: python3.7 Environment: Variables: SERVICE_NAME: UnicornManagementResource5 QUEUE_URL: !Ref RequestForQuotesResponseQueue Policies:
UnicornManagementResource6: Type: AWS::Serverless::Function Properties: CodeUri: generic-unicorn-management-service/ Handler: app.lambda_handler Runtime: python3.7 Environment: Variables: SERVICE_NAME: UnicornManagementResource6 QUEUE_URL: !Ref RequestForQuotesResponseQueue Policies:
UnicornManagementResource7: Type: AWS::Serverless::Function Properties: CodeUri: generic-unicorn-management-service/ Handler: app.lambda_handler Runtime: python3.7 Environment: Variables: SERVICE_NAME: UnicornManagementResource7 QUEUE_URL: !Ref RequestForQuotesResponseQueue Policies:
UnicornManagementResource8: Type: AWS::Serverless::Function Properties: CodeUri: generic-unicorn-management-service/ Handler: app.lambda_handler Runtime: python3.7 Environment: Variables: SERVICE_NAME: UnicornManagementResource8 QUEUE_URL: !Ref RequestForQuotesResponseQueue Policies:
UnicornManagementResource9: Type: AWS::Serverless::Function Properties: CodeUri: generic-unicorn-management-service/ Handler: app.lambda_handler Runtime: python3.7 Environment: Variables: SERVICE_NAME: UnicornManagementResource9 QUEUE_URL: !Ref RequestForQuotesResponseQueue Policies:
UnicornManagementResource10: Type: AWS::Serverless::Function Properties: CodeUri: generic-unicorn-management-service/ Handler: app.lambda_handler Runtime: python3.7 Environment: Variables: SERVICE_NAME: UnicornManagementResource10 QUEUE_URL: !Ref RequestForQuotesResponseQueue Policies:
QuotesResponseService: Type: AWS::Serverless::Function Properties: CodeUri: quotes-response-service/ Handler: app.lambda_handler Runtime: python3.7 Environment: Variables: TABLE_NAME: !Ref RidesBookingTable Policies:
Outputs: RideBookingApiSubmitInstantRideRfqEndpoint: Description: "API Gateway endpoint URL for Prod stage for RideBookingService submit-instant-ride-rfq resource" Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/submit-instant-ride-rfq/" RideBookingApiQueryInstantRideRfqEndpoint: Description: "API Gateway endpoint URL for Prod stage for RideBookingService query-instant-ride-rfq resource" Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/query-instant-ride-rfq/{id}"
RequestForQuotesTopic: Description: "Amazon SNS topic ARN for RequestForQuotes topic" Value: !Ref RequestForQuotesTopic
In the Decoupled Microservices Lab, sam build command fails in the 3rd lab Scatter-Gather - https://async-messaging.workshop.aws/scatter-gather.html
Below is the error I get
indranil:~/environment/wild-rydes-async-messaging/lab-3 $ sam build Building codeuri: request-for-quotes-service/ runtime: python3.7 metadata: {} functions: ['RequestForQuotesService'] Running PythonPipBuilder:ResolveDependencies
Build Failed Error: PythonPipBuilder:ResolveDependencies - list index out of range
template.yaml file is pasted below
AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 Description: > re:invent2019 ARC314-R Lab-3
Sample SAM Template for re:invent2019 ARC314-R Lab-3
More info about Globals: https://github.com/awslabs/serverless-application-model/blob/master/docs/globals.rst
Globals: Function: Timeout: 70
Resources: RequestForQuotesService: Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction Properties: CodeUri: request-for-quotes-service/ Handler: app.lambda_handler Runtime: python3.7 Environment: Variables: TABLE_NAME: !Ref RidesBookingTable TOPIC_ARN: !Ref RequestForQuotesTopic Policies:
SNSPublishMessagePolicy: # https://github.com/awslabs/serverless-application-model/blob/develop/samtranslator/policy_templates_data/policy_templates.json TopicName: !GetAtt RequestForQuotesTopic.TopicName Events: RideBooking: Type: Api # More info about API Event Source: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#api Properties: Path: /submit-instant-ride-rfq Method: post
QueryForQuotesService: Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction Properties: CodeUri: query-for-quotes-service/ Handler: app.lambda_handler Runtime: python3.7 Environment: Variables: TABLE_NAME: !Ref RidesBookingTable TOPIC_ARN: !Ref RequestForQuotesTopic Policies:
SNSPublishMessagePolicy: # https://github.com/awslabs/serverless-application-model/blob/develop/samtranslator/policy_templates_data/policy_templates.json TopicName: !GetAtt RequestForQuotesTopic.TopicName Events: RideBooking: Type: Api # More info about API Event Source: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#api Properties: Path: /query-instant-ride-rfq/{id} Method: get
RidesBookingTable: Type: AWS::DynamoDB::Table Properties: TableName: RidesBookingTable AttributeDefinitions:
RequestForQuotesTopic: Type: AWS::SNS::Topic Properties: TopicName: request-for-quotes-topic
RequestForQuotesResponseQueue: Type: AWS::SQS::Queue Properties: QueueName: RequestForQuotesResponseQueue VisibilityTimeout: 120
UnicornManagementResource1: Type: AWS::Serverless::Function Properties: CodeUri: generic-unicorn-management-service/ Handler: app.lambda_handler Runtime: python3.7 Environment: Variables: SERVICE_NAME: UnicornManagementResource1 QUEUE_URL: !Ref RequestForQuotesResponseQueue Policies:
SQSSendMessagePolicy: # https://github.com/awslabs/serverless-application-model/blob/develop/samtranslator/policy_templates_data/policy_templates.json QueueName: !GetAtt RequestForQuotesResponseQueue.QueueName Events: SqsJobQueue: Type: SNS Properties: Topic: !Ref RequestForQuotesTopic
UnicornManagementResource2: Type: AWS::Serverless::Function Properties: CodeUri: generic-unicorn-management-service/ Handler: app.lambda_handler Runtime: python3.7 Environment: Variables: SERVICE_NAME: UnicornManagementResource2 QUEUE_URL: !Ref RequestForQuotesResponseQueue Policies:
SQSSendMessagePolicy: # https://github.com/awslabs/serverless-application-model/blob/develop/samtranslator/policy_templates_data/policy_templates.json QueueName: !GetAtt RequestForQuotesResponseQueue.QueueName Events: SqsJobQueue: Type: SNS Properties: Topic: !Ref RequestForQuotesTopic
UnicornManagementResource3: Type: AWS::Serverless::Function Properties: CodeUri: generic-unicorn-management-service/ Handler: app.lambda_handler Runtime: python3.7 Environment: Variables: SERVICE_NAME: UnicornManagementResource3 QUEUE_URL: !Ref RequestForQuotesResponseQueue Policies:
SQSSendMessagePolicy: # https://github.com/awslabs/serverless-application-model/blob/develop/samtranslator/policy_templates_data/policy_templates.json QueueName: !GetAtt RequestForQuotesResponseQueue.QueueName Events: SqsJobQueue: Type: SNS Properties: Topic: !Ref RequestForQuotesTopic
UnicornManagementResource4: Type: AWS::Serverless::Function Properties: CodeUri: generic-unicorn-management-service/ Handler: app.lambda_handler Runtime: python3.7 Environment: Variables: SERVICE_NAME: UnicornManagementResource4 QUEUE_URL: !Ref RequestForQuotesResponseQueue Policies:
SQSSendMessagePolicy: # https://github.com/awslabs/serverless-application-model/blob/develop/samtranslator/policy_templates_data/policy_templates.json QueueName: !GetAtt RequestForQuotesResponseQueue.QueueName Events: SqsJobQueue: Type: SNS Properties: Topic: !Ref RequestForQuotesTopic
UnicornManagementResource5: Type: AWS::Serverless::Function Properties: CodeUri: generic-unicorn-management-service/ Handler: app.lambda_handler Runtime: python3.7 Environment: Variables: SERVICE_NAME: UnicornManagementResource5 QUEUE_URL: !Ref RequestForQuotesResponseQueue Policies:
SQSSendMessagePolicy: # https://github.com/awslabs/serverless-application-model/blob/develop/samtranslator/policy_templates_data/policy_templates.json QueueName: !GetAtt RequestForQuotesResponseQueue.QueueName Events: SqsJobQueue: Type: SNS Properties: Topic: !Ref RequestForQuotesTopic
UnicornManagementResource6: Type: AWS::Serverless::Function Properties: CodeUri: generic-unicorn-management-service/ Handler: app.lambda_handler Runtime: python3.7 Environment: Variables: SERVICE_NAME: UnicornManagementResource6 QUEUE_URL: !Ref RequestForQuotesResponseQueue Policies:
SQSSendMessagePolicy: # https://github.com/awslabs/serverless-application-model/blob/develop/samtranslator/policy_templates_data/policy_templates.json QueueName: !GetAtt RequestForQuotesResponseQueue.QueueName Events: SqsJobQueue: Type: SNS Properties: Topic: !Ref RequestForQuotesTopic
UnicornManagementResource7: Type: AWS::Serverless::Function Properties: CodeUri: generic-unicorn-management-service/ Handler: app.lambda_handler Runtime: python3.7 Environment: Variables: SERVICE_NAME: UnicornManagementResource7 QUEUE_URL: !Ref RequestForQuotesResponseQueue Policies:
SQSSendMessagePolicy: # https://github.com/awslabs/serverless-application-model/blob/develop/samtranslator/policy_templates_data/policy_templates.json QueueName: !GetAtt RequestForQuotesResponseQueue.QueueName Events: SqsJobQueue: Type: SNS Properties: Topic: !Ref RequestForQuotesTopic
UnicornManagementResource8: Type: AWS::Serverless::Function Properties: CodeUri: generic-unicorn-management-service/ Handler: app.lambda_handler Runtime: python3.7 Environment: Variables: SERVICE_NAME: UnicornManagementResource8 QUEUE_URL: !Ref RequestForQuotesResponseQueue Policies:
SQSSendMessagePolicy: # https://github.com/awslabs/serverless-application-model/blob/develop/samtranslator/policy_templates_data/policy_templates.json QueueName: !GetAtt RequestForQuotesResponseQueue.QueueName Events: SqsJobQueue: Type: SNS Properties: Topic: !Ref RequestForQuotesTopic
UnicornManagementResource9: Type: AWS::Serverless::Function Properties: CodeUri: generic-unicorn-management-service/ Handler: app.lambda_handler Runtime: python3.7 Environment: Variables: SERVICE_NAME: UnicornManagementResource9 QUEUE_URL: !Ref RequestForQuotesResponseQueue Policies:
SQSSendMessagePolicy: # https://github.com/awslabs/serverless-application-model/blob/develop/samtranslator/policy_templates_data/policy_templates.json QueueName: !GetAtt RequestForQuotesResponseQueue.QueueName Events: SqsJobQueue: Type: SNS Properties: Topic: !Ref RequestForQuotesTopic
UnicornManagementResource10: Type: AWS::Serverless::Function Properties: CodeUri: generic-unicorn-management-service/ Handler: app.lambda_handler Runtime: python3.7 Environment: Variables: SERVICE_NAME: UnicornManagementResource10 QUEUE_URL: !Ref RequestForQuotesResponseQueue Policies:
SQSSendMessagePolicy: # https://github.com/awslabs/serverless-application-model/blob/develop/samtranslator/policy_templates_data/policy_templates.json QueueName: !GetAtt RequestForQuotesResponseQueue.QueueName Events: SqsJobQueue: Type: SNS Properties: Topic: !Ref RequestForQuotesTopic
QuotesResponseService: Type: AWS::Serverless::Function Properties: CodeUri: quotes-response-service/ Handler: app.lambda_handler Runtime: python3.7 Environment: Variables: TABLE_NAME: !Ref RidesBookingTable Policies:
Outputs: RideBookingApiSubmitInstantRideRfqEndpoint: Description: "API Gateway endpoint URL for Prod stage for RideBookingService submit-instant-ride-rfq resource" Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/submit-instant-ride-rfq/" RideBookingApiQueryInstantRideRfqEndpoint: Description: "API Gateway endpoint URL for Prod stage for RideBookingService query-instant-ride-rfq resource" Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/query-instant-ride-rfq/{id}"
RideBookingService:
Description: "RideBookingService Lambda Function ARN"
Value: !GetAtt RideBookingService.Arn
RequestForQuotesTopic: Description: "Amazon SNS topic ARN for RequestForQuotes topic" Value: !Ref RequestForQuotesTopic