Skip to content

Commit

Permalink
fix(runnrs): Pool runners to allow multiple pool_config objects (phil…
Browse files Browse the repository at this point in the history
…ips-labs#1621)

* Fix: pool runners to allow multiple event rules

* fix count.index in name

* multiple statement_ids
  • Loading branch information
piscue authored Jan 13, 2022
1 parent 1140f5c commit c9c7c69
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/runners/pool/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ data "aws_iam_policy_document" "lambda_assume_role_policy" {
resource "aws_cloudwatch_event_rule" "pool" {
count = length(var.config.pool)

name = "${var.config.environment}-pool-rule"
name = "${var.config.environment}-pool-${count.index}-rule"
schedule_expression = var.config.pool[count.index].schedule_expression
tags = var.config.tags
}
Expand All @@ -118,7 +118,7 @@ resource "aws_cloudwatch_event_target" "pool" {
resource "aws_lambda_permission" "pool" {
count = length(var.config.pool)

statement_id = "AllowExecutionFromCloudWatch"
statement_id = "AllowExecutionFromCloudWatch-${count.index}"
action = "lambda:InvokeFunction"
function_name = aws_lambda_function.pool.function_name
principal = "events.amazonaws.com"
Expand Down

0 comments on commit c9c7c69

Please sign in to comment.