In this article we are going to learn how to easily deploy a golang application using AWS AppRunner.
What's AWS App Runner?
AWS App Runner is an AWS service that provides a fast, simple, and cost-effective way to turn an existing container image or source code directly into a running web service in the AWS Cloud.
Golang App
Basically, the application purpose is develop a system in Go that receives a ZIP code, identifies the city, and returns the current weather (temperature in Celsius, Fahrenheit, and Kelvin).
Here you can find and clone the repository to follow the tutorial.
Configuring AWS App Runner
First of all. Read this doc about the billings of App Runner.
Note: In this tutorial I will consider that you already have an AWS account.
Creating a Service
After search AppRunner in AWS console we need to create a service as the image bellow
1 - Source
- We will select source code repository to select our github repository. Note that we can integrate with Amazon ECR.
- Our provider here will be Gihub
- Here we will add our Github account. I’ve already added. It’s simple.
- This step we need to reference the repository. In my case is pos-golang-challange-1
- The branch will be master. Note that here we can select other branches depending your environment.
2 - Deployment settings
In deployment settings we just need to select the automatic option to get easy your deploy
3 - Build settings
- Selecting a runtime. Note that the go version inside go.mod here must be go 1.18.
- The command to build our application. Note that the output file name will be gollang-app.
- Generated file to run our application.
4 - Service settings
In this step just put the service name and the cheaper infra configuration.
Configs like Auto scaling, Health check, Security, Networking, Observability and Tags we don’t touch for now.
5 - Service created
After a while you will see that the service was created and we can access via Default domain like bellow.
Conclusion
In conclusion, deploying a Golang application using AWS App Runner offers a seamless and efficient solution for developers looking to streamline their deployment processes. Through this blog post, we’ve explored the step-by-step process of deploying a Golang app on AWS App Runner, highlighting its simplicity.
By leveraging AWS’s managed service, developers can focus more on building and improving their applications, rather than managing infrastructure. With its automatic scaling capabilities and integration with other AWS services, AWS App Runner emerges as a compelling choice for deploying Golang applications, promising a smoother and more agile development experience.