Skip to content

Commit

Permalink
Allow configuration of boto endpoint_url (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
ronaldotd authored and osantana committed Oct 14, 2019
1 parent 61b3510 commit 2ae0ef8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion prettyconf/loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ def __getitem__(self, item):


class AwsParameterStore(AbstractConfigurationLoader):
def __init__(self, path="/", aws_access_key_id=None, aws_secret_access_key=None, region_name="us-east-1"):
def __init__(self, path="/", aws_access_key_id=None, aws_secret_access_key=None, region_name="us-east-1", endpoint_url=None):
if not boto3:
raise RuntimeError(
'AwsParameterStore requires [aws] feature. Please install it: "pip install prettyconf[aws]"'
Expand All @@ -320,6 +320,7 @@ def __init__(self, path="/", aws_access_key_id=None, aws_secret_access_key=None,
self.aws_access_key_id = aws_access_key_id
self.aws_secret_access_key = aws_secret_access_key
self.region_name = region_name
self.endpoint_url = endpoint_url
self._fetched = False
self._parameters = {}

Expand All @@ -336,6 +337,7 @@ def _fetch_parameters(self):
aws_access_key_id=self.aws_access_key_id,
aws_secret_access_key=self.aws_secret_access_key,
region_name=self.region_name,
endpoint_url=self.endpoint_url,
)

response = client.get_parameters_by_path(Path=self.path)
Expand Down

0 comments on commit 2ae0ef8

Please sign in to comment.