How to create an Elastic Beanstalk environment in AWS

This guide will walk you through creating an Elastic Beanstalk environment in AWS. Think of Elastic Beanstalk as your personal deployment genie in the cloud. It handles all infrastructure details, allowing you to focus on code. It supports various languages and works, making it ideal for developers. Plus, it offers perks like auto-scaling and seamless integration with AWS services. Other guides can be found here: How to install and manage ClamAV and ClamTK on Ubuntu Linux and GitHub Pages Deployment Guide also How to Install Azure Backup Agent
With Elastic Beanstalk, deploying and scaling applications is as easy as waving a wand.
You can see other guides here: How to Create Self-Hosted Agent for Azure DevOps Pipelines and VPC, Subnet, NACL, Security Group: Create your own Network on AWS from Scratch [Part 2] and How to Create Self-Hosted Agent for Azure DevOps Pipelines
Search for EBS on the AWS Console
Type EBS and click enter

Create an EBS application
This is done by clicking on the application as shown below.

fill out all of the required information.

Examining the screenshot provided above, it’s evident that: Initially, we selected a web environment. Subsequently, we inputted an application name. Lastly, the environment name was automatically assigned to us.

Highlights from the screenshot above: Initially, the platform type was automatically selected.
Next, we selected PHP as the platform. Finally, we opted for the Sample application instead of uploading the code. Leave all other settings as default and proceed by clicking “Next.”.
Create an EC2 instance profile
This is the most important part that requires attention. Consequently, if you make a mistake with this, the deployment may fail. Clicking on “view permission” on the access page of the EBS tells us that we need to create an ECS role. Therefore, let’s head over to IAM and create this.

On a separate tab, go to the AWS console and create an EC2 profile. We can create an EC2 instance profile by following the steps. Search for IAM

Click on roles

Next would be to Create role

Under trusted entity type, choose AWS Service

Under use case Select EC2 and navigate to the Next button.
Finally, search for AWSElasticBeanstalkWebTier which is the specific role copied from the view page section of the access page. Select the permission and navigate to the Next

This is the final step of the creation process, so enter the information for the name and others and go and hit the submit button.

Move to Create role to complete the process

Finally, we can see that we have created an EC2 profile

Now that the most important step is out of the way, we can return back to the configure access for the EBS environment.
Configure EBS Application Access
We need to click on use an existing service role since this was created in the previous step

We need to select the EC2 instance profile. The one we created in the previous step might not come up immediately, so there is a need to do a refresh till it shows up.

Click on Next to proceed to the final phase.

Networking, database, and tags are optional for this section. However, we must not overlook the issue of the VPC. Additionally, we should ensure that at least one availability zone is selected.

Instance traffic and scaling are optional so, go with the default options.

The next item is for monitoring, just go with all the default options.

Finally, click on the submit button.

Creating the environment might require some time, but eventually, it will be created, as shown below.

The URL can be retrieved from the main page as shown below:

If we past the URL for the domain in a browser, we will see the following:

We can see that EBS created other services as well.

Conclusion on creating an Elastic Beanstalk application in AWS
Elastic Beanstalk, as an AWS platform-as-a-service solution, offers developers the convenience of seamlessly provisioning additional services required for application development with minimal developer intervention.
By following a simple guide, developers can easily learn the steps to create an Elastic Beanstalk environment, streamlining the deployment process and reducing unnecessary stress.
I hope you found this guide on how to create an Elastic Beanstalk environment in AWS useful. Please feel free to leave a comment below.