terraform-provider-cronplan

command module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 30, 2023 License: MIT Imports: 3 Imported by: 0

README

terraform-provider-cronplan

Terraform provider to validate Amazon EventBridge Cron expressions.

Usage

provider "cronplan" {
}

data "cronplan_expr" "every_weekday" {
  cron = "5 0 ? * MON-FRI *" # NOTE: Cron expressions are validated with terraform plan
  from = "2023-09-30 10:00:00 UTC"
}

output "every_weekday" {
  value = data.cronplan_expr.every_weekday.schedules
}

check "every_weekday_schedules" {
  assert {
    condition = data.cronplan_expr.every_weekday.schedules == tolist([
      "Mon, 02 Oct 2023 00:05:00",
      "Tue, 03 Oct 2023 00:05:00",
      "Wed, 04 Oct 2023 00:05:00",
      "Thu, 05 Oct 2023 00:05:00",
      "Fri, 06 Oct 2023 00:05:00",
      "Mon, 09 Oct 2023 00:05:00",
      "Tue, 10 Oct 2023 00:05:00",
      "Wed, 11 Oct 2023 00:05:00",
      "Thu, 12 Oct 2023 00:05:00",
      "Fri, 13 Oct 2023 00:05:00",
    ])

    error_message = "Unexpected schedule: \n${join("\n", data.cronplan_expr.every_weekday.schedules)}"
  }
}

Run locally for development

cp cronplan.tf.sample cronplan.tf
make tf-plan

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL