How to conditionally declare environment varaibles in the configuration for different stages?

    DB_HOST: ${param:DB_HOST}

I have the above declarations under provider.environment.

I want to be able to use only DB_WRITE_HOST and DB_READ_HOST when the stage is “prod” and DB_HOST when stage is “dev”.

But since serverless tries to fetch all the variables from serverless dashboard parameters, I get the error Value not found at "param" source.