diff --git a/terraform/070-id-sync/main.tf b/terraform/070-id-sync/main.tf index ba68a1e..78b2aaf 100644 --- a/terraform/070-id-sync/main.tf +++ b/terraform/070-id-sync/main.tf @@ -101,6 +101,7 @@ resource "aws_ecs_task_definition" "cron_td" { resource "aws_cloudwatch_event_rule" "event_rule" { name = "${var.idp_name}-${var.app_name}-${var.app_env}" description = "Start ID Sync scheduled tasks" + is_enabled = var.enable_sync schedule_expression = var.event_schedule diff --git a/terraform/070-id-sync/vars.tf b/terraform/070-id-sync/vars.tf index c6d415c..27c3b25 100644 --- a/terraform/070-id-sync/vars.tf +++ b/terraform/070-id-sync/vars.tf @@ -118,6 +118,12 @@ variable "enable_new_user_notification" { default = "false" } +variable "enable_sync" { + description = "Set the AWS CloudWatch Event Rule is-enabled flag" + type = bool + default = true +} + variable "event_schedule" { description = "AWS Cloudwatch schedule for the sync task" type = string diff --git a/test/070-id-sync.tf b/test/070-id-sync.tf index 88a6f51..f6c93fd 100644 --- a/test/070-id-sync.tf +++ b/test/070-id-sync.tf @@ -15,7 +15,7 @@ module "sync" { email_service_baseUrl = "" email_service_validIpRanges = [""] enable_new_user_notification = "" - enable_sync = "" + enable_sync = true event_schedule = "" id_broker_access_token = "" id_broker_adapter = ""