From 628178d83e65b1a6a98c9d5c96c6f4d65cb1505b Mon Sep 17 00:00:00 2001 From: Paul Schwarzenberger Date: Fri, 15 Mar 2024 20:26:11 +0000 Subject: [PATCH] Configure schedule (#52) Ability to configure CA schedule --- main.tf | 11 ++++++----- modules/terraform-aws-ca-scheduler/variables.tf | 1 - variables.tf | 5 +++++ 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/main.tf b/main.tf index c710639..f18d1e2 100644 --- a/main.tf +++ b/main.tf @@ -340,13 +340,14 @@ module "scheduler-role" { } module "scheduler" { - # triggers step function once per day + # triggers step function once per day by default source = "./modules/terraform-aws-ca-scheduler" - project = var.project - env = var.env - role_arn = module.scheduler-role.lambda_role_arn - target_arn = module.step-function.state_machine_arn + project = var.project + env = var.env + role_arn = module.scheduler-role.lambda_role_arn + target_arn = module.step-function.state_machine_arn + schedule_expression = var.schedule_expression } module "db-reader-role" { diff --git a/modules/terraform-aws-ca-scheduler/variables.tf b/modules/terraform-aws-ca-scheduler/variables.tf index e2e1636..bd1c44c 100644 --- a/modules/terraform-aws-ca-scheduler/variables.tf +++ b/modules/terraform-aws-ca-scheduler/variables.tf @@ -21,7 +21,6 @@ variable "target_arn" { variable "schedule_expression" { description = "Schedule in supported format" - default = "cron(15 8 * * ? *)" # 8.15 a.m. daily } variable "group_name" { diff --git a/variables.tf b/variables.tf index c11de9e..36ff98f 100644 --- a/variables.tf +++ b/variables.tf @@ -166,6 +166,11 @@ variable "s3_aws_principals" { default = [] } +variable "schedule_expression" { + description = "Step function schedule in supported format, must be carefully synchronised with CRL schedule and timing" + default = "cron(15 8 * * ? *)" # 8.15 a.m. daily +} + variable "subscription_filter_destination" { description = "CloudWatch log subscription filter destination, last section of ARN" default = ""