Create a Serverless Slackbot with AWS Lambda and Python

In this course we'll build and deploy a Serverless Slack Bot using AWS Lambda and Python. Along the way you'll learn about proper security, how lambda works, and how to deploy your service.

4.8 62 students started

Published |Updated

What You Will Learn

How to use AWS Lambda

Importance of securing your account

How to setup a Slack bot

How to deploy a serverless bot into production

Serverless Computing may sound like a scary topic, but with the rise of AWS Lambda and mature tools supporting it - it's more approachable than ever. In this newline course, we're going to learn what serverless technology is and isn't, and why it belongs in your developer toolbox. We'll see that for certain common projects - like custom chat bot creation - AWS Lambda really shines for it's simplicity, affordability, and ability to integrate with the wider AWS ecosystem.

Some developers love using serverless tech because it helps them save money, scale quickly, and deliver on reliability goals. While all of those things are possible with Lambda (especially cost savings which are common - but certainly not guaranteed), it's the development agility and reduction of operations overhead that drives my love for the service. It's a relief to be able to get right into the code, without worrying about configuring operating systems, deploying containers, or scaling clusters. Serverless on Lambda gives developers the resources needed to write, deploy, and maintain production-ready software - all without significant operational overhead.

In true newline-fashion, we'll get rolling with a practical application right away. RPG players rejoice - we're creating a fully functional, dice-rolling chat bot for Slack! While the example bot will be for Slack, the same idea can be easily adapted to create a bot for Telegram, Discord, or nearly any other chat service with a bot API.

We will be using Python 3 for this project, but it's worth noting that AWS Lambda works with other common languages and runtimes, including NodeJS, Java, ruby, go, and .NET. The basic mechanisms of creating, testing, and deploying your Lambda do not vary significantly based on your runtime choice.

By the end of this course you'll:

  • Deploy a Slack Bot that runs on AWS Lambda
  • Understand how to keep your AWS account secure
  • Be able to deploy custom Lambda functions
  • Understand serverless architecture and how it works

Course Content

4 modules16 lessons

Introduction

1 lesson

Create a Serverless Slack Bot with AWS Lambda and Python

In true newline-fashion, we'll get *rolling* with a practical application right away. We're creating a fully functional, dice-rolling chat bot for Slack!

INTRODUCTION

Configuring Your AWS Environment

2 lessons

AWS Environment Setup

There's no `AWS Lambda` without `AWS`. That means we'll need a few AWS resources created and configured on the AWS side of things to develop and effectively.

LESSON

Configuring Our AWS Workspace

Here, we'll configure an `AWS Workspace` or `AWS EC2 Instance` as the development environment to use for developing for AWS Lambda.

LESSON

Configuring Your Local Machine

3 lessons

Preparing your Local Development Environment For AWS Lambda and Python Development

We can comfortably develop for AWS Lambda with python on any modern Operating System

LESSON

Installing Python 3 and Pyenv on MacOS, Windows, and Linux

We will be using the AWS Lambda runtime for the latest stable version of Python 3 - `python3.7`.

LESSON

Configuring the AWS CLI

The easiest way to configure our local development with our credentials is to run the command `aws configure`

LESSON

Your Instructors

Profile image for sudosteph

Stephanie Prime

I'm your author, Steph Prime. I'm a DevOps Engineer by title, and a technical generalist with years of AWS Lambda development experience in practice.

When I worked at AWS, I was one of the first Engineers to preview Lambda internally, and to use it before it was released to the public. Even in it's original, unpolished state - it was obvious that serverless technology was poised change the software development world in a big way.

Since my days working at AWS, I've worked at companies that range from small VOIP startups, to established managed services companies with massive enterprise clients. No matter the size or the stakes - every place I've worked has found a use for Lambda in it's ecosystem, and is still using it today.

The flexibliliy, resiliency, and cost effectiveness of the AWS Lambda stands the test of time, even in the fast moving tech world.

Lambda as a service itself is remarkable, but the what really makes it so powerful is the agility that effective Lambda developers can achieve. Thanks to serverless technology, it has never been easier to write, deploy, and maintain production-ready software - at any scale.

Frequently Asked Questions

What if I need help?

You can ask us questions anytime through the community Discord channel or by sending us a message.

OrGet this course and every newline Book and Guide with a newline Pro subscription for just $20/mo

$29

$49

  • Build a Slack Bot in Python

  • Learn AWS Lambda

  • Deploy live serverless APIs

Create a Serverless Slackbot with AWS Lambda and Python

$29

$49