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" 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" +}