In this step, you can chose whether you want to create the Amazon SNS topic via the AWS console or AWS SAM. Just select the corresponding tab below and follow the instructions:
You can chose, whether you would like to use the AWS Console or AWS SAM for this lab. Once you have chosen, stick to it until the end of this lab and don’t switch in between!
In your Amazon SNS console, select Topic in the left navigation pane and click the Create topic button in the top right corner.
Enter the topic name RideCompletionTopic and leave the default values. Scroll to the bottom of the page and click Create topic.
In your Cloud9 IDE for this workshop, open the SAM template file wild-rydes-async-messaging/lab-1/template.yaml
. In the Resources section, add the definition for an Amazon SNS topic with the name RideCompletionTopic. You can find the AWS CloudFormation documentation to do so here.
Run the following command to build the lab again, after we have added the Amazon SNS topic:
cd ~/environment/wild-rydes-async-messaging/lab-1
sam build
Now we are ready to update the application, by running the following command to deploy the change:
sam deploy \
--guided \
--stack-name wild-rydes-async-msg-1 \
--capabilities CAPABILITY_IAM
Confirm the first 4 proposed arguments by hitting ENTER. When you get asked SubmitRideCompletionFunction may not have authorization defined, Is this okay? [y/N]:, enter y
and hit ENTER again 2 times.
Because AWS SAM will only deploy/update/delete resources which are changed, it only takes a couple of seconds to deploy the new Amazon SNS topic.