diff --git a/datacube/drivers/postgres/_connections.py b/datacube/drivers/postgres/_connections.py index c5a9602d0c..58033fa92f 100755 --- a/datacube/drivers/postgres/_connections.py +++ b/datacube/drivers/postgres/_connections.py @@ -27,7 +27,6 @@ import datacube from datacube.index.exceptions import IndexSetupError from datacube.utils import jsonify_document -from datacube.utils.aws import obtain_new_iam_auth_token from . import _api from . import _core @@ -136,6 +135,7 @@ def _create_engine(url, application_name=None, iam_rds_auth=False, iam_rds_timeo ) if iam_rds_auth: + from datacube.utils.aws import obtain_new_iam_auth_token handle_dynamic_token_authentication(engine, obtain_new_iam_auth_token, timeout=iam_rds_timeout, url=url) return engine