Skip to content

Access defined runtime environment variables from powertools #1172

@Fahadmo

Description

@Fahadmo

Is your feature request related to a problem? Please describe.

AWS Lambda has defined runtime environment variables as shown here: https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-runtime

In order to get the name of the variable we often need to go back to the documentation which can be frustrating.

Describe the solution you'd like

I would like to have something that would let me access all defined environment variables.
For example, this could be a class with a list of cached properties for each defined runtime variable.

@cache 
@property
def AWS_REGION(self):
    return os.environ.get("AWS_REGION")

Describe alternatives you've considered
Currently, we just run the following for each environment variable we need.

x = os.environ.get(<ENV VARIABLE NAME>)

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestfeature requestneed-customer-feedbackRequires more customers feedback before making or revisiting a decision

    Type

    No type

    Projects

    Status

    Shipped

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions