terraform return : Error: Unsupported argument while using modules

183 Views Asked by At

created a basic terraform folder structure with modules, while initiating terraform plan getting error unsupported, while overriding instance type file in main file getting unsupported error, attached file structure

ec2(module file)

locals{
    amiid = "ami-05548f9cecf47b442"
    
}

variable "instancetype" {
    
    default = "t2.micro"
  
}

resource "aws_instance" "ec2-instance" {
    ami= local.amiid
    instance_type = var.instancetype
}

main.tf file

module "ec2-fst" {
  source = "../../modules/ec2"
  instance_type = "t3.medium"
 
  
}

enter image description here

0

There are 0 best solutions below