Migrate an on-premises Go web application to AWS Elastic Beanstalk by using the binary method
Created by Suhas Basavaraj (AWS) and Shumaz Mukhtar Kazi (AWS)
Summary
This pattern describes how to migrate an on-premises Go web application to AWS Elastic Beanstalk. After the application is migrated, Elastic Beanstalk builds the binary for the source bundle and deploys it to an Amazon Elastic Compute Cloud (Amazon EC2) instance.
As a rehost migration strategy, this pattern’s approach is fast and requires no code changes, which means less testing and migration time.
Prerequisites and limitations
Prerequisites
An active AWS account.
An on-premises Go web application.
A GitHub repository that contains your Go application’s source code. If you do not use GitHub, there are other ways to create an application source bundle for Elastic Beanstalk.
Product versions
The most recent Go version supported by Elastic Beanstalk. For more information, see the Elastic Beanstalk documentation.
Architecture
Source technology stack
An on-premises Go web application
Target technology stack
AWS Elastic Beanstalk
Amazon CloudWatch
Target architecture

Tools
AWS Elastic Beanstalk quickly deploys and manages applications in the AWS Cloud without users having to learn about the infrastructure that runs those applications. Elastic Beanstalk reduces management complexity without restricting choice or control.
GitHub
is an open-source distributed version control system.
Epics
Task | Description | Skills required |
---|---|---|
Create the source bundle for the Go application. | Open the GitHub repository that contains your Go application’s source code and prepare the source bundle. The source bundle contains an | System Admin, Application Developer |
Create a configuration file. | Create an | System Admin, Application Developer |
Create the source bundle .zip file. | Run the following command.
This creates the source bundle .zip file. Download and save the .zip file as a local file. ImportantThe .zip file cannot exceed 512 MB and cannot include a parent folder or top-level directory. | System Admin, Application Developer |
Task | Description | Skills required |
---|---|---|
Choose the Elastic Beanstalk application. |
For instructions on how to create an Elastic Beanstalk application, see the Elastic Beanstalk documentation. | System Admin, Application Developer |
Initiate the Elastic Beanstalk web server environment. |
| System Admin, Application Developer |
Upload the source bundle .zip file to Elastic Beanstalk. |
| System Admin, Application Developer |
Test the deployed Go web application. | You will be redirected to the Elastic Beanstalk application's overview page. At the top of the overview, next to Environment ID, choose the URL that ends in | System Admin, Application Developer |
Troubleshooting
Issue | Solution |
---|---|
Unable to access the application through an Application Load Balancer. | Check the target group that contains your Elastic Beanstalk application. If it’s unhealthy, log in to your Elastic Beanstalk instance and check the |