terraform-aws-lambda icon indicating copy to clipboard operation
terraform-aws-lambda copied to clipboard

feat: allow setting of retry policy for cloudwatch event targets

Open elliottohara opened this issue 1 year ago • 1 comments

address 126

This PR just uses the existing patterns to send down retry configuration for cloudwatch event targets if specified.

elliottohara avatar Mar 14 '24 13:03 elliottohara

I’ll be on vacation for the next week, so can’t check, but i though lt setting to null would work. If it doesn’t I’ll figure test and figure out a work around.

On Fri, Mar 15, 2024 at 9:50 AM Moritz Zimmer @.***> wrote:

@.**** requested changes on this pull request.

In cloudwatch_event_rules.tf https://github.com/moritzzimmer/terraform-aws-lambda/pull/127#discussion_r1526406630 :

@@ -29,4 +29,8 @@ resource "aws_cloudwatch_event_target" "lambda" { arn = lookup(each.value, "cloudwatch_event_target_arn", local.function_arn) rule = aws_cloudwatch_event_rule.lambda[each.key].name input = lookup(each.value, "cloudwatch_event_target_input", null)

  • retry_policy {

Nice 👍

Could you please add a new line before retry_policy and enhance the scheduled example https://github.com/moritzzimmer/terraform-aws-lambda/blob/30e15b6caf45fd05be89d0671b7883d369f82d93/examples/with-cloudwatch-event-rules/main.tf#L21 with the new config options.

It seems like a once configured maximum_event_age_in_seconds can't be removed by removing cloudwatch_event_target_retry_policy_maximum_event_age_in_seconds. The next apply fails with an exception like this:

Error: updating EventBridge Target (terraform-20240315143915351100000003-terraform-20240315143915805900000006): InvalidParameter: 1 validation error(s) found. │ - minimum field value of 60, PutTargetsInput.Targets[0].RetryPolicy.MaximumEventAgeInSeconds.

As a workaround users would need to specify a valid value or remove the whole event rule. This seems like an issue in the aws provider - what do you think?

— Reply to this email directly, view it on GitHub https://github.com/moritzzimmer/terraform-aws-lambda/pull/127#pullrequestreview-1939152438, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADS5W2C3WTJLA7PORSW25TYYMDDTAVCNFSM6AAAAABEWFI2H2VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTSMZZGE2TENBTHA . You are receiving this because you authored the thread.Message ID: @.***>

elliottohara avatar Mar 15 '24 16:03 elliottohara

This PR has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this PR will be closed in 10 days

github-actions[bot] avatar Apr 30 '24 01:04 github-actions[bot]

This PR was automatically closed because of stale in 10 days

github-actions[bot] avatar May 10 '24 01:05 github-actions[bot]