Unable to upgrade the Terraform version from v0.13.15 to v1.4.7 Could anyone help in this .Etching the error

Planning failed. Terraform encountered an error while generating this plan.

│ Error: Your query returned no results. Please change your search criteria and try again.

│ with module.windowsserver2012r2ami.data.aws_ami.ami,
│ on .terraform/modules/windowsserver2012r2ami/main.tf line 2, in data “aws_ami” “ami”:
│ 2: data “aws_ami” “ami” {