Hybrid Multi-Cloud Project

Hybrid Multi-Cloud Project

This project is based on the creation of a web server using Terraform, AWS and Github. Projects cover the following points:

  • Creation of key and security group which allow the port 80.
  • Launching EC2 instance with the key and security group
  • Launch one Volume (EBS) and mounting that volume and copying data from GitHub
  • Creating an S3 bucket, and storing data from Github into it
  • Creating a Cloudfront using s3 bucket (which contains images) and use the Cloudfront URL to update the code

Step 1: Creating a global variable for the key pair and setting up the profile

No alt text provided for this image

The profile can be set up by using the command aws configure --profile profile_name and passing the access key and secret key

Step 2: Creating a Security Group which allows port 80 access

No alt text provided for this image

Here the Ingress defines the Inbound Rule. We can add as many Ingress as required.

Step 3: Creating an EC2 instance using the key-pair and security group

No alt text provided for this image

Here I created an EC2 instance with an AMI image. The EC2 is connected by using a connection attribute with tags type, user, private key, and host. A remote executer enables us to run the commands to install https, git & PHP.

Step 4: Creating an EBS volume | Attach, format and Mount | Clone Github Repo

No alt text provided for this image
No alt text provided for this image

This step includes creating an EBS volume which takes the availability zone of EC2 automatically. After creation, we link the volume to a folder and this folder is then formatted and mounted to the var/www/html/ folder as httpd takes the content from this folder. Once done, the content from GitHub is cloned into this.

Step 5: S3 bucket creation | cloning static data

No alt text provided for this image

Here S3 bucket is created with a unique name. A local executed created a folder in which the git repository is cloned to store the static data. If the infrastructure is destroyed, this folder is also destroyed.

Step 6: Cloudfront creation with S3 bucket data

No alt text provided for this image
No alt text provided for this image
No alt text provided for this image

Cloudfront's domain name is derived from the S3 bucket appended with a domain name tag. A Null Resource helps to connect to the instance and use the Cloudfront URL.

Step 7: Display the IP output and launch the application

No alt text provided for this image

Commands to run the file

  • terraform init: initializes the folder & downloads the plugins
  • terraform validate: validates the program syntax
  • terraform apply --auto-approve: runs the program file with default permission
  • terraform destroy --auto-approve: destroys the complete infrastructure
No alt text provided for this image
Thank you for reaching out!
Himanshu Sharma

Early Stage Investing | Theia | JP Morgan I BITS

4 年

Congratulations Abhishek !!

要查看或添加评论,请登录

Abhishek Sharma的更多文章

  • AWS-EKS Cluster and Helm

    AWS-EKS Cluster and Helm

    The Project is based on the creation of EKS Cluster using the AWS-CLI, eksctl and kubectl. Manual creation of PODs and…

    8 条评论

社区洞察

其他会员也浏览了