v1.10.1
·
4184 commits
to develop
since this release
Changes
This release patches a model mismatch when using SNS -> SQS -> Lambda as opposed to SNS -> Lambda. The former changes three keys that are incompatible with the model we derived from Lambda:
MessageAttributes
key is not presentUnsubscribeUrl
becomesUnsubscribeURL
SigningCertUrl
becomesSigningCertURL
This release also introduces a new envelope, SnsSqsEnvelope
, to make this process seamless and easier when processing messages in Lambda that come from SNS -> SQS. This will extract the original SNS published payload, unmarshall it, and parse it using your model.
from aws_lambda_powertools.utilities.parser import BaseModel, envelopes, event_parser
class MySnsBusiness(BaseModel):
message: str
username: str
@event_parser(model=MySnsBusiness, envelope=envelopes.SnsSqsEnvelope)
def handle_sns_sqs_json_body(event: List[MySnsBusiness], _: LambdaContext):
assert len(event) == 1
assert event[0].message == "hello world"
assert event[0].username == "lessa"
🌟 Minor Changes
- feat: add support for SNS->SQS protocol (#272) by @heitorlessa
Maintenance
- chore: bump to 1.10.1 (#273) by @heitorlessa