Create Extraordinary rides service

Create Extraordinary rides service

After creating SNS subscriptions using the console, we will try to create an SNS subscription using SAM.

  1. Update the AWS SAM template
  • Open the code/lab-1/template.yaml file in VS Code and update the following code:
Events:
  SNSEvent:
    Type: SNS
    Properties:
      Topic: !Ref RideCompletionTopic
      FilterPolicy:
        fare:
          - numeric:
              - '>='
              - 50
        distance:
          - numeric:
              - '>='
              - 20

Working with SNS

  1. Update by running the following command:
cd ~/wild-rydes-async-messaging/code/lab-1
sam build --use-container

Working with SNS

  1. After updating, we will deploy using the command:
sam deploy

Working with SNS

  1. Verify that the subscription has been successfully created.

Working with SNS

  1. Verify that the Lambda Function has triggered SNS.

Working with SNS