Fix DynamoDB host override

This PR fixes #1732 and adds a test to prevent it from happening again in the future for DDBv2.