diff --git a/R/lambda-util.R b/R/lambda-util.R index cf7dde0..6470e97 100644 --- a/R/lambda-util.R +++ b/R/lambda-util.R @@ -699,7 +699,7 @@ add_lambda_to_eventridge <- aws_event <- aws_connect("eventbridge") aws_event$put_targets( Rule = rule_name, - Targets = list(list(Id = 1, Arn = lambda_function_arn)) + Targets = list(list(Id = "1", Arn = lambda_function_arn)) ) logger::log_debug("[add_lambda_to_eventridge] Done.") } diff --git a/tests/testthat/test-aws-lookups.R b/tests/testthat/test-aws-lookups.R index aed6dbd..3c2b745 100644 --- a/tests/testthat/test-aws-lookups.R +++ b/tests/testthat/test-aws-lookups.R @@ -84,6 +84,19 @@ test_that("schedule_lambda builds valid rule and statement names", { expect_match(statement, "^[A-Za-z0-9_-]+$") }) +test_that("add_lambda_to_eventridge sends the target ID as a string", { + targets <- NULL + local_mocked_bindings( + aws_connect = function(service) { + list(put_targets = function(Rule, Targets) { + targets <<- Targets + }) + } + ) + add_lambda_to_eventridge("a_rule", "arn:fn") + expect_type(targets[[1]]$Id, "character") +}) + test_that("test_lambda finds the image by tag and removes the container", { calls <- list() local_mocked_bindings(