Skip to content

thnbao22/DEPLOY-INFRA-AWS-FCJ-MISSION2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 

Repository files navigation

DEPLOY-INFRA-AWS-FCJ-MISSION2

Tech Stack used in this project: Elastic Load Balancing, Amazon EC2, Auto Scaling Group, Amazon SNS, and Amazon Virtual Private Cloud.

Architecture

ConnectPrivate

Overview

In this lab, we will learn how to deploy a highly available infrastructure on AWS using Terraform, a popular infrastructure as code tool.

You can explore more at here

Requirements

To do this lab, you will need to install Visual Studio Code, AWS CLI and Terraform on your local machine.

AWS Account

You should have an AWS account, which has an IAM user with Administrative permission.

Set up Visual Studio Code

After installing Visual Studio Code successfully, you can download an extension for Terraform called HashiCorp Terraform.

ConnectPrivate

Set up Terraform

You can check if the Terraform is installed on your local machine by opening terminal and typing terraform version

ConnectPrivate

Set up AWS CLI version 2

You can check if the AWS CLI is installed on your local machine by opening terminal and typing aws --version.

ConnectPrivate

Access keys

Next, You will need to create an Access keys. Following these step below to create an Access keys.

  1. Click on your AWS account and it will appears a tab. Choose Security credentials.

ConnectPrivate

  1. Scroll down, you will see an Access keys interface. Click on Create access key.

ConnectPrivate

  1. In the Create access key interface, choose Third party service.

ConnectPrivate

  1. Then, check the square box. Choose Next.

ConnectPrivate

  1. Click on Create access key

ConnectPrivate

  1. Click on Download .csv file and Done.

ConnectPrivate

  1. Open the .csv file. You will see it has an access key and a secret key.

  2. Open the terminal and type aws configure. You will see some things appear in the terminal.

ConnectPrivate

  1. Configure like below:
  • AWS Access Key ID: Assign your access key
  • AWS Secret Access Key : Assign your secret access key
  • Default region name: Enter ap-southeast-1
  • Default output format: Enter json

Key pair

Here, we need to create a key pair. We can then use this key pair to SSH into our EC2 instances.

About keypair_name, access AWS Management Console and search for EC2 (Remember change your region to Singapore) then click on Key Pairs.

  • Click on Create key pair

ConnectPrivate

Configure like below.

ConnectPrivate

After creating key pair successfully, you will see a notification.

ConnectPrivate

Demo

  1. First, clone this repository.
  • HTTPS
git clone https://github.com/thnbao22/Demo-WorkshopAWS-Using-Terraform.git
  • SSH
git clone git@github.com:thnbao22/Demo-WorkshopAWS-Using-Terraform.git
  1. After cloning this repository, please open the project in Visual Studio Code and navigate to the terraform folder using the cd command on the terminal of Visual Studio Code

ConnectPrivate

  1. Let's begin by initializing your Terraform workspace. Running the following command in the terminal.
terraform init

ConnectPrivate

  1. Now, we need to validate our configuration. Use the following command in the terminal to do so.

ConnectPrivate

  1. Apply the configuration now with the terraform apply command.

ConnectPrivate

  1. Enter yes so terraform can provision infrastructure.

ConnectPrivate

Now, you can follow the workshop to explore more.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published