-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for endpoint_url for local dynamodb table #300
base: master
Are you sure you want to change the base?
Add support for endpoint_url for local dynamodb table #300
Conversation
Create Table:
Put:
List:
Get:
GetAll:
Localstack Running on Local:
|
Would love for this to go through |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Been using this on my local for the past day and works well
Thanks @SamCullin !! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! This is an awesome idea. I tried this out with localstack and it works great. I'm going to look into doing the same for KMS for offline testing.
I left one very minor suggestion about the new arg. Could you please update when you have time?
credstash.py
Outdated
@@ -907,6 +911,14 @@ def get_parser(): | |||
"CREDSTASH_DEFAULT_TABLE env variable, " | |||
"or if that is not set, the value " | |||
"`credential-store` will be used") | |||
parsers['super'].add_argument("--endpoint_url", default=os.environ.get("DYNAMODB_ENDPOINT_URL", None), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super-small issue - could you please change this to --endpoint-url
to be consistent with the other args?
parsers['super'].add_argument("--endpoint_url", default=os.environ.get("DYNAMODB_ENDPOINT_URL", None), | |
parsers['super'].add_argument("--endpoint-url", default=os.environ.get("DYNAMODB_ENDPOINT_URL", None), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done 👍
One thing that may be an issue is that people may expect the --endpoint-url to also update the KMS endpoint. Maybe something like --dynamo-endpoint-url might be more appropriate. So then if someone wants to add --kms-endpoint-url in the future they can. |
This is a good point - and matching the env variable name would also be intuitive I'll create a followup issue to add similar support for the KMS endpoint. |
This PR was needed for a use case I had, I had to make further changes to get it working, one typographic error and also add in KMS to the endpoint_url.
|
We will like to use credstash with the local dynamodb table created using https://github.com/localstack/localstack.
This PR adds support for adding
endpoint_url
while making the session to connect to the local dynamodb table rather than the remote AWS service.It accepts the endpoint_url as an argument or via an environment variable
DYNAMODB_ENDPOINT_URL
, defaulting to None.Have tested all the functions both with and without the endpoint_url. This will be a non-breaking change.