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

refactor(parameters): Consistently reference env #319

Merged
merged 5 commits into from
Mar 9, 2021

Conversation

michaelbrewer
Copy link
Contributor

@michaelbrewer michaelbrewer commented Mar 8, 2021

Issue #, if available:

Description of changes:

Use the defined constants to look up service name environment variable

self.application = resolve_env_var_choice(
      choice=application, env=os.getenv(constants.SERVICE_NAME_ENV, "service_undefined")
)

NOTE: This does now defaults to service_undefined

Checklist

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

Use the defined constants to look up service name environment varialbe

NOTE: This does not default to `service_undefined`
@michaelbrewer
Copy link
Contributor Author

Sorry @heitorlessa i botched the commit message.

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.

Thanks a lot Michael for fixing one more internal bit. I've added the new resolve_env_var_choice to ensure correctness and consistency across others.

aws_lambda_powertools/utilities/parameters/appconfig.py Outdated Show resolved Hide resolved
@heitorlessa heitorlessa added internal Maintenance changes area/utilities labels Mar 9, 2021
@heitorlessa heitorlessa merged commit bc0b9cc into aws-powertools:develop Mar 9, 2021
@michaelbrewer michaelbrewer deleted the refactor-appconfig branch March 9, 2021 14:53
michaelbrewer referenced this pull request in gyft/aws-lambda-powertools-python Mar 9, 2021
* refactor(parameters): Contistently reference env

Use the defined constants to look up service name environment varialbe

NOTE: This does not default to `service_undefined`

* chore: bump ci

* refactor: Apply suggestions from code review

Co-authored-by: Heitor Lessa <[email protected]>

* fix: Add missing import

* refactor: Use resolve_env_var_choice

Co-authored-by: Heitor Lessa <[email protected]>
heitorlessa added a commit that referenced this pull request Mar 9, 2021
…tools-python into develop

* 'develop' of https://github.com/awslabs/aws-lambda-powertools-python:
  feat(logging): Include exception_name (#320)
  chore: remove gatsby mention as migrated completed
  refactor(parameters): Consistently reference env (#319)
  docs(metrics): remove minimum dimensions
  docs: Correct code examples (#317)
  docs(metrics): Correct code examples in markdown (#316)
  fix(idempotency): TypeError when calling is_missing_idempotency_key with an int (#315)
  docs(metrics): Corrections to the code examples (#314)
  fix(idempotency): Correctly handle save_inprogress errors (#313)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal Maintenance changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants