La infraestructura educa

No se que día en las pasadas dos semanas estaba conversando con alguien sobre las recientes remodelaciones que se han hecho a los alrededores del centro de Guadalajara para darle su espacio a la bicicleta y a los peatones.

Av. López Cotilla en 2013
Quiero señalar lo que @dana_corres ha mencionado una y otra vez sobre la "cultura vial". La tan mencionada cultura vial no se genera solo por buenas intenciones ciudadanas o solo por que hay una campaña de concientización. La tan mencionada "cultura vial" no la tiene que imponer la infraestructura con la que está diseñada la ciudad.

La plática que tuve con una persona hace un par de semanas mencionaba algo como esto:

"...en la zona donde hay ciclovías por avenida Chapultepec los autos te respetan y te dan el paso, una vez me sucedió que el mismo auto en esa zona me cedió el paso, unas cuadras mas adelante (donde no hay infraestructura como la de Av. Chapultepec) me aventó el carro..."

¡bingo! La infraestructura hace la "cultura vial", incentiva al respecto. A un tope, a un bolardo no se le puede engañar o sobornar, la infraestructura invita a convivir a compartir.

Av. López Cotilla en 2016

"esperamos un Mercedes por el precio de un Tsuru"

De una plática muy larga que tuve con @playgali y entre los temas que siempre van alrededor del transporte público en ciudades mal planeadas como la ZMG concluía que yo estaría dispuesto a pagar por un servicio que costara dos o tres veces más, si así se pudiera tener algo de calidad y de buenas condiciones.

Lectura obligada para entender como se podría financiar un servicio que nos de gusto utilizar, que pase a sus horas, que no vaya abarrotado y que muchos estuvieran dispuestos a pagar:

https://ciudadpedestre.wordpress.com/2017/05/02/la-trampa-de-la-tarifa-no-esperemos-un-mercedes-por-el-precio-de-un-tsuru/ 

AWS lambda functions and internal reusable containers

Some time has happened from the last post, but today I have some information that is not relevant to anyone and that's the main purpose of this blog.

Okay this is the deal. I was following one of the amazon web services posts on how-to-receive-alerts-when-specific-apis-are-called-by-using-aws-cloudtrail-amazon-sns-and-aws-lambda. Translated into "my grandmother" language: being alerted when some AWS events are happening.

The flow on how the services work together is shown on this diagram:

Diagram showing how the AWS services from this blog post work together

But why am I writing about this? Well I've faced an issue while building this setup, actually opened a support case with amazon and since I'm not an expert with AWS lambda, they clarified to me some of the lambda nature that cause my function not to work properly.

The expectation: Receive an email once an event happened on AWS coming from route53 each time a bucket object was created
The issue: The email was sent only for the first time the lambda function was invoked, but it didn't send an email on second time and any other subsecuent time
The problem: AWS Lambda reuse their containers to run the code, and the environment variables as well. The cloudtrail.js code use a FILTER_CONFIG global variable, and the logic of the code says that it will run some code if FILTER_CONFIG is empty. But since this global variable is kept on the container, none of the following code is being executed.
The solution: Set the FILTER_CONFIG as empty just at the beginning of the init function

After doing this change the lambda function worked just like a charm.