Skip to content

Commit

Permalink
complete
Browse files Browse the repository at this point in the history
  • Loading branch information
box-genius committed Jul 4, 2024
1 parent d81a3d9 commit 969f2dd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Terraform_IaC/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ resource "aws_instance" "web" {
count = 10
ami = var.ami_id
instance_type = var.instance_type
key_name = var.key_name

tags = {
Name = "Minsait_${count.index}"
Expand All @@ -18,5 +19,10 @@ resource "aws_instance" "web" {
sudo usermod -aG docker ubuntu
sudo systemctl enable docker
sudo systemctl start docker
if docker --version > /var/log/docker-install.log 2>&1; then
echo "Docker installed successfully" >> /var/log/docker-install.log
else
echo "Docker installation failed" >> /var/log/docker-install.log
fi
EOF
}
}
8 changes: 8 additions & 0 deletions Terraform_IaC/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,12 @@ variable "instance_type" {
description = "Tipo da instância"
type = string
default = "t2.micro"
}

variable "key_name" {
description = "The name of the SSH key pair to use"
}

variable "private_key_path" {
description = "The path to the private key file"
}

0 comments on commit 969f2dd

Please sign in to comment.