AWS Elastic Beanstalk is a Platform-as-a-Service (PaaS) that simplifies application deployment and management. It automatically handles capacity provisioning, allowing developers to focus on writing code rather than managing infrastructure.
You simply provide your code while Beanstalk handles:
- EC2 instances
- Load Balancing & Auto Scaling
- Application health checks
- Logs & Metrics
- Rolling updates and blue/green deployments
Supported platforms include: Java, .NET, Node.js, Python, PHP, Ruby, Go, Docker.
Key benefits:
- Scalability
- Automation
- Integration with AWS services
Step 1: Sign in to the AWS Management Console
- Go to the AWS Management Console and sign in with your AWS account.
- Navigate to Elastic Beanstalk
- In the AWS search bar, type Elastic Beanstalk
- Select Elastic Beanstalk from the services list
Step 2: Create a New Application
- Click Create application
- Enter an Application name (for example: getting-started-app)
- (Optional) Add a description
Step 3: Choose Your Platform
- Under Platform, select the programming language your app uses
-
Examples:
- Node.js, Java, Python, PHP, .NET, Ruby, etc.
For me, its Node.js. Choose the platform version (you can leave the default)
Step 4: Upload Your Application Code
-
Under Application code, choose:
- Sample application (recommended for first-time users),
or
-
Upload your code (if you already have an app)
- If uploading your code, select your file (ZIP format)
Step 5: Configure Application Settings (Service Role, Instance Profile, and Key Pair)
Configure security and access settings so Elastic Beanstalk can manage AWS resources so you can securely access your EC2 instances.
5.1: Configure the Elastic Beanstalk Service Role
The service role allows Elastic Beanstalk to interact with other AWS services on your behalf.
Configure service access
Next, you need two roles:
- Service role
- EC2 instance profile role
A service role allows Elastic Beanstalk to monitor your EC2 instances and upgrade your environment’s platform.
An EC2 instance profile role permits tasks such as writing logs and interacting with other services.
Create Service role
If you have previously created a Service role and would like to choose an existing one, select the value from the Service role drop-down. If not, proceed to create a new one.
For Service role, choose Create role.
For Trusted entity type, choose AWS service and leave the rest as default.
Verify that Permissions policies include the following, then choose Next:
Click Create role.
Return to the Configure service access tab, refresh the list, then select the newly created service role.
5.2 Create EC2 instance profile
The E*C2 instance profile* allows EC2 instances in your environment to access AWS services securely.
You can choose an existing one from the EC2 instance profile drop-down or create a new one.
Select Create role.
For Trusted entity type, choose AWS service and leave the rest as default and click Next.
Verify that Permissions policies include the following, then click Next.
Select Create role.
Return to the Configure service access tab, refresh the list, then select the newly created EC2 instance profile.
Now you need to configure and create your application
5.3: Select a Key Pair
A key pair allows you to securely connect to the EC2 instances created by Elastic Beanstalk.
Under EC2 key pair: Select an existing key pair, or Click Create a new key pair. I do have an existing key pair, but i will create a new one for the sake of this tutorial.
To create key pair, open your AWS console in another tab, type key pairs in the search bar and select key pairs.
Enter a key pair name
Ensure you Download and store the key file securely
Without a key pair, you will not be able to connect to the EC2 instance using SSH.
Optional steps: networking, databases, scaling parameters, advanced configuration for updates, monitoring, and logging.
On the Review page, which shows a summary of your choices, select Submit.
5.4: Review Other Settings (Optional)
You can either keep the default settings or adjust them if needed:
- Instance type (EC2 size)
- Auto scaling options
- Environment variables
- Security groups
Click Create.
Step 6: Creating the Environment for the application
AWS will automatically set up the required resources, including:
- EC2 instances
- Auto Scaling group
- Load balancer
- Monitoring and health checks
Please note that This process may take a few minutes. Once completed, your application will be live.
Evidence of Beanstalk being LIVE
To access the EC2 created
On the AWS Console, search for EC2
Check the dashboard to confirm the instance status is running
Select the App created and then connect.
The EC2 instance created while setting up the Elastic Beanstalk is shown below:
S3 Bucket created
Auto Scaling group created
Step 7: Cleaning up your Elastic Beanstalk environment and Terminate the Application
Terminate the environment when you’re done in order to stop billing.
To delete the application and all associated resources, ensure you delete all application versions.
Open the Elastic Beanstalk console, and in the Regions list, select your AWS Region.
In the navigation pane, choose Applications, and then choose your app (the name you gave your app) and choose Application versions.
On the Application versions page, select all application versions that you want to delete. Choose Actions, and then choose Delete.
Turn on Delete versions from Amazon S3. Choose Delete, and then choose Done.
Conclusion
AWS Elastic Beanstalk is an excellent choice for developers who want to deploy applications quickly without managing servers manually. It provides a balance between control and automation, making it ideal for small projects and enterprise applications alike. By leveraging Elastic Beanstalk, you can focus on building great software while AWS handles the heavy lifting of infrastructure management.
Ensure you continue building, learning and developing as many applications as possible :).
Thanks for reading, see you in the next one.




































Top comments (0)