# How far behind does lambda tend to be with the latest version of boto3

**URL:** <https://awshq.com/t/how-far-behind-does-lambda-tend-to-be-with-the-latest-version-of-boto3/9014>\
**Category:** Databases\
**Tags:** aurora, lambda, rds\
**Created:** [July 20, 2019, 7:20pm UTC](https://awshq.com/t/how-far-behind-does-lambda-tend-to-be-with-the-latest-version-of-boto3/9014 "2019-07-20T19:20:54Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrsmiley32](https://awshq.com/letter_avatar_proxy/v4/letter/m/96bed5/32.png) [@mrsmiley32](https://awshq.com/u/mrsmiley32)\
**Post date:** [July 20, 2019, 7:20pm UTC](https://awshq.com/t/how-far-behind-does-lambda-tend-to-be-with-the-latest-version-of-boto3/9014/1 "2019-07-20T19:20:54Z")

</div>

I’ve noticed in a couple of instances I was able to get features like rds-data and servicediscovery discover instance to work locally but when the code was ported to lambda neither worked.

Note rds-data is for working with serverless aurora without needing to build a connection pool. (see the June update show) the service discovery one is for being able to work with cloud map (one guess what that is).

Edit: Well looks like I should be rolling mine in a layer, that’s easy enough! Thanks all!

* * *

**Related discussions:**

- [I guess forcing RDS extended support is not as bad as forcing Aurora/MySQL 8.0 upgrades?](https://awshq.com/t/i-guess-forcing-rds-extended-support-is-not-as-bad-as-forcing-aurora-mysql-8-0-upgrades/17706)
- [New Job as AWS Infrastructure Engineer: Questions for the Pros](https://awshq.com/t/new-job-as-aws-infrastructure-engineer-questions-for-the-pros/21544)
- [DSQL performance?](https://awshq.com/t/dsql-performance/20348)
- [We stopped putting team in our AWS cost allocation tags](https://awshq.com/t/we-stopped-putting-team-in-our-aws-cost-allocation-tags/21655)
- [When do we think Cloudfront will support the new HTTP QUERY method?](https://awshq.com/t/when-do-we-think-cloudfront-will-support-the-new-http-query-method/21436)

---

<div class="post-metadata">

**Author:** ![Redditron-2000-4](https://awshq.com/letter_avatar_proxy/v4/letter/r/ee59a6/32.png) [@Redditron-2000-4](https://awshq.com/u/Redditron-2000-4)\
**Post date:** [July 20, 2019, 7:28pm UTC](https://awshq.com/t/how-far-behind-does-lambda-tend-to-be-with-the-latest-version-of-boto3/9014/2 "2019-07-20T19:28:57Z")

</div>

Package boto3 in a layer and never worry about dependencies not being up to date.

---

<div class="post-metadata">

**Author:** ![bisoldi](https://awshq.com/letter_avatar_proxy/v4/letter/b/13edae/32.png) [@bisoldi](https://awshq.com/u/bisoldi)\
**Post date:** [July 20, 2019, 7:55pm UTC](https://awshq.com/t/how-far-behind-does-lambda-tend-to-be-with-the-latest-version-of-boto3/9014/3 "2019-07-20T19:55:47Z")

</div>

It’s a little known best practice. Roll boto3 into your deployment and never depend on the lambda runtime version.

---

<div class="post-metadata">

**Author:** ![mrsmiley32](https://awshq.com/letter_avatar_proxy/v4/letter/m/96bed5/32.png) [@mrsmiley32](https://awshq.com/u/mrsmiley32)\
**Post date:** [July 20, 2019, 8:37pm UTC](https://awshq.com/t/how-far-behind-does-lambda-tend-to-be-with-the-latest-version-of-boto3/9014/4 "2019-07-20T20:37:19Z")

</div>

> [@Redditron-2000-4](#):
>
> Package boto3 in a layer and never worry about dependencies not being up to date.

This is my backup plan 🙂

---

<div class="post-metadata">

**Author:** ![drch](https://awshq.com/letter_avatar_proxy/v4/letter/d/b3f665/32.png) [@drch](https://awshq.com/u/drch)\
**Post date:** [July 20, 2019, 8:38pm UTC](https://awshq.com/t/how-far-behind-does-lambda-tend-to-be-with-the-latest-version-of-boto3/9014/5 "2019-07-20T20:38:31Z")

</div>

/u/Redditron-2000-4 's answer is the best approach, but to answer your question, it can be quite far since it’s baked into the AMI. Node8 and Python3.6 are running a version from their respective SDKs from August 2018. Info can be found here:

[https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)

---

<div class="post-metadata">

**Author:** ![Redditron-2000-4](https://awshq.com/letter_avatar_proxy/v4/letter/r/ee59a6/32.png) [@Redditron-2000-4](https://awshq.com/u/Redditron-2000-4)\
**Post date:** [July 20, 2019, 9:10pm UTC](https://awshq.com/t/how-far-behind-does-lambda-tend-to-be-with-the-latest-version-of-boto3/9014/6 "2019-07-20T21:10:19Z")

</div>

> [@mrsmiley32](#):
>
> This is my backup plan 🙂

I’d make it your up front plan. Packaging your dependencies is best practice.

---

<div class="post-metadata">

**Author:** ![thebigru](https://awshq.com/letter_avatar_proxy/v4/letter/t/41988e/32.png) [@thebigru](https://awshq.com/u/thebigru)\
**Post date:** [July 20, 2019, 10:13pm UTC](https://awshq.com/t/how-far-behind-does-lambda-tend-to-be-with-the-latest-version-of-boto3/9014/7 "2019-07-20T22:13:37Z")

</div>

Very annoying … tags on IAM users weren’t supported so I had to bake in the boto3 library to use them

---

<div class="post-metadata">

**Author:** ![unkz](https://awshq.com/letter_avatar_proxy/v4/letter/u/2acd7d/32.png) [@unkz](https://awshq.com/u/unkz)\
**Post date:** [July 20, 2019, 10:25pm UTC](https://awshq.com/t/how-far-behind-does-lambda-tend-to-be-with-the-latest-version-of-boto3/9014/8 "2019-07-20T22:25:40Z")

</div>

> [@bisoldi](#):
>
> It’s a little known best practice. Roll boto3 into your deployment and never depend on the lambda runtime version.

Sometimes it’s very hard to do though, like if you want to run pytorch inside lambda and you’re already stripping binaries and deleting unused files just to fit inside the max package size.

---

<div class="post-metadata">

**Author:** ![bisoldi](https://awshq.com/letter_avatar_proxy/v4/letter/b/13edae/32.png) [@bisoldi](https://awshq.com/u/bisoldi)\
**Post date:** [July 20, 2019, 10:48pm UTC](https://awshq.com/t/how-far-behind-does-lambda-tend-to-be-with-the-latest-version-of-boto3/9014/9 "2019-07-20T22:48:07Z")

</div>

> [@Redditron-2000-4](#):
>
> I’d make it your up front plan. Packaging your dependencies is best practice.

Not the OP’s issue but that doesn’t help with size concerns.

[https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)

A function can use up to 5 layers at a time. The total unzipped size of the function and all layers can’t exceed the unzipped deployment package size limit of 250 MB. For more information, see AWS Lambda Limits.

---

<div class="post-metadata">

**Author:** ![Redditron-2000-4](https://awshq.com/letter_avatar_proxy/v4/letter/r/ee59a6/32.png) [@Redditron-2000-4](https://awshq.com/u/Redditron-2000-4)\
**Post date:** [July 20, 2019, 10:49pm UTC](https://awshq.com/t/how-far-behind-does-lambda-tend-to-be-with-the-latest-version-of-boto3/9014/10 "2019-07-20T22:49:44Z")

</div>

> [@bisoldi](#):
>
> Not the OP’s issue but that doesn’t help with size concerns. [https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html) A function can use up to 5 layers at a time. The total unzipped size of the function …

True. Size limits are a pain when you hit them.

---

<div class="post-metadata">

**Author:** ![cr125rider](https://awshq.com/letter_avatar_proxy/v4/letter/c/e47774/32.png) [@cr125rider](https://awshq.com/u/cr125rider)\
**Post date:** [July 20, 2019, 10:51pm UTC](https://awshq.com/t/how-far-behind-does-lambda-tend-to-be-with-the-latest-version-of-boto3/9014/11 "2019-07-20T22:51:41Z")

</div>

> [@Redditron-2000-4](#):
>
> True. Size limits are a pain when you hit them.

Show stopper for sure. And you’re paying 8x for compute. I get serverless is easy, but so is managing an ec2 instance. (For certain use cases of course)

---

<div class="post-metadata">

**Author:** ![mrsmiley32](https://awshq.com/letter_avatar_proxy/v4/letter/m/96bed5/32.png) [@mrsmiley32](https://awshq.com/u/mrsmiley32)\
**Post date:** [July 20, 2019, 11:15pm UTC](https://awshq.com/t/how-far-behind-does-lambda-tend-to-be-with-the-latest-version-of-boto3/9014/12 "2019-07-20T23:15:10Z")

</div>

> [@Redditron-2000-4](#):
>
> I’d make it your up front plan. Packaging your dependencies is best practice.

~~It is? Show me where it’s listed as a best practice to package provided packages. This believe it or not isn’t as confrontational as it sounds, but if I’m going to sell this line to my other developers I’m going to have to have it written down and I don’t remember seeing this in the aws lambda best practices.~~

~~I mean from my own personal point of view, boto3 is out of the box provided from amazon so wouldn’t there be a potential for a dependency conflict to occur?~~

Edit: Disregard on link, this is good enough, amz straight up telling you to package your own. (From below)

[https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)

---

<div class="post-metadata">

**Author:** ![mrsmiley32](https://awshq.com/letter_avatar_proxy/v4/letter/m/96bed5/32.png) [@mrsmiley32](https://awshq.com/u/mrsmiley32)\
**Post date:** [July 20, 2019, 11:20pm UTC](https://awshq.com/t/how-far-behind-does-lambda-tend-to-be-with-the-latest-version-of-boto3/9014/13 "2019-07-20T23:20:22Z")

</div>

> [@unkz](#):
>
> Sometimes it’s very hard to do though, like if you want to run pytorch inside lambda and you’re already stripping binaries and deleting unused files just to fit inside the max package size.

As others said, go for the layers for prepackaged libraries where you aren’t changing the source (or is 250mb still stretching it and can you split it over multiple layers?)

---

<div class="post-metadata">

**Author:** ![Redditron-2000-4](https://awshq.com/letter_avatar_proxy/v4/letter/r/ee59a6/32.png) [@Redditron-2000-4](https://awshq.com/u/Redditron-2000-4)\
**Post date:** [July 20, 2019, 11:44pm UTC](https://awshq.com/t/how-far-behind-does-lambda-tend-to-be-with-the-latest-version-of-boto3/9014/14 "2019-07-20T23:44:13Z")

</div>

> [@mrsmiley32](#):
>
> ~~It is? Show me where it’s listed as a best practice to package provided packages. This believe it or not isn’t as confrontational as it sounds, but if I’m going to sell this line to my other developers I’m going to …

This [link](https://docs.aws.amazon.com/lambda/latest/dg/best-practices.html) has AWS’s best practices. Definitely worth a read.

---

<div class="post-metadata">

**Author:** ![unkz](https://awshq.com/letter_avatar_proxy/v4/letter/u/2acd7d/32.png) [@unkz](https://awshq.com/u/unkz)\
**Post date:** [July 21, 2019, 12:03am UTC](https://awshq.com/t/how-far-behind-does-lambda-tend-to-be-with-the-latest-version-of-boto3/9014/15 "2019-07-21T00:03:06Z")

</div>

> [@mrsmiley32](#):
>
> As others said, go for the layers for prepackaged libraries where you aren’t changing the source (or is 250mb still stretching it and can you split it over multiple layers?)

My venv containing only numpy and pytorch comes out to 244M.

---

<div class="post-metadata">

**Author:** ![mrsmiley32](https://awshq.com/letter_avatar_proxy/v4/letter/m/96bed5/32.png) [@mrsmiley32](https://awshq.com/u/mrsmiley32)\
**Post date:** [July 21, 2019, 1:21am UTC](https://awshq.com/t/how-far-behind-does-lambda-tend-to-be-with-the-latest-version-of-boto3/9014/16 "2019-07-21T01:21:33Z")

</div>

> [@unkz](#):
>
> My venv containing only numpy and pytorch comes out to 244M.

Put numpy in one layer and pytorch in the other? 🙂 Max of 5 total layers but you are distributing large packages to keep away from the threshold.

---

<div class="post-metadata">

**Author:** ![unkz](https://awshq.com/letter_avatar_proxy/v4/letter/u/2acd7d/32.png) [@unkz](https://awshq.com/u/unkz)\
**Post date:** [July 21, 2019, 1:24am UTC](https://awshq.com/t/how-far-behind-does-lambda-tend-to-be-with-the-latest-version-of-boto3/9014/17 "2019-07-21T01:24:08Z")

</div>

> [@mrsmiley32](#):
>
> Put numpy in one layer and pytorch in the other? 🙂 Max of 5 total layers but you are distributing large packages to keep away from the threshold.

Isn’t the combined limit of all layers still 250M?

---

<div class="post-metadata">

**Author:** ![mrsmiley32](https://awshq.com/letter_avatar_proxy/v4/letter/m/96bed5/32.png) [@mrsmiley32](https://awshq.com/u/mrsmiley32)\
**Post date:** [July 21, 2019, 1:27am UTC](https://awshq.com/t/how-far-behind-does-lambda-tend-to-be-with-the-latest-version-of-boto3/9014/18 "2019-07-21T01:27:18Z")

</div>

> [@unkz](#):
>
> Isn’t the combined limit of all layers still 250M?

I had misunderstood when I read the article originally and further looking up:

[https://docs.aws.amazon.com/lambda/latest/dg/limits.html](https://docs.aws.amazon.com/lambda/latest/dg/limits.html)

[Deployment package](https://docs.aws.amazon.com/lambda/latest/dg/deployment-package-v2.html) size

50 MB (zipped, for direct upload)

250 MB (unzipped, including layers)

3 MB (console editor)

So it’s worse than that, it’s all layers and the function itself. My apologies!

---

<div class="post-metadata">

**Author:** ![gkdante](https://awshq.com/letter_avatar_proxy/v4/letter/g/7c8e57/32.png) [@gkdante](https://awshq.com/u/gkdante)\
**Post date:** [July 21, 2019, 3:03am UTC](https://awshq.com/t/how-far-behind-does-lambda-tend-to-be-with-the-latest-version-of-boto3/9014/19 "2019-07-21T03:03:11Z")

</div>

> [@mrsmiley32](#):
>
> ~~It is? Show me where it’s listed as a best practice to package provided packages. This believe it or not isn’t as confrontational as it sounds, but if I’m going to sell this line to my other developers I’m going to …

Best practices are more advices than rules, not finding one documented as a white paper doesn’t take away from them.

Also, don’t trust blindy on AWS advices, we already got burn a couple times at my workplace for sticking to what the said or what support said should be OK to do. Have in mind we pay a very good support fee to them. This is particularly true for new features / services that sometimes they release half baked, pourly documented and even not compatible with their other services.

Lambda layers for instance, where only released a bit more that 6 months ago, none surprising than they are not yet in their best practices.

---

<div class="post-metadata">

**Author:** ![ImperialXT](https://awshq.com/letter_avatar_proxy/v4/letter/i/898d66/32.png) [@ImperialXT](https://awshq.com/u/ImperialXT)\
**Post date:** [July 21, 2019, 1:31pm UTC](https://awshq.com/t/how-far-behind-does-lambda-tend-to-be-with-the-latest-version-of-boto3/9014/20 "2019-07-21T13:31:23Z")

</div>

The only issue with adding your own boto3 layer is your maintaining it yourself which is good and bad. I only tend to maintain stuff if I absolutely have to especially when things like [https://github.com/keithrozario/Klayers](https://github.com/keithrozario/Klayers) exist.

[Next page](https://awshq.com/t/how-far-behind-does-lambda-tend-to-be-with-the-latest-version-of-boto3/9014.md?page=2)
