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

feat: add parameter utility #96

Merged
merged 31 commits into from
Aug 21, 2020
Merged

feat: add parameter utility #96

merged 31 commits into from
Aug 21, 2020

Conversation

nmoutschen
Copy link
Contributor

Issue #, if available: #94

Description of changes:

Add a new module aws_lambda_powertools.utilities with a first utility function get_parameter to retrieve and cache SSM parameter values.

Checklist

Breaking change checklist

RFC issue #: #94

  • Migration process documented
  • Implement warnings (if it can live side by side)

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Copy link
Contributor

@pankajagrawal16 pankajagrawal16 left a comment

Choose a reason for hiding this comment

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

Not a python pro here but learning :) Looks neat 💯 . Looks like few build steps are failing.

@codecov-commenter
Copy link

codecov-commenter commented Jul 29, 2020

Codecov Report

Merging #96 into develop will decrease coverage by 1.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop      #96      +/-   ##
===========================================
- Coverage   100.00%   98.99%   -1.01%     
===========================================
  Files           17       24       +7     
  Lines          467      698     +231     
  Branches        42       64      +22     
===========================================
+ Hits           467      691     +224     
- Misses           0        7       +7     
Impacted Files Coverage Δ
aws_lambda_powertools/utilities/__init__.py 100.00% <100.00%> (ø)
...lambda_powertools/utilities/parameters/__init__.py 100.00% <100.00%> (ø)
aws_lambda_powertools/utilities/parameters/base.py 100.00% <100.00%> (ø)
...lambda_powertools/utilities/parameters/dynamodb.py 100.00% <100.00%> (ø)
...mbda_powertools/utilities/parameters/exceptions.py 100.00% <100.00%> (ø)
..._lambda_powertools/utilities/parameters/secrets.py 100.00% <100.00%> (ø)
aws_lambda_powertools/utilities/parameters/ssm.py 100.00% <100.00%> (ø)
aws_lambda_powertools/tracing/tracer.py 95.85% <0.00%> (-4.15%) ⬇️
aws_lambda_powertools/logging/logger.py 100.00% <0.00%> (ø)
aws_lambda_powertools/metrics/metrics.py 100.00% <0.00%> (ø)
... and 9 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0c75ef1...7b87dfa. Read the comment docs.

@nmoutschen
Copy link
Contributor Author

OK, this should work better. I've used monkeypatch to inject the environment variables instead. 😅

@nmoutschen nmoutschen changed the title feat: add get_parameter utility feat: add parameter utility Jul 30, 2020
Copy link
Contributor

@heitorlessa heitorlessa left a comment

Choose a reason for hiding this comment

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

Adding some initial comments and thoughts - It looks great and super flexible!

I'll continue reviewing the other bits later today

aws_lambda_powertools/utilities/parameters/__init__.py Outdated Show resolved Hide resolved
aws_lambda_powertools/utilities/parameters/__init__.py Outdated Show resolved Hide resolved
aws_lambda_powertools/utilities/parameters/__init__.py Outdated Show resolved Hide resolved
aws_lambda_powertools/utilities/parameters/__init__.py Outdated Show resolved Hide resolved
aws_lambda_powertools/utilities/parameters/__init__.py Outdated Show resolved Hide resolved
aws_lambda_powertools/utilities/parameters/__init__.py Outdated Show resolved Hide resolved
aws_lambda_powertools/utilities/parameters/__init__.py Outdated Show resolved Hide resolved
aws_lambda_powertools/utilities/parameters/__init__.py Outdated Show resolved Hide resolved
aws_lambda_powertools/utilities/parameters/__init__.py Outdated Show resolved Hide resolved
aws_lambda_powertools/utilities/parameters/base.py Outdated Show resolved Hide resolved
aws_lambda_powertools/utilities/parameters/base.py Outdated Show resolved Hide resolved
aws_lambda_powertools/utilities/parameters/dynamodb.py Outdated Show resolved Hide resolved
aws_lambda_powertools/utilities/parameters/dynamodb.py Outdated Show resolved Hide resolved
aws_lambda_powertools/utilities/parameters/secrets.py Outdated Show resolved Hide resolved
aws_lambda_powertools/utilities/parameters/ssm.py Outdated Show resolved Hide resolved
aws_lambda_powertools/utilities/parameters/ssm.py Outdated Show resolved Hide resolved
@heitorlessa
Copy link
Contributor

Reviewing the docs now - Thanks for implementing the other changes so quickly @nmoutschen ;)

Can't wait for 3.6 to reach EOL, so we can use the new Protocols more effectively instead of all-in on ABC: https://www.python.org/dev/peps/pep-0544/

Copy link
Contributor

@heitorlessa heitorlessa left a comment

Choose a reason for hiding this comment

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

Looks good!!

Made some suggestions on how to make it easier for beginners, suggestions on search/parsing, etc.

README.md Outdated Show resolved Hide resolved
docs/content/index.mdx Outdated Show resolved Hide resolved
docs/content/utilities/parameters.mdx Outdated Show resolved Hide resolved
docs/content/utilities/parameters.mdx Outdated Show resolved Hide resolved
docs/content/utilities/parameters.mdx Outdated Show resolved Hide resolved
docs/content/utilities/parameters.mdx Outdated Show resolved Hide resolved
docs/content/utilities/parameters.mdx Outdated Show resolved Hide resolved
docs/content/utilities/parameters.mdx Outdated Show resolved Hide resolved
docs/content/utilities/parameters.mdx Show resolved Hide resolved
Copy link
Contributor

@heitorlessa heitorlessa left a comment

Choose a reason for hiding this comment

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

This is looking great! A few minor changes to complete and we should merge this

docs/content/utilities/parameters.mdx Show resolved Hide resolved
docs/content/utilities/parameters.mdx Outdated Show resolved Hide resolved
docs/content/utilities/parameters.mdx Outdated Show resolved Hide resolved
docs/content/utilities/parameters.mdx Outdated Show resolved Hide resolved
docs/content/utilities/parameters.mdx Show resolved Hide resolved
docs/content/utilities/parameters.mdx Outdated Show resolved Hide resolved
docs/content/utilities/parameters.mdx Show resolved Hide resolved
Merge both high level and class provider functions and methods, since they require the same IAM permission.
@heitorlessa
Copy link
Contributor

SHIP IT!

@nmoutschen nmoutschen merged commit 9c78458 into aws-powertools:develop Aug 21, 2020
heitorlessa referenced this pull request in heitorlessa/aws-lambda-powertools-python Aug 22, 2020
* develop:
  chore: version bump to 1.3.1
  fix(capture_method): should yield inside with (#124)
  chore: bump version to 1.3.0 (#122)
  chore(deps): bump prismjs from 1.20.0 to 1.21.0 in /docs
  chore(deps): bump elliptic from 6.5.2 to 6.5.3 in /docs
  feat: add parameter utility (#96)
  chore: bump version to 1.2.0 (#119)
  feat: add support for tracing of generators using capture_method decorator (#113)
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

6 participants