Skip to content

RFC: Dynamodb endpoint url for local testing #370

Closed
@rtrive

Description

@rtrive

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

Activity

added this to the 1.14.0 milestone on Mar 29, 2021
heitorlessa

heitorlessa commented on Mar 29, 2021

@heitorlessa
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!

rtrive

rtrive commented on Mar 30, 2021

@rtrive
ContributorAuthor

Ciao @heitorlessa!!

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

rtrive

rtrive commented on Mar 30, 2021

@rtrive
ContributorAuthor
self-assigned this
on Mar 31, 2021
heitorlessa

heitorlessa commented on Mar 31, 2021

@heitorlessa
Contributor

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

heitorlessa

heitorlessa commented on Apr 9, 2021

@heitorlessa
Contributor

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

rtrive

rtrive commented on Apr 9, 2021

@rtrive
ContributorAuthor

it's a pleasure ;)

removed
pending-releaseFix or implementation already in dev waiting to be released
on Jul 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Triage

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @heitorlessa@rtrive

      Issue actions

        RFC: Dynamodb endpoint url for local testing · Issue #370 · aws-powertools/powertools-lambda-python