Using older version of elasticsearch engine for your AWS ElasticSearch domains goes against compliance.
In AWS Console -
In Terraform -
References:
https://docs.aws.amazon.com/opensearch-service/latest/developerguide/version-migration.html
https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/elasticsearch_domain