Skip to content

Commit

Permalink
Add an option to enable snap start
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaei committed Mar 26, 2024
1 parent cd8f0ea commit 24c9612
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
8 changes: 8 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ resource "aws_lambda_function" "this" {

publish = true

dynamic "snap_start" {
for_each = var.snap_start ? [{}] : []

content {
apply_on = "PublishedVersions"
}
}

tracing_config {
mode = var.x_ray_mode
}
Expand Down
7 changes: 7 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,13 @@ variable "x_ray_mode" {
default = "PassThrough"
}

variable "snap_start" {
description = "Enable or disable snap start for the lambda function"

type = bool
default = false
}

variable "provisioned_concurrency" {
description = "Settings for provisioned concurrency"

Expand Down

0 comments on commit 24c9612

Please sign in to comment.