From 36dd5bb8d9c160737164617ed7260579fd83294a Mon Sep 17 00:00:00 2001 From: vishwakarkalle <125394443+vishwakarkalle@users.noreply.github.com> Date: Tue, 21 Mar 2023 12:47:38 +0530 Subject: [PATCH 1/3] terraform copy infrastructure project --- index.html | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 index.html diff --git a/index.html b/index.html new file mode 100644 index 0000000..072f554 --- /dev/null +++ b/index.html @@ -0,0 +1,84 @@ +#this file consists of code for instances and sg +provider "aws" { +region = "ap-south-1" +access_key = "AKIA5JX46EAR27ONXVPE" +secret_key = "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" +} + +resource "aws_instance" "one" { + ami = "ami-0d81306eddc614a45" + instance_type = "t2.micro" + key_name = "rmk8s" + vpc_security_group_ids = [aws_security_group.three.id] + availability_zone = "ap-south-1a" + user_data = < /var/www/html/index.html +EOF + tags = { + Name = "server-1" + } +} + +resource "aws_instance" "two" { + ami = "ami-0d81306eddc614a45" + instance_type = "t2.micro" + key_name = "rmk8s" + vpc_security_group_ids = [aws_security_group.three.id] + availability_zone = "ap-south-1b" + user_data = < /var/www/html/index.html +EOF + tags = { + Name = "server-2" + } +} + +resource "aws_security_group" "three" { + name = "elb-sg" + ingress { + from_port = 22 + to_port = 22 + protocol = "tcp" + cidr_blocks = ["0.0.0.0/0"] + } + + ingress { + from_port = 80 + to_port = 80 + protocol = "tcp" + cidr_blocks = ["0.0.0.0/0"] + } + + egress { + from_port = 0 + to_port = 0 + protocol = "-1" + cidr_blocks = ["0.0.0.0/0"] + } +} + +resource "aws_s3_bucket" "four" { + bucket = "raham0077552bucketterra" +} + +resource "aws_iam_user" "five" { +name = "rahamuser11" +} + +resource "aws_ebs_volume" "six" { + availability_zone = "ap-south-1b" + size = 40 + tags = { + Name = "ebs-001" + } +} From dc0acc281509733832c204cc5ae88aa6d45574bf Mon Sep 17 00:00:00 2001 From: vishwakarkalle <125394443+vishwakarkalle@users.noreply.github.com> Date: Tue, 21 Mar 2023 14:53:15 +0530 Subject: [PATCH 2/3] Delete main.tf --- main.tf | 84 --------------------------------------------------------- 1 file changed, 84 deletions(-) delete mode 100644 main.tf diff --git a/main.tf b/main.tf deleted file mode 100644 index 9f7ea04..0000000 --- a/main.tf +++ /dev/null @@ -1,84 +0,0 @@ -#this file consists of code for instances and sg -provider "aws" { -region = "ap-south-1" -access_key = "AKIARSPNELGYCJEVYJ4K" -secret_key = "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" -} - -resource "aws_instance" "one" { - ami = "ami-0d81306eddc614a45" - instance_type = "t2.micro" - key_name = "rmk8s" - vpc_security_group_ids = [aws_security_group.three.id] - availability_zone = "ap-south-1a" - user_data = < /var/www/html/index.html -EOF - tags = { - Name = "server-1" - } -} - -resource "aws_instance" "two" { - ami = "ami-0d81306eddc614a45" - instance_type = "t2.micro" - key_name = "rmk8s" - vpc_security_group_ids = [aws_security_group.three.id] - availability_zone = "ap-south-1b" - user_data = < /var/www/html/index.html -EOF - tags = { - Name = "server-2" - } -} - -resource "aws_security_group" "three" { - name = "elb-sg" - ingress { - from_port = 22 - to_port = 22 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - ingress { - from_port = 80 - to_port = 80 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - egress { - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } -} - -resource "aws_s3_bucket" "four" { - bucket = "raham0077552bucketterra" -} - -resource "aws_iam_user" "five" { -name = "rahamuser11" -} - -resource "aws_ebs_volume" "six" { - availability_zone = "ap-south-1b" - size = 40 - tags = { - Name = "ebs-001" - } -} From 6120065a76df02c5538372d4e02ba91c50f1bd21 Mon Sep 17 00:00:00 2001 From: vishwakarkalle <125394443+vishwakarkalle@users.noreply.github.com> Date: Tue, 21 Mar 2023 16:47:19 +0530 Subject: [PATCH 3/3] Update index.html --- index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 072f554..a30b50c 100644 --- a/index.html +++ b/index.html @@ -6,7 +6,7 @@ } resource "aws_instance" "one" { - ami = "ami-0d81306eddc614a45" + ami = "ami-05afd67c4a44cc983" instance_type = "t2.micro" key_name = "rmk8s" vpc_security_group_ids = [aws_security_group.three.id] @@ -25,7 +25,7 @@ } resource "aws_instance" "two" { - ami = "ami-0d81306eddc614a45" + ami = "ami-05afd67c4a44cc983" instance_type = "t2.micro" key_name = "rmk8s" vpc_security_group_ids = [aws_security_group.three.id]