Skip to content

Commit 686633d

Browse files
committed
updated structure of repo
1 parent 548b817 commit 686633d

17 files changed

+159
-0
lines changed

Software-provision/.gitignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Local .terraform directories
2+
**/.terraform/*
3+
4+
# .tfstate files
5+
*.tfstate
6+
*.tfstate.*
7+
8+
# .tfvars files
9+
*.tfvars

Software-provision/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Terraform-Tutorial
2+
Terraform Tutorial with all the Live Example
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
resource "aws_instance" "web-server" {
3+
ami = "${lookup(var.ami_id, var.region)}"
4+
instance_type = "t2.micro"
5+
key_name = "terraform"
6+
7+
8+
provisioner "file" {
9+
source = "index.html"
10+
destination = "/tmp/index.html"
11+
}
12+
provisioner "remote-exec" {
13+
inline = [
14+
"sudo yum install -y httpd;sudo cp /tmp/index.html /var/www/html/",
15+
"sudo service httpd restart",
16+
"sudo service httpd status"
17+
]
18+
}
19+
connection {
20+
//type = "ssh"
21+
user = "ec2-user"
22+
private_key = "${file("${var.private_key_path}")}"
23+
host = "${aws_instance.web-server.public_ip}"
24+
}
25+
}

Software-provision/index.html

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<HTML>
2+
<HEAD>
3+
THIS IS MY WEB Server Deployed on AWS EC2 Intance using Terraform Script
4+
</HEAD>
5+
</HTML>

Software-provision/provider.tf

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
provider "aws" {
2+
region = "${var.region}"
3+
access_key = "${var.access_key}"
4+
secret_key = "${var.secret_key}"
5+
version = "~> 2.0"
6+
}

Software-provision/terraform.pem

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
-----BEGIN RSA PRIVATE KEY-----
2+
MIIEpAIBAAKCAQEAjwPLx8LUEWbq9K84qM7J39Ksl8gtAtKczKuduC6xfEygjfznhjG73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Ey5QbpPgLbo9ilW+5xmqS8TFLq327uxS4TsqX4JXFx6Aj5zWZzNo
17+
QGrilTiiiD/kU6t89WAhi+PRBxdNrl5dGjiSdkFLRkW04PIYW0ivHN6HhM9fx/oa7b3ftmaiec5f
18+
AsOGZeV2Oqylfze5ZmWPzQECgYEAjG5XBvpDmgJ5NGEIQsrwg83YUbk9Eb7Ti+9bBxsLCKgJeaDo
19+
W1b3IKitBRocoAO2aQmLJtvCRhKZC6St1XH1bGIezJ33gk3wbg5ATLCClyQbkPN0V8rKYRXX7Q5X
20+
lYHkePZc8+NiS9kS6K8GMFmgOdrzCb3DQEbdR10X81dmYLECgYAhsgAbZNzrXAO+E3ooTJgIyZLW
21+
QxB74kDIxTNFgUL+U01l70x92aY03TofLFare+9jGuNdDmLjzqbTswz/AXK8FUkxbRo8R18ldpoz
22+
gvgh56v8VYulsULRphNeKoXJG3CTRmQEjDgrKYRSzHed3nVnRctT0iUAg/zAbUpzOIhdgg==
23+
-----END RSA PRIVATE KEY-----

Software-provision/variables.tf

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
variable "access_key" {}
2+
variable "secret_key" {}
3+
variable "region" {
4+
default = "us-east-1"
5+
}
6+
variable "private_key_path" {
7+
default = "terraform.pem"
8+
}
9+
10+
variable "ami_id" {
11+
type = "map"
12+
default = {
13+
us-east-1 = "ami-035b3c7efe6d061d5"
14+
eu-west-2 = "ami-132b3c7efe6sdfdsfd"
15+
eu-central-1 = "ami-9787h5h6nsn"
16+
}
17+
}

aws-instance-first-script/.gitignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Local .terraform directories
2+
**/.terraform/*
3+
4+
# .tfstate files
5+
*.tfstate
6+
*.tfstate.*
7+
8+
# .tfvars files
9+
*.tfvars

aws-instance-first-script/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Terraform-Tutorial
2+
Terraform Tutorial with all the Live Example
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
resource "aws_instance" "web1" {
2+
ami = "${lookup(var.ami_id, var.region)}"
3+
instance_type = "t2.micro"
4+
}

aws-instance-first-script/provider.tf

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
provider "aws" {
2+
region = "${var.region}"
3+
access_key = "${var.access_key}"
4+
secret_key = "${var.secret_key}"
5+
version = "~> 2.0"
6+
}
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
variable "access_key" {}
2+
variable "secret_key" {}
3+
variable "region" {
4+
default = "us-east-1"
5+
}
6+
variable "ami_id" {
7+
type = "map"
8+
default = {
9+
us-east-1 = "ami-035b3c7efe6d061d5"
10+
eu-west-2 = "ami-132b3c7efe6sdfdsfd"
11+
eu-central-1 = "ami-9787h5h6nsn"
12+
}
13+
}

terraform-output/.gitignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Local .terraform directories
2+
**/.terraform/*
3+
4+
# .tfstate files
5+
*.tfstate
6+
*.tfstate.*
7+
8+
# .tfvars files
9+
*.tfvars

terraform-output/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Terraform-Tutorial
2+
Terraform Tutorial with all the Live Example
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
resource "aws_instance" "web-server" {
2+
ami = "${lookup(var.ami_id, var.region)}"
3+
instance_type = "t2.micro"
4+
}
5+
6+
output "public_ip"{
7+
value="${aws_instance.web-server.public_ip}"
8+
}

terraform-output/provider.tf

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
provider "aws" {
2+
region = "${var.region}"
3+
access_key = "${var.access_key}"
4+
secret_key = "${var.secret_key}"
5+
version = "~> 2.0"
6+
}

terraform-output/variables.tf

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
variable "access_key" {}
2+
variable "secret_key" {}
3+
variable "region" {
4+
default = "us-east-1"
5+
}
6+
variable "ami_id" {
7+
type = "map"
8+
default = {
9+
us-east-1 = "ami-035b3c7efe6d061d5"
10+
eu-west-2 = "ami-132b3c7efe6sdfdsfd"
11+
eu-central-1 = "ami-9787h5h6nsn"
12+
}
13+
}

0 commit comments

Comments
 (0)