Upgrade version of AWS Elasticsearch through terraform

I am trying to upgrade the version of AWS Elasticsearch that we use through terraform but I can’t find any documentation on how to do this. Has anyone had any experience with how to do this or know how. We are running on version 2 but want to upgrade to version 5 and then to 6.8. I need to create a snapshot and restore the new version from this but I don’t know how to do this through terraform. We don’t want to delete the current version either for a while until we have it tested. Any help would be greatly appreciated