Skip to content

Maintenance: Prevent error when AWS_LAMBDA_FUNCTION_NAME is not passed in the Idempotency Persistence Layer #4326

@sdangol

Description

@sdangol

Summary

The part where we set the idempotencyKeyPrefix now throws an error if the environment variable AWS_LAMBDA_FUNCTION_NAME is not present in the execution environment.

Previously, this passing this variable was optional and it would not throw an error.

Why is this needed?

This could break the testing workflow who are are not passing that environment variable.

Which area does this relate to?

Idempotency

Solution

Pass '' as a defaultValue to the getStringFromEnv function in https://github.com/aws-powertools/powertools-lambda-typescript/pull/4314/files#diff-9ec12bfb8fddec824e9c5a12714d42f23135cabae6e7e3fa6ea9e58a90440498R40-R43

Acknowledgment

Future readers

Please react with 👍 and your use case to help us understand customer demand.

Metadata

Metadata

Assignees

Labels

completedThis item is complete and has been merged/shippedidempotencyThis item relates to the Idempotency UtilityinternalPRs that introduce changes in governance, tech debt and chores (linting setup, baseline, etc.)

Type

No type

Projects

Status

Shipped

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions