File tree Expand file tree Collapse file tree 3 files changed +20
-0
lines changed
Expand file tree Collapse file tree 3 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -37,3 +37,17 @@ resource "aws_lambda_function" "eligibility_signposting_lambda" {
3737 mode = " Active"
3838 }
3939}
40+
41+ # provisioned concurrency - number of pre-warmed lambda containers
42+ resource "aws_lambda_alias" "campaign_alias" {
43+ name = " live"
44+ function_name = aws_lambda_function. eligibility_signposting_lambda . function_name
45+ function_version = aws_lambda_function. eligibility_signposting_lambda . version
46+ }
47+
48+ resource "aws_lambda_provisioned_concurrency_config" "campaign_pc" {
49+ count = var. environment == " prod" ? 1 : 0
50+ function_name = aws_lambda_function. eligibility_signposting_lambda . function_name
51+ qualifier = aws_lambda_alias. campaign_alias . name
52+ provisioned_concurrent_executions = var. provisioned_concurrency_count
53+ }
Original file line number Diff line number Diff line change @@ -52,3 +52,8 @@ variable "enable_xray_patching"{
5252 description = " flag to enable xray tracing, which puts an entry for dynamodb, s3 and firehose in trace map"
5353 type = string
5454}
55+
56+ variable "provisioned_concurrency_count" {
57+ description = " Number of prewarmed Lambda instances"
58+ type = number
59+ }
Original file line number Diff line number Diff line change @@ -26,4 +26,5 @@ module "eligibility_signposting_lambda_function" {
2626 log_level = " INFO"
2727 enable_xray_patching = " true"
2828 stack_name = local. stack_name
29+ provisioned_concurrency_count = 5
2930}
You can’t perform that action at this time.
0 commit comments