Skip to content

RFC: Dynamodb endpoint url for local testing #370

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

Closed
rtrive opened this issue Mar 28, 2021 · 6 comments
Closed

RFC: Dynamodb endpoint url for local testing #370

rtrive opened this issue Mar 28, 2021 · 6 comments
Assignees
Labels
Milestone

Comments

@rtrive
Copy link
Contributor

rtrive commented Mar 28, 2021

Key information

  • RFC PR:
  • Related issue(s), if known:
  • Area: Utilities-Parameters-DynamoDB
  • Meet tenets: Yes
  • Approved by: ''
  • Reviewed by: ''

Summary

Add possibility to use this library in AWS lambda with DynamoDB local that run on docker.

Motivation

When you want to test your lambda locally you could user DynamoDB local to avoid to interact with remote database. Right now the parameter endpoint_url is missing on dynamodb provider configuratio

Proposal

  def __init__(
      self,
      table_name: str,
      key_attr: str = "id",
      sort_attr: str = "sk",
      value_attr: str = "value",
      endpoint_url: Optional[str] = None,
      config: Optional[Config] = None,
  ):
      """
      Initialize the DynamoDB client
      """

      config = config or Config()
      self.table = boto3.resource("dynamodb", endpoint_url=endpoint_url, config=config).Table(table_name)

Insert enpoindt_url parameter as init config of dynamodb provider

If this feature should be available in other runtimes (e.g. Java, Typescript), how would this look like to ensure consistency?

Drawbacks

Why should we not do this? Few people are interested on local dynamodb

Do we need additional dependencies? Impact performance/package size? no

Rationale and alternatives

  • What other designs have been considered? Why not them?
  • What is the impact of not doing this?

Unresolved questions

Optional, stash area for topics that need further development e.g. TBD

@rtrive rtrive added RFC triage Pending triage from maintainers labels Mar 28, 2021
@heitorlessa heitorlessa added this to the 1.14.0 milestone Mar 29, 2021
@heitorlessa
Copy link
Contributor

Ciao Riccardo!! Definitely on-board with that. There are two things I wanted to do here but might be able to do only next week:

  1. Add this - Should be a quick PR, so happy to guide a contribution if you'd like
  2. Also add a Session parameter - This will allow customers to fetch parameters across account, as boto Config object isn't enough

I tagged this to make sure it's done and available in the next minor release ;)

Thank you!

@heitorlessa heitorlessa removed the triage Pending triage from maintainers label Mar 29, 2021
@rtrive
Copy link
Contributor Author

rtrive commented Mar 30, 2021

Ciao @heitorlessa!!

i build a small PR only for endpoint_url and i will try to merged it asap :)

@rtrive
Copy link
Contributor Author

rtrive commented Mar 30, 2021

#376

@heitorlessa heitorlessa added the pending-release Fix or implementation already in dev waiting to be released label Mar 31, 2021
@heitorlessa heitorlessa self-assigned this Mar 31, 2021
@heitorlessa
Copy link
Contributor

Merged 🎉 this will be out in the next release hopefully by next EOW

@heitorlessa
Copy link
Contributor

hey @rtrive this is now out as part of 1.14.0 release ;) Thanks a lot for contributing it!

@rtrive
Copy link
Contributor Author

rtrive commented Apr 9, 2021

it's a pleasure ;)

@heitorlessa heitorlessa removed the pending-release Fix or implementation already in dev waiting to be released label Jul 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

No branches or pull requests

2 participants