Wednesday, 15 July 2020

Build Your Own Twitter Bot - Deployment with AWS CloudFormation

<< Reading Images from S3                               Table of Contents                                    Scheduling with CloudWatch >>

In this post, I will show you how to use AWS CloudFormation templates for deploying our functions to AWS Lambda.

Open the serverless.template and add the following:




The serverless.template is used by AWS CloudFormation for orchestrating multiple AWS services. In our case, we want to deploy two AWS Lambda functions called OccultTwitterBotTweetFunction and OccultTwitterBotRetweetFunction.

FunctionName: The name of our AWS Function to be displayed in AWS
Handler: The function in our code that will be executed
Runtime: The function will be executed by the dotnetcore3.1 runtime
Role: The execution role that the function will use.
Policies: The permissions we want to give to our function. 

To deploy our functions, right click the project that contains the serverless.template, OccultTwitterBot, and click "Publish To AWS Lambda..."


Give a name to the Stack. The stack is what governs all your services defined in the template.
It gives you the ability to create, update and delete the stack.

Create an S3 Bucket for deployment. This is where your lambda binaries will be placed during the deployment.


<< Reading Images from S3                               Table of Contents                                    Scheduling with CloudWatch >>





No comments:

Post a Comment