0
0
AWScloud~30 mins

Multi-tier architecture patterns in AWS - Mini Project: Build & Apply

Choose your learning style9 modes available
Build a Multi-tier Architecture on AWS
📖 Scenario: You are setting up a simple multi-tier web application on AWS. This application has three layers: a web layer, an application layer, and a database layer. Each layer will be represented by an AWS resource group.We will create the infrastructure step-by-step using AWS CloudFormation syntax in YAML format to define the resources.
🎯 Goal: Create a CloudFormation template that defines a multi-tier architecture with three layers: WebTier, AppTier, and DBTier. Each tier will be represented by an AWS EC2 instance with specific tags to identify the tier.
📋 What You'll Learn
Define three EC2 instances named WebTierInstance, AppTierInstance, and DBTierInstance.
Each instance must have a Tags property with a Key of Tier and a Value matching its tier name.
Use the Amazon Linux 2 AMI ID ami-0c55b159cbfafe1f0 for all instances.
Set the instance type to t2.micro for all instances.
💡 Why This Matters
🌍 Real World
Multi-tier architectures are common in web applications where separation of concerns improves security, scalability, and maintenance. AWS CloudFormation helps automate the deployment of such architectures.
💼 Career
Understanding how to define multi-tier architectures using Infrastructure as Code is a key skill for cloud engineers and architects working with AWS.
Progress0 / 4 steps
1
Create the Web Tier EC2 Instance
Create a resource called WebTierInstance of type AWS::EC2::Instance with the AMI ID ami-0c55b159cbfafe1f0 and instance type t2.micro. Add a tag with Key set to Tier and Value set to WebTier.
AWS
Need a hint?

Use the Resources section to define the EC2 instance. Remember to add the Tags property with the correct key and value.

2
Add the Application Tier EC2 Instance
Add a resource called AppTierInstance of type AWS::EC2::Instance with the same AMI ID ami-0c55b159cbfafe1f0 and instance type t2.micro. Add a tag with Key set to Tier and Value set to AppTier. Keep the existing WebTierInstance resource unchanged.
AWS
Need a hint?

Define the AppTierInstance resource similarly to the WebTierInstance, changing only the tag value to AppTier.

3
Add the Database Tier EC2 Instance
Add a resource called DBTierInstance of type AWS::EC2::Instance with the AMI ID ami-0c55b159cbfafe1f0 and instance type t2.micro. Add a tag with Key set to Tier and Value set to DBTier. Keep the existing WebTierInstance and AppTierInstance resources unchanged.
AWS
Need a hint?

Define the DBTierInstance resource similarly to the other instances, with the tag value set to DBTier.

4
Complete the CloudFormation Template
Add the AWSTemplateFormatVersion set to 2010-09-09 at the top of the template. Keep all three EC2 instance resources unchanged.
AWS
Need a hint?

The AWSTemplateFormatVersion should be the very first line in the template.