From feeed862741866d7afb6a48475099967b7652286 Mon Sep 17 00:00:00 2001 From: dhamsey3 <73405591+dhamsey3@users.noreply.github.com> Date: Thu, 18 Apr 2024 12:08:24 +0200 Subject: [PATCH 1/2] Create variable.tf --- variable.tf | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 variable.tf diff --git a/variable.tf b/variable.tf new file mode 100644 index 0000000..1968145 --- /dev/null +++ b/variable.tf @@ -0,0 +1,7 @@ +variable "ami" { + default = "ami-08df646e18b182346" +} + +variable "instance_type" { + default = "t2.micro" +} From dbe7dad4713867f6f99de1fdb778ad7e5551bd26 Mon Sep 17 00:00:00 2001 From: dhamsey3 <73405591+dhamsey3@users.noreply.github.com> Date: Thu, 18 Apr 2024 12:09:22 +0200 Subject: [PATCH 2/2] Update ec2.tf --- ec2.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ec2.tf b/ec2.tf index fc4dd62..ba8e20c 100644 --- a/ec2.tf +++ b/ec2.tf @@ -1,6 +1,6 @@ resource "aws_instance" "myec2" { - ami = "ami-08df646e18b182346" - instance_type = "t2.micro" + ami = var.ami + instance_type = var.instance_type availability_zone = "ap-south-1a" vpc_security_group_ids = [aws_security_group.allow_tls.id] key_name = "pswain"