Finding lambda's current AZ #4231
-
I am accessing my cache from a lambda that is in a vpc. I do have a list of AZs for my vpc in cdk but not sure how to know which one my lambda is active in when running. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
@leandrodamascena @dreamorosi before diving into it, any insight of how to on this matter? @Lemour-sudo in case you'll find it helpful, for other reasons, @leandrodamascena @dreamorosi owning https://github.com/aws-powertools which include great lambda power tools libs to use with your lambdas. |
Beta Was this translation helpful? Give feedback.
-
Hi @avifenesh, thanks for pinging me. It's actually hard to get this parameter to work in Lambda because there's no way to know in which AZ a particular Lambda is running. The only way to force this is to deploy Lambda in only one AZ, but this is not recommended as you won't benefit from multi-AZ fault tolerance. You also can't query instance metadata in Lambda because this is not available in firecracker container. Currently, customers using Lambda may not be able to take advantage of this functionality. Pls let me know if I can help with anything else. |
Beta Was this translation helpful? Give feedback.
Hi @avifenesh, thanks for pinging me. It's actually hard to get this parameter to work in Lambda because there's no way to know in which AZ a particular Lambda is running. The only way to force this is to deploy Lambda in only one AZ, but this is not recommended as you won't benefit from multi-AZ fault tolerance. You also can't query instance metadata in Lambda because this is not available in firecracker container.
Currently, customers using Lambda may not be able to take advantage of this functionality.
Pls let me know if I can help with anything else.