1) Setup Networking (VPC)
- Navigate to the AWS Management Console and locate the VPC service.
- Click Create VPC.
- Select VPC and more. This will start the VPC wizard.
- Create a private and public subnet in 2 Availability Zone Each subnet is connected to a route table, which determines how network traffic is routed. The public subnets are routed to an Internet Gateway
- In the NAT gateways section, select 1 per AZ.
- Review the Network
2) security group
Browse to the Security Groups part of the Amazon EC2 service.
click Create security group to define a new custom security group for our resource
In the Inbound rules section click Add rule
- Load Balancer --> HTTP TCP 80 Anywhere-IPv4 Allow HTTP inbound from Internet
- EC2 --> HTTP TCP 80 Load Balancer Security Group Allow HTTP inbound from Load Balancer Tags are metadata labels you can apply to AWS resources for organization and cost tracking. Create a new tag for the security group by clicking Add new tag. Enter Name for Key and LoadBalancerSecurityGroup for Value. Finalize the creation by clicking Create security group.
Load Balancer:
Web Server:
Browse to the IAM service and click create Role.
Select AWS Service. Choose EC2 for the service or use case.
Select EC2 Role for AWS Systems Manager and click Next
Confirm that the AmazonSSMManagedInstanceCore policy and AmazonS3ReadOnlyAccess Policy has been added to the role and click Next
Name the role. Scroll to the bottom and click Create role
(4) Deploy Compute (EC2)
Browse to the EC2 service.
Click Launch Instance.
Name the server and choose the created VPC, SG, add Role and paste the code then click create.
Upload the User data file:
(5) Administer Web Server (SSM)
In the Amazon EC2 dashboard, select the web server instance. You'll notice it only has a private IP address, not a public one
Select the Session Manager tab in ec2 instance and click Connect.
run the following command in the CLI by connecting the instance to the SSM
(6) Load Balancing (ALB)
Create Load Balancer:
Create Target Group:
Copy the DNS of the Load Balancer and paste it in a new browser tab
(8) Storage (S3)
Top comments (0)