Skip to content
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

Allow local dynamodb to be installed on another host than localhost #8965

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

peerjakobsen
Copy link

Note: Before submitting this pull request, please review our contributing
guidelines
.

Description

The previous version of dynamodb backend only allowed to have local dynamodb on your local dev machine. I changed it so that you can have local dynamodb running on an different machine and use an ip address instead of localhost:8000 . I use 127.0.0.1 as ip address in the unit test but it works with any ip address.

Copy link

codecov bot commented Apr 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.82%. Comparing base (7ce2e41) to head (4a4c00c).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8965   +/-   ##
=======================================
  Coverage   77.81%   77.82%           
=======================================
  Files         150      150           
  Lines       18686    18694    +8     
  Branches     3193     3194    +1     
=======================================
+ Hits        14540    14548    +8     
  Misses       3854     3854           
  Partials      292      292           
Flag Coverage Δ
unittests 77.80% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -153,6 +154,14 @@ def __init__(self, url=None, table_name=None, *args, **kwargs):
secret_access_key=aws_secret_access_key
)

@staticmethod
def _is_valid_ip(ip):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if that's the best way to check it.. or if it's worth delaying for 🤔

Anyway, should not be merged before v5.4 release. We're in RC2 at the moment.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess I could do
pattern = re.compile(r'^[a-z]{2}-[a-z]+-[0-9]{1}$')
if pattern.match(input_string):
do real dynamodb
else:
do local dynamodb
if we trust the AWS region names keeps following the current format of xx-yyyy-n
That would also allow to use non ip hosts names.

@Nusnus
Copy link
Member

Nusnus commented Apr 14, 2024

The docker-docs failure is not related btw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants