Skip to content
This repository was archived by the owner on Jan 16, 2025. It is now read-only.

Commit c9c7c69

Browse files
authored
fix(runnrs): Pool runners to allow multiple pool_config objects (#1621)
* Fix: pool runners to allow multiple event rules * fix count.index in name * multiple statement_ids
1 parent 1140f5c commit c9c7c69

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: modules/runners/pool/main.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ data "aws_iam_policy_document" "lambda_assume_role_policy" {
9999
resource "aws_cloudwatch_event_rule" "pool" {
100100
count = length(var.config.pool)
101101

102-
name = "${var.config.environment}-pool-rule"
102+
name = "${var.config.environment}-pool-${count.index}-rule"
103103
schedule_expression = var.config.pool[count.index].schedule_expression
104104
tags = var.config.tags
105105
}
@@ -118,7 +118,7 @@ resource "aws_cloudwatch_event_target" "pool" {
118118
resource "aws_lambda_permission" "pool" {
119119
count = length(var.config.pool)
120120

121-
statement_id = "AllowExecutionFromCloudWatch"
121+
statement_id = "AllowExecutionFromCloudWatch-${count.index}"
122122
action = "lambda:InvokeFunction"
123123
function_name = aws_lambda_function.pool.function_name
124124
principal = "events.amazonaws.com"

0 commit comments

Comments
 (0)