Storing Terraform state in Gitlab is not much different then storing in AWS, Lets make changes for storing state in Gitlab
Create a project “Terraform” in Gitlab

also note project id, which is 1 in my case

Update Terraform code
Generate Personal Access Token form here
https://gitlab-ci.muhammadumair.com/-/profile/personal_access_tokens
At the end run following command, remember to update PROJECT_ID and PERSONAL_ACCESS_TOEKN before running bellow command