Make ec2 endpoint configurable.

Enables using custom EC2 compatible endpoints.