Skip to content

Commit ab332c1

Browse files
feat: Add support for tenant isolation mode feature (#718)
Co-authored-by: Anton Babenko <393243+antonbabenko@users.noreply.github.com>
1 parent 56a0217 commit ab332c1

4 files changed

Lines changed: 15 additions & 0 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -858,6 +858,7 @@ No modules.
858858
| <a name="input_source_path"></a> [source\_path](#input\_source\_path) | The absolute path to a local file or directory containing your Lambda source code | `any` | `null` | no |
859859
| <a name="input_store_on_s3"></a> [store\_on\_s3](#input\_store\_on\_s3) | Whether to store produced artifacts on S3 or locally. | `bool` | `false` | no |
860860
| <a name="input_tags"></a> [tags](#input\_tags) | A map of tags to assign to resources. | `map(string)` | `{}` | no |
861+
| <a name="input_tenant_isolation_mode"></a> [tenant\_isolation\_mode](#input\_tenant\_isolation\_mode) | Enable tenant isolation mode for the Lambda Function | `bool` | `false` | no |
861862
| <a name="input_timeout"></a> [timeout](#input\_timeout) | The amount of time your Lambda Function has to run in seconds. | `number` | `3` | no |
862863
| <a name="input_timeouts"></a> [timeouts](#input\_timeouts) | Define maximum timeout for creating, updating, and deleting Lambda Function resources | `map(string)` | `{}` | no |
863864
| <a name="input_tracing_mode"></a> [tracing\_mode](#input\_tracing\_mode) | Tracing mode of the Lambda Function. Valid value can be either PassThrough or Active. | `string` | `null` | no |

main.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,13 @@ resource "aws_lambda_function" "this" {
137137
}
138138
}
139139

140+
dynamic "tenancy_config" {
141+
for_each = var.tenant_isolation_mode ? [true] : []
142+
content {
143+
tenant_isolation_mode = "PER_TENANT"
144+
}
145+
}
146+
140147
tags = merge(
141148
var.tags,
142149
var.function_tags

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,12 @@ variable "skip_destroy" {
280280
default = null
281281
}
282282

283+
variable "tenant_isolation_mode" {
284+
description = "Enable tenant isolation mode for the Lambda Function"
285+
type = bool
286+
default = false
287+
}
288+
283289
###############
284290
# Function URL
285291
###############

wrappers/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ module "wrapper" {
128128
source_path = try(each.value.source_path, var.defaults.source_path, null)
129129
store_on_s3 = try(each.value.store_on_s3, var.defaults.store_on_s3, false)
130130
tags = try(each.value.tags, var.defaults.tags, {})
131+
tenant_isolation_mode = try(each.value.tenant_isolation_mode, var.defaults.tenant_isolation_mode, false)
131132
timeout = try(each.value.timeout, var.defaults.timeout, 3)
132133
timeouts = try(each.value.timeouts, var.defaults.timeouts, {})
133134
tracing_mode = try(each.value.tracing_mode, var.defaults.tracing_mode, null)

0 commit comments

Comments
 (0)