SST Pub/Sub Example (SNS)

... About 1 min

# SST Pub/Sub Example (SNS)

This example derives from the SST Pub/Sub example. Since Commandeer allows you to easily test an SNS publish, we can actually add a message to the SNS topic without having to use an API Gateway endpoint. We have still included the endpoint in the code though.

In this example we will post some messages to the SNS topic and then view the Lambda's invocation CloudWatch logs.


# Commandeer SNS Testing Tool

# Add Message Section

# Resources Section

Under this is the Resources section. This will give you a list of related AWS resources that are associated with this test. In our case, we have 4 resources.

  • CloudWatch Log - aws/lambda/dev-commandeer... - this is where all logging from your Lambda goes
  • Lambda - dev-commandeer-imageResizeHandler... - this is the lambda that is invoked when a file is saved to the /photos location of the bucket
  • IAM Execution Role - dev-commandeer-image-photoResize... - this is the IAM role that is assumed by the lambda. This is important, especially if the lambda is going to save data to another AWS resource like S3, DynamoDB, or SQS. It will need to be configured with the proper permissions. You normally do this in the SST code
  • SNS Topic - dev-commandeer-image... - this is the SNS Topic that the message is sent to

Each of these can be clicked on to view the resource, and make any changes to it.

# Results Section

On the right-hand side is where the results reside. Before you run it, you will see the brief explanation for the tool. Once you add your message, this is where you will see the CloudWatch log information. This is also where the resources are shown. You can then simply close any resource, to return back to the results.

# Conclusion

Combining the Commandeer testing tools this with the auto-refreshing of Lambda's that SST provides really makes for a magical testing experience.

Last update: July 1, 2022 10:05