File tree Expand file tree Collapse file tree 3 files changed +35
-1
lines changed Expand file tree Collapse file tree 3 files changed +35
-1
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ Note that this example may create resources which cost money. Run `terraform des
54
54
| ------| ------|
55
55
| [ aws_sqs_queue.dlq] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/sqs_queue ) | resource |
56
56
| [ random_pet.this] ( https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/pet ) | resource |
57
+ | [ aws_caller_identity.current] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity ) | data source |
57
58
58
59
## Inputs
59
60
Original file line number Diff line number Diff line change @@ -63,6 +63,32 @@ module "lambda_function" {
63
63
}
64
64
]
65
65
}
66
+ # self_managed_kafka = {
67
+ # batch_size = 1
68
+ # starting_position = "TRIM_HORIZON"
69
+ # topics = ["topic1", "topic2"]
70
+ # self_managed_event_source = [
71
+ # {
72
+ # endpoints = {
73
+ # KAFKA_BOOTSTRAP_SERVERS = "kafka1.example.com:9092,kafka2.example.com:9092"
74
+ # }
75
+ # }
76
+ # ]
77
+ # source_access_configuration = [
78
+ # {
79
+ # type = "SASL_SCRAM_512_AUTH",
80
+ # uri = "SECRET_AUTH_INFO"
81
+ # },
82
+ # {
83
+ # type = "VPC_SECURITY_GROUP",
84
+ # uri = "security_group:sg-12345678"
85
+ # },
86
+ # {
87
+ # type = "VPC_SUBNET"
88
+ # uri = "subnet:subnet-12345678"
89
+ # }
90
+ # ]
91
+ # }
66
92
}
67
93
68
94
allowed_triggers = {
Original file line number Diff line number Diff line change @@ -231,7 +231,7 @@ resource "aws_lambda_event_source_mapping" "this" {
231
231
232
232
function_name = aws_lambda_function. this [0 ]. arn
233
233
234
- event_source_arn = each. value . event_source_arn
234
+ event_source_arn = try ( each. value . event_source_arn , null )
235
235
236
236
batch_size = try (each. value . batch_size , null )
237
237
maximum_batching_window_in_seconds = try (each. value . maximum_batching_window_in_seconds , null )
@@ -255,6 +255,13 @@ resource "aws_lambda_event_source_mapping" "this" {
255
255
}
256
256
}
257
257
258
+ dynamic "self_managed_event_source" {
259
+ for_each = try (each. value . self_managed_event_source , [])
260
+ content {
261
+ endpoints = self_managed_event_source. value . endpoints
262
+ }
263
+ }
264
+
258
265
dynamic "source_access_configuration" {
259
266
for_each = try (each. value . source_access_configuration , [])
260
267
content {
You can’t perform that action at this time.
0 commit comments