Search code examples
terraformterraform-provider-aws

Terraform module cn-terraform/ecs-fargate-scheduled-task/aws suddenly reporting "An argument named "event_rule_is_enabled" is not expected here."


I have been using https://github.com/umotif-public/terraform-aws-ecs-fargate-scheduled-task for over 1 year without any issues

As from today, I am seeing the error:

│ 
│   on re-engage-campaigns.tf line 82, in module "re_engage_campaigns_process_scheduled_task":
│   82:   event_rule_is_enabled                       = local.re_engage_campaigns_process_scheduled_task_enabled
│ 
│ An argument named "event_rule_is_enabled" is not expected here.

I haven't updated any modules/packages and the documentation states that event_rule_is_enabled is a valid option

This is the module config:

module "re_engage_campaigns_process_scheduled_task" {
  source                                      = "cn-terraform/ecs-fargate-scheduled-task/aws"
  version                                     = "~> 1.0.22"
  ecs_cluster_arn                             = data.terraform_remote_state.network.outputs.ecs_cluster_id
  ecs_execution_task_role_arn                 = module.ecs_task_execution_role.iam_role_arn
  ecs_task_role_arn                           = module.re_engage_campaigns_process_task_role.iam_role_arn
  event_rule_description                      = local.re_engage_campaigns_process_scheduled_task_description
  event_rule_name                             = "${local.re_engage_campaigns_process_scheduled_task}-${terraform.workspace}"
  event_rule_schedule_expression              = local.re_engage_campaigns_process_scheduled_task_scheduled_rule
  event_target_ecs_target_subnets             = local.private_subnet_ids
  event_target_ecs_target_security_groups     = [module.re_engage_campaigns_process_sg.security_group_id]
  event_target_ecs_target_task_definition_arn = data.aws_ecs_task_definition.task_runner_task_definition.arn
  event_target_ecs_target_assign_public_ip    = false
  name_prefix                                 = "${local.re_engage_campaigns_process_scheduled_task}-${terraform.workspace}"
  event_target_target_id                      = local.re_engage_campaigns_process_scheduled_task
  event_rule_is_enabled                       = local.re_engage_campaigns_process_scheduled_task_enabled
  event_target_input                          = local.re_engage_campaigns_process_event_target_input
}

I have tried using true instead of a local variable for testing and there is still an issue

I can see in the modules main.tf file that event_rule_is_enabled is not present but it doesn't make sense why. All documentation states that it is valid and it has worked on many templates before today and no packages have been updated


Solution

  • According to the 1.0.26 module documentation the event_rule_is_enabled parameter was removed. It was last supported in 1.0.25.

    Your versioning specification for the module is ~> 1.0.22. This type of constraint is equivalent to >= 1.0.22 < 1.1.0, and this includes the 1.0.26 version with incompatible usage. This can be referenced in the version constraint documentation Therefore the module updated to an incompatible version.

    The easiest fix for now would be to modify the version constraint to = 1.0.25. This would give you time to update the module usage for the new version.

    Normally the version constraint you provided would be safe as it only updates to newer patch versions, and by semantic versioning rules those should only be updates such as bug and security fixes. Backwards incompatible changes should be a minor version increment, but this module is not adhering to semantic versioning rules.