Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set tag #5

Open
wants to merge 41 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
22fce74
testing 123
ahmedlotfy700 Aug 12, 2021
4a91d17
test
ahmedlotfy700 Aug 12, 2021
4f93704
test
ahmedlotfy700 Aug 14, 2021
8438435
removed
ahmedlotfy700 Aug 14, 2021
a668791
test
ahmedlotfy700 Aug 14, 2021
fc2b55b
t
ahmedlotfy700 Aug 14, 2021
5c80fe7
:!W:W
ahmedlotfy700 Aug 19, 2021
5a21ef3
test
ahmedlotfy700 Aug 19, 2021
5ed0573
sda
ahmedlotfy700 Aug 19, 2021
067e92c
testing
ahmedlotfy700 Aug 19, 2021
f515fa7
test:w!
ahmedlotfy700 Aug 19, 2021
cdb6089
ttest
ahmedlotfy700 Aug 19, 2021
37000e0
test
ahmedlotfy700 Aug 19, 2021
c592464
ww:w
ahmedlotfy700 Aug 19, 2021
7359980
all to us east 2
ahmedlotfy700 Aug 19, 2021
c98bd2d
hi there
ahmedlotfy700 Aug 20, 2021
ff421fc
testing
ahmedlotfy700 Aug 20, 2021
e694a08
sd:
ahmedlotfy700 Aug 20, 2021
155c8c4
dsasd
ahmedlotfy700 Aug 20, 2021
efa6032
test
ahmedlotfy700 Aug 20, 2021
3ce8a87
ttest::w!
ahmedlotfy700 Aug 20, 2021
2886218
hi
ahmedlotfy700 Aug 24, 2021
aa046e4
asdaines starting
ahmedlotfy700 Aug 24, 2021
53d3670
test
ahmedlotfy700 Aug 24, 2021
f86ac36
test
ahmedlotfy700 Aug 24, 2021
da8031f
hi
ahmedlotfy700 Aug 24, 2021
fbc9b44
we
ahmedlotfy700 Aug 24, 2021
f34d8d2
tites:
ahmedlotfy700 Aug 24, 2021
d9127e2
test
ahmedlotfy700 Aug 24, 2021
0414d52
ad:W!
ahmedlotfy700 Aug 24, 2021
fc70b4d
test
ahmedlotfy700 Aug 24, 2021
78d9027
: Ptest
ahmedlotfy700 Aug 24, 2021
a012f81
fasas:
ahmedlotfy700 Aug 24, 2021
00f25f9
Pds
ahmedlotfy700 Aug 24, 2021
1463f3f
asd
ahmedlotfy700 Aug 24, 2021
f150e36
hey guys
ahmedlotfy700 Aug 25, 2021
952129c
dasdad
ahmedlotfy700 Aug 26, 2021
00a31c8
ad
ahmedlotfy700 Aug 26, 2021
849cd01
sd:w!
ahmedlotfy700 Aug 26, 2021
e873999
Ahmed n branch set_tag
ahmedlotfy700 Aug 26, 2021
438dc6a
here is a new push to a branch man
ahmedlotfy700 Aug 26, 2021
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
20 changes: 20 additions & 0 deletions 01_05_base/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 31 additions & 2 deletions 01_05_base/main.tf
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
# //////////////////////////////
# BACKEND
# //////////////////////////////
terraform {
backend "s3" {
default="red30-tfstate"
}
}

# //////////////////////////////
# VARIABLES
# //////////////////////////////
variable "aws_access_key" {}

variable "aws_secret_key" {}

variable "ssh_key_name" {}
variable "ssh_key_name" {
default = "tf_key"
}

variable "private_key_path" {}

Expand Down Expand Up @@ -102,7 +113,7 @@ resource "aws_security_group" "sg-nodejs-instance" {
}
}

# INSTANCE
# INSTANCE1
resource "aws_instance" "nodejs1" {
ami = data.aws_ami.aws-linux.id
instance_type = "t2.micro"
Expand All @@ -116,6 +127,24 @@ resource "aws_instance" "nodejs1" {
user = "ec2-user"
private_key = file(var.private_key_path)
}

}

