DEV Community

Cover image for Golang: Serverless deployment using AWS Cloudformation
Raksha for Canopas Software

Posted on

Golang: Serverless deployment using AWS Cloudformation

Do you know how to speed up your serverless application deployment using AWS Cloudformation?

This post will teach you how to deploy your app to AWS lambda and API Gateway using AWS Cloudformation.

Serverless architectures are easy to use. But did you ever think you can deploy them quickly too? AWS Cloudformation takes the lead for it.

Prerequisites

  1. IAM user — to perform AWS CLI operations on our behalf.
  2. S3 bucket — to upload a zip of our code.

Table of contents

  • IAM user permissions
  • Introduction to AWS Lambda and API Gateway
  • Introduction to Cloudformation
  • Configure AWS CLI with IAM user
  • Create Cloudformation stack using AWS CLI
  • Get familiar with the Clouformation template
  • Create AWS Lambda Execution Role using Cloudformation
  • Create AWS Lambda function using Cloudformation
  • Create API Gateway Rest API using Cloudformation
  • Create API Gateway method, resource, and proxy using Cloudformation
  • Create a Lambda permission to allow API Gateway to invoke the Lambda function using Cloudformation
  • Configure a custom domain to access API Gateways using Cloudformation

Cloudformation works a way better to automate any AWS service deployments like EC2, IAM, and many more.

If you want to refer to the full code, it’s available at serverless deployment using Cloudformation with GitLab CI integration.

To learn more, read the post on canopas blog.

Latest comments (2)

Collapse
 
sloan profile image
Sloan the DEV Moderator

Hi there, we encourage authors to share their entire posts here on DEV, rather than mostly pointing to an external link. Doing so helps ensure that readers don’t have to jump around to too many different pages, and it helps focus the conversation right here in the comments section.

If you choose to do so, you also have the option to add a canonical URL directly to your post.

Collapse
 
garambharaksha profile image
Raksha

Yes