From d1ca34a51ecba06e5b664ba96b2767956612c795 Mon Sep 17 00:00:00 2001 From: Ran <29404873+Ran9waves@users.noreply.github.com> Date: Wed, 27 Nov 2024 06:20:36 +0000 Subject: [PATCH 1/3] initial commit --- main.tf | 2 +- outputs.tf | 12 ++++++------ variables.tf | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/main.tf b/main.tf index 9b32ce06b..0bfc35451 100644 --- a/main.tf +++ b/main.tf @@ -16,7 +16,7 @@ data "aws_ami" "app_ami" { resource "aws_instance" "web" { ami = data.aws_ami.app_ami.id - instance_type = "t3.nano" + instance_type = var.instance_type tags = { Name = "HelloWorld" diff --git a/outputs.tf b/outputs.tf index b35171bef..c429b19b4 100644 --- a/outputs.tf +++ b/outputs.tf @@ -1,7 +1,7 @@ -#output "instance_ami" { -# value = aws_instance.web.ami -#} +output "instance_ami" { + value = aws_instance.web.ami +} -#output "instance_arn" { -# value = aws_instance.web.arn -#} +output "instance_arn" { + value = aws_instance.web.arn +} diff --git a/variables.tf b/variables.tf index c750667e0..60856bc92 100644 --- a/variables.tf +++ b/variables.tf @@ -1,4 +1,4 @@ -#variable "instance_type" { -# description = "Type of EC2 instance to provision" -# default = "t3.nano" -#} +variable "instance_type" { + description = "Type of EC2 instance to provision" + default = "t3.nano" +} From eb595a36657a67ebff2de1a9830c6a801688ddf9 Mon Sep 17 00:00:00 2001 From: Ran <29404873+Ran9waves@users.noreply.github.com> Date: Wed, 27 Nov 2024 06:27:01 +0000 Subject: [PATCH 2/3] name change --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 0bfc35451..a5284ea02 100644 --- a/main.tf +++ b/main.tf @@ -14,7 +14,7 @@ data "aws_ami" "app_ami" { owners = ["979382823631"] # Bitnami } -resource "aws_instance" "web" { +resource "aws_instance" "blog" { ami = data.aws_ami.app_ami.id instance_type = var.instance_type From bd933261d046fa9125c53fb676b6534afb5be692 Mon Sep 17 00:00:00 2001 From: Ran <29404873+Ran9waves@users.noreply.github.com> Date: Wed, 27 Nov 2024 06:28:57 +0000 Subject: [PATCH 3/3] web to blog --- outputs.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/outputs.tf b/outputs.tf index c429b19b4..7e9410b55 100644 --- a/outputs.tf +++ b/outputs.tf @@ -1,7 +1,7 @@ output "instance_ami" { - value = aws_instance.web.ami + value = aws_instance.blog.ami } output "instance_arn" { - value = aws_instance.web.arn + value = aws_instance.blog.arn }