terraform-aws-modules / terraform-aws-lambda

Terraform module, which takes care of a lot of AWS Lambda/serverless tasks (build dependencies, packages, updates, deployments) in countless combinations 🇺🇦
https://registry.terraform.io/modules/terraform-aws-modules/lambda/aws
Apache License 2.0
892 stars 662 forks source link

feat: Add snap_start functionality #389

Closed darrenswhite closed 1 year ago

darrenswhite commented 1 year ago

Description

Motivation and Context

Breaking Changes

How Has This Been Tested?

faxx1080 commented 1 year ago

Hi! I wanted to confirm, does this include publishing versions? I have heard from AWS that versions are required for full use of Snap Start.

See: https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html

You can use SnapStart only on published function versions and aliases that point to versions. You can't use SnapStart on a function's unpublished version ($LATEST).

github-actions[bot] commented 1 year ago

This PR has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this PR will be closed in 10 days

darrenswhite commented 1 year ago

Hi! I wanted to confirm, does this include publishing versions? I have heard from AWS that versions are required for full use of Snap Start.

See: https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html

You can use SnapStart only on published function versions and aliases that point to versions. You can't use SnapStart on a function's unpublished version ($LATEST).

this PR does not include publishing versions. you can use the already existing variable publish to enable publishing a new version here https://github.com/terraform-aws-modules/terraform-aws-lambda/blob/master/variables.tf#L125

darrenswhite commented 1 year ago

Replaced with new PR #406.

darrenswhite commented 1 year ago

@mmichna I have updated the new PR with your comments.

@faxx1080 the new PR will automatically publish a new version when snap start is enabled.

faxx1080 commented 1 year ago

Hi @darrenswhite

Thank you! However I am not sure what this does, we can already use "publish = true" for snapstart.

My thought is what happens to older versions of the function?

Currently I wrote a Perl script that uses the AWS CLI to enumerate versions not tagged and deletes those one by one. I use a null terraform provider to invoke the Perl script.

darrenswhite commented 1 year ago

Hi @darrenswhite

Thank you! However I am not sure what this does, we can already use "publish = true" for snapstart.

My thought is what happens to older versions of the function?

Currently I wrote a Perl script that uses the AWS CLI to enumerate versions not tagged and deletes those one by one. I use a null terraform provider to invoke the Perl script.

Correct, the new PR sets publish = true when snap_start = true as suggested by @mmichna.

I am unsure what happens to older versions of the function.

github-actions[bot] commented 1 year ago

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.