Apigateway creating resource with with multiple http-methods

Hi , I have created template for apigateway with counter for http_methods and remaining process like integration m deployment follows. From project i am passing a list of http_methods [post, get, put, delete]. but every time i apply the order of http_methods is changing so it trying to create a new methods and throwing an error method already exits. I tried with counter and for_each and even sorted the list. But Terraform has its own choice. .Any suggestions please