Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(terraform): fix dodgy cron expressions #220

Merged
merged 1 commit into from
Aug 6, 2024

Conversation

matbeales
Copy link
Contributor

Description

fix(terraform): Fix dodgy cron expressions

Related issue: https://dvsa.atlassian.net/browse/VOL-5223

Before submitting (or marking as "ready for review")

  • Does the pull request title follow the conventional commit specification?
  • Have you performed a self-review of the code
  • Have you have added tests that prove the fix or feature is effective and working
  • Did you make sure to update any documentation relating to this change?

Copy link
Contributor

github-actions bot commented Aug 6, 2024

Terraform plan for environment: dev

Commit: 0b18ebe

API version: 418eb0c
CLI version: 418eb0c
Selfserve version: 418eb0c
Internal version: 418eb0c

Plan summary

2 to add, 0 to change, 0 to destroy

🆕 Creates

module.service.module.eventbridge.aws_scheduler_schedule.this["process-inbox"]
module.service.module.eventbridge.aws_scheduler_schedule.this["process-ntu"]

Show full plan
Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # module.service.module.eventbridge.aws_scheduler_schedule.this["process-inbox"] will be created
  + resource "aws_scheduler_schedule" "this" {
      + arn                          = (known after apply)
      + description                  = "Schedule for vol-app-dev-process-inbox"
      + group_name                   = (known after apply)
      + id                           = (known after apply)
      + name                         = "process-inbox-schedule"
      + name_prefix                  = (known after apply)
      + schedule_expression          = "cron(45 01 * * ? *)"
      + schedule_expression_timezone = "UTC"
      + state                        = "ENABLED"

      + flexible_time_window {
          + mode = "OFF"
        }

      + target {
          + arn      = "arn:aws:scheduler:::aws-sdk:batch:submitJob"
          + input    = jsonencode(
                {
                  + JobDefinition = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-dev-process-inbox:3"
                  + JobName       = "vol-app-dev-process-inbox"
                  + JobQueue      = "arn:aws:batch:eu-west-1:054614622558:job-queue/vol-app-dev-default"
                }
            )
          + role_arn = "arn:aws:iam::054614622558:role/default"
        }
    }

  # module.service.module.eventbridge.aws_scheduler_schedule.this["process-ntu"] will be created
  + resource "aws_scheduler_schedule" "this" {
      + arn                          = (known after apply)
      + description                  = "Schedule for vol-app-dev-process-ntu"
      + group_name                   = (known after apply)
      + id                           = (known after apply)
      + name                         = "process-ntu-schedule"
      + name_prefix                  = (known after apply)
      + schedule_expression          = "cron(0 18 ? * 1-5 *)"
      + schedule_expression_timezone = "UTC"
      + state                        = "ENABLED"

      + flexible_time_window {
          + mode = "OFF"
        }

      + target {
          + arn      = "arn:aws:scheduler:::aws-sdk:batch:submitJob"
          + input    = jsonencode(
                {
                  + JobDefinition = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-dev-process-ntu:3"
                  + JobName       = "vol-app-dev-process-ntu"
                  + JobQueue      = "arn:aws:batch:eu-west-1:054614622558:job-queue/vol-app-dev-default"
                }
            )
          + role_arn = "arn:aws:iam::054614622558:role/default"
        }
    }

Plan: 2 to add, 0 to change, 0 to destroy.

@matbeales matbeales changed the title fix(terraform): Fix dodgy cron expressions fix(terraform): fix dodgy cron expressions Aug 6, 2024
@JoshuaLicense JoshuaLicense merged commit dfc4a2c into main Aug 6, 2024
17 of 18 checks passed
@JoshuaLicense JoshuaLicense deleted the VOL-5223-schedule-cron-fix branch August 6, 2024 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants