Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions elb.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
resource "aws_elb" "bar" {
name = "raham-terraform-elb"
availability_zones = ["ap-southeast-1a", "ap-southeast-1b"]
name = "akhi-terraform-elb"
availability_zones = ["us-west-1a", "us-west-1b"]

listener {
instance_port = 80
Expand All @@ -21,15 +21,15 @@ resource "aws_elb" "bar" {
cross_zone_load_balancing = true
idle_timeout = 400
tags = {
Name = "raham-tf-elb"
Name = "akhila-tf-elb"
}
}

/*resource "aws_rds_cluster" "default" {
cluster_identifier = "aurora-cluster-demo"
engine = "aurora-mysql"
engine_version = "5.7.mysql_aurora.2.11.2"
availability_zones = ["ap-southeast-1a", "ap-southeast-1b"]
availability_zones = ["us-east-1a", "us-east-1b"]
database_name = "mydb"
master_username = "raham"
master_password = "Rahamshaik#444555"
Expand All @@ -39,7 +39,7 @@ resource "aws_elb" "bar" {

/*resource "aws_instance" "one" {
for_each = toset(["one", "two", "three"])
ami = "ami-006be9ab6a140de6e"
ami = "ami-0ebfd941bbafe70c6"
instance_type = "t2.micro"
tags = {
Name = "instance-${each.key}"
Expand Down
35 changes: 17 additions & 18 deletions main.tf
Original file line number Diff line number Diff line change
@@ -1,63 +1,62 @@

provider "aws" {
region = "ap-southeast-1"
region = "us-west-2"
}

resource "aws_instance" "one" {
ami = "ami-06018068a18569ff2"
ami = "ami-08d8ac128e0a1b91c"
instance_type = "t2.micro"
key_name = "rahamabc"
key_name = "terraform"
vpc_security_group_ids = [aws_security_group.five.id]
availability_zone = "ap-southeast-1a"
availability_zone = "us-west-1a"
user_data = <<EOF
#!/bin/bash
sudo -i
yum install httpd -y
systemctl start httpd
chkconfig httpd on
echo "hai all this is my app created by terraform infrastructurte by raham sir server-1" > /var/www/html/index.html
echo "hai all this is my app created by terraform infrastructurte by akhi of server-1" > /var/www/html/index.html
EOF
tags = {
Name = "web-server-1"
}
}

resource "aws_instance" "two" {
ami = "ami-06018068a18569ff2"
ami = "ami-08d8ac128e0a1b91c"
instance_type = "t2.micro"
key_name = "rahamabc"
key_name = "terraform"
vpc_security_group_ids = [aws_security_group.five.id]
availability_zone = "ap-southeast-1b"
availability_zone = "us-west-1b"
user_data = <<EOF
#!/bin/bash
sudo -i
yum install httpd -y
systemctl start httpd
chkconfig httpd on
echo "hai all this is my website created by terraform infrastructurte by raham sir server-2" > /var/www/html/index.html
echo "hai all this is my website created by terraform infrastructurte by akhi server-2" > /var/www/html/index.html
EOF
tags = {
Name = "web-server-2"
}
}

resource "aws_instance" "three" {
ami = "ami-06018068a18569ff2"
ami = "ami-08d8ac128e0a1b91c"
instance_type = "t2.micro"
key_name = "rahamabc"
key_name = "terraform"
vpc_security_group_ids = [aws_security_group.five.id]
availability_zone = "ap-southeast-1a"
availability_zone = "us-west-1a"
tags = {
Name = "app-server-1"
}
}

resource "aws_instance" "four" {
ami = "ami-06018068a18569ff2"
ami = "ami-08d8ac128e0a1b91c"
instance_type = "t2.micro"
key_name = "rahamabc"
key_name = "terraform"
vpc_security_group_ids = [aws_security_group.five.id]
availability_zone = "ap-southeast-1b"
availability_zone = "us-west-1b"
tags = {
Name = "app-server-2"
}
Expand Down Expand Up @@ -88,7 +87,7 @@ resource "aws_security_group" "five" {
}

resource "aws_s3_bucket" "six" {
bucket = "devopsbyrahamterraserverbucket9988oo9988"
bucket = "akhiterraserverbucket9988oo9988"
}

resource "aws_iam_user" "seven" {
Expand All @@ -103,7 +102,7 @@ default = ["user1", "user2", "user3", "user4"]
}

resource "aws_ebs_volume" "eight" {
availability_zone = "ap-southeast-1a"
availability_zone = "us-west-1a"
size = 40
tags = {
Name = "ebs-001"
Expand Down