Truco 1. Утилиза Лас Метки.
Los Tags EN AWS NOS PERMITEN:
- Тенера Asociados un Máximo de 50 CADA Recurso.
- LLaves de Hasta 128 Caracteres Unicode.
- Valores de Hasta 256 Caracteres Unicode.
- Distanción entre Mayúsculas y Minúsculas Para Llaves y Valores.
Pasinemente Todo Lo Que Necesitamos Para Hacernos un Caché:
lambda_cient = boto3.client('lambda') def save_cache(tags): # tags is a dict of string:string lambda_client.tag_resource( Resource=self_arn, # get it from handler context Tags=json.dumps(tags) ) def get_cache(): return lambda_client.list_tags( Resource=self_arn # get it from handler context ) def invalidate_cache(keys): return lambda_client.untag_resource( Resource=self_arn, Tags=json.dumps(keys) )
Truco 2. Desarrolla tus. Лямбдас en otros lenguajes.
Los Lenguajes soportados esiblemente por aws лямбда сына (en el momento en que escribo este artículo):
- JavaScript (Node.js).
- Python (2 y 3).
- Ява.
- C #.
- Идти.
¿Нет está el lenguaje de tu prefecia? Pues No Peopues, ESA Lista SE Puede Extender A:
- Котлин, Groovy, Ruby Clojure Y Todo Lo Que Soporte La JVM.
- Custquier Lenguaje Soportado Por La Plataforma .NET, Инклюкдо PHP Отказ
- Rug Sobre ладон О Лоубар Интеграсион Con Integración Con Serverless .
- Custquier Cosa que henere Рассуждать
Más Trucos
¿Tienes algún otro que compartir? Deja tu comentario aquí a en dev.
Оригинал: “https://dev.to/yorodm/trucos-aws-lambda-parte-2-1adh”