What Is AWS Elastic Beanstalk?
You need a Golang development environment set up on your machine to follow along in this section.
In your root project directory, create a folder namedstaticand create anindex.htmlfile in it.
Copy and paste the following code into the HTML file and save it.
Return to your project root directory and create anapplication.gofile.
Copy and paste the code below into yourapplication.gofile and save it.
Elastic Beanstalk by default uses an NGINX configuration that forwards requests to your system on port 5000 only.
You now have your sample tool built and ready for deployment.
In the next section, youll be deploying the program to AWS Elastic Beanstalk.
If currently you dont have an AWS account, go toAWSs sign-up pageto create a new one for free.
And to shut down your system and all its resources, you’re able to runeb terminate.
You have now successfully deployed a Golang web tool to AWS Elastic Beanstalk using the Elastic Beanstalk CLI tool.