# INSTANCE2
resource "aws_instance" "nodejs2" {
ami = data.aws_ami.aws-linux.id
instance_type = "t2.micro"
subnet_id = aws_subnet.subnet1.id
vpc_security_group_ids = [aws_security_group.sg-nodejs-instance.id]
key_name = var.ssh_key_name

connection {
type = "ssh"
host = self.public_ip
user = "ec2-user"
private_key = file(var.private_key_path)
}

}


Expand Down
Binary file added 01_05_base/terraform.exe
Binary file not shown.
Binary file added 01_05_base/tfp1
Binary file not shown.
20 changes: 20 additions & 0 deletions 02_01_variables/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 21 additions & 6 deletions 02_01_variables/main.tf
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
# //////////////////////////////
# VARIABLES
# //////////////////////////////
variable "deploy_environment" {
default = "DEV"
}
variable "aws_access_key" {}

variable "aws_secret_key" {}

variable "region" {
default = "us-east-2"
default = "us-east-1"
}

variable "vpc_cidr" {
Expand Down Expand Up @@ -59,7 +62,7 @@ variable "environment_instance_settings" {
},
"PROD" = {
instance_type = "t2.micro",
monitoring = true
monitoring = false
}
}
}
Expand Down Expand Up @@ -141,14 +144,26 @@ resource "aws_security_group" "sg-nodejs-instance" {
# INSTANCE
resource "aws_instance" "nodejs1" {
ami = data.aws_ami.aws-linux.id
instance_type = var.environment_instance_type["DEV"]
//instance_type = var.environment_instance_settings["PROD"].instance_type
//instance_type = var.environment_instance_type["DEV"]
instance_type = var.environment_instance_settings[var.deploy_environment].instance_type
subnet_id = aws_subnet.subnet1.id
vpc_security_group_ids = [aws_security_group.sg-nodejs-instance.id]

monitoring = var.environment_instance_settings["PROD"].monitoring
monitoring = var.environment_instance_settings[var.deploy_environment].monitoring

tags = {Environment = var.deploy_environment}

tags = {Environment = var.environment_list[0]}
}
resource "aws_instance" "Shana" {
ami = data.aws_ami.aws-linux.id
//instance_type = var.environment_instance_type["DEV"]
instance_type = var.environment_instance_settings[var.deploy_environment].instance_type
subnet_id = aws_subnet.subnet1.id
vpc_security_group_ids = [aws_security_group.sg-nodejs-instance.id]

monitoring = var.environment_instance_settings[var.deploy_environment].monitoring

tags = {Environment = var.deploy_environment}

}

Expand Down
3 changes: 0 additions & 3 deletions 02_01_variables/terraform.tfvars.backup

This file was deleted.

20 changes: 20 additions & 0 deletions 02_02-07_variables/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions 02_02-07_variables/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -182,4 +182,8 @@ data "aws_ami" "aws-linux" {
# //////////////////////////////
output "instance-dns" {
value = aws_instance.nodejs1.public_dns
}

output "private-dns" {
value= aws_instance.nodejs1.private_dns
}
Binary file added 02_02-07_variables/terraform copy.exe
Binary file not shown.
Binary file added 02_02-07_variables/terraform.exe
Binary file not shown.
13 changes: 13 additions & 0 deletions 02_02-07_variables/terraform.tfvars copy.backup
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# MAC/LINUX
# aws ec2 create-key-pair --key-name tf_key --query 'KeyMaterial' --output text > tf_key.pem
###
# WINDOWS
# aws ec2 create-key-pair --key-name tf_key --query 'KeyMaterial' --output text | out-file -encoding ascii -filepath tf_key.pem

aws_access_key = ""

aws_secret_key = ""

ssh_key_name = ""

private_key_path = ""
6 changes: 5 additions & 1 deletion 02_02-07_variables/terraform.tfvars.backup
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
aws_access_key = ""

aws_secret_key = ""
aws_secret_key = ""

ssh_key_name = ""

private_key_path = ""
20 changes: 20 additions & 0 deletions 02_08-09_expressions_functions/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading