Skip to content

Commit

Permalink
Update Terraform.tf
Browse files Browse the repository at this point in the history
  • Loading branch information
alevz257 committed Aug 20, 2019
1 parent a70efc8 commit ee4c531
Showing 1 changed file with 44 additions and 20 deletions.
64 changes: 44 additions & 20 deletions Terraform.tf
Original file line number Diff line number Diff line change
Expand Up @@ -252,23 +252,43 @@ resource "aws_db_subnet_group" "dbSubnetGroupWorkshop" {
}


resource "aws_db_instance" "rdsWorkshop" {
allocated_storage = 20
storage_type = "gp2"
engine = "mysql"
engine_version = "5.7"
instance_class = "db.t2.micro"
name = "rdsWorkshop"
username = "alevz"
password = "Passw0rdDB"
vpc_security_group_ids = ["${aws_security_group.secGroupWorkshopMYSQL.id}"]
db_subnet_group_name = "${aws_db_subnet_group.dbSubnetGroupWorkshop.tags.Name}"
parameter_group_name = "default.mysql5.7"
//snapshot_identifier = "some-snap"
skip_final_snapshot = true
publicly_accessible = true
}

# resource "aws_db_instance" "rdsWorkshop" {
# allocated_storage = 20
# storage_type = "gp2"
# engine = "mysql"
# engine_version = "5.7"
# instance_class = "db.t2.micro"
# name = "rdsWorkshop"
# username = "alevz"
# password = "Passw0rdDB"
# vpc_security_group_ids = ["${aws_security_group.secGroupWorkshopMYSQL.id}"]
# db_subnet_group_name = "${aws_db_subnet_group.dbSubnetGroupWorkshop.tags.Name}"
# parameter_group_name = "default.mysql5.7"
# backup_retention_period = 1
# //snapshot_identifier = "some-snap"
# skip_final_snapshot = true
# publicly_accessible = true
# multi_az = true
# }

# resource "aws_db_instance" "rdsWorkshopReplica" {
# allocated_storage = 20
# storage_type = "gp2"
# engine = "mysql"
# engine_version = "5.7"
# instance_class = "db.t2.micro"
# name = "rdsWorkshopReplica"
# username = "alevz"
# password = "Passw0rdDB"
# vpc_security_group_ids = ["${aws_security_group.secGroupWorkshopMYSQL.id}"]
# db_subnet_group_name = "${aws_db_subnet_group.dbSubnetGroupWorkshop.tags.Name}"
# parameter_group_name = "default.mysql5.7"
# //snapshot_identifier = "some-snap"
# skip_final_snapshot = true
# publicly_accessible = true
# #multi_az = true
# replicate_source_db = "${aws_db_instance.rdsWorkshop.id}"
# }

output "ip" {
value = "${aws_instance.ec2WorkshopWebApp.public_ip}"
Expand All @@ -278,9 +298,13 @@ output "ip2" {
value = "${aws_instance.ec2WorkshopWebApp2.public_ip}"
}

output "ipDB"{
value = "${aws_db_instance.rdsWorkshop.address}"
}
# output "ipDB"{
# value = "${aws_db_instance.rdsWorkshop.address}"
# }

# output "ipDBReplica"{
# value = "${aws_db_instance.rdsWorkshopReplica.address}"
# }

output "dns"{
value = "${aws_instance.ec2WorkshopWebApp.public_dns}"
Expand Down

0 comments on commit ee4c531

Please sign in to comment.