Is it possible to configure the Availability Zone(AZ) for Lambda function in AWS?
Asked Answered
T

2

7

As we know there are multiple AZ in an Region, is it possible to deploy/create Lambda function in particular AZ of the region or Lambda function is created randomly in any AZ of particular Region?

Towrope answered 16/5, 2021 at 8:35 Comment(0)
V
7

There are 2 types of Lambda in general. VPC and Non-VPC. So if there's a VPC then there are Subnets and each Subnet is in a specific AZ. If you only have 1 subnet in a VPC or you configure your lambda to run in one specific subnet then yes you can configure Lambda to run in specific AZ.

But there's no guarantee the that region-1a is same AZ for all the accounts. So region-1a AZ for AWS Account1 might be different for AWS Account2.

For managed services like Lambda, one should not consider AZs in designing the solution.

Vivienviviene answered 16/5, 2021 at 11:17 Comment(2)
its not design requirement, I was just understanding the concepts and got this doubt. So in case of Non VPC Lambda, it will be running(when triggered) on any AZ based on the availability underlying hardware?Towrope
Yes your understanding is correct. We can't know which AZ the execution is running on.Vivienviviene
F
1

Lambda functions are deployed to specified subnets in VPC.

You can select which subnet of which AZ you want to deploy in.

Something like this

enter image description here

Fiorenza answered 16/5, 2021 at 9:24 Comment(1)
yes but what if you have 3 public subents for your lambda, one in each a-z. The lambda is deployed via serverless and you have no clue in which zone your lambda is deployed/executedMicromho

© 2022 - 2024 — McMap. All rights reserved.