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

feat: create monitoring in cloudwatch for aws batch failures #367

Merged
merged 5 commits into from
Oct 8, 2024

Conversation

Wi11Shell
Copy link
Contributor

Description

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

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?

@Wi11Shell Wi11Shell requested a review from a team as a code owner October 4, 2024 14:40
Copy link
Contributor

github-actions bot commented Oct 4, 2024

Terraform plan for environment: dev

Commit: 800787b

API version: 0a57d72
CLI version: 0a57d72
Selfserve version: 0a57d72
Internal version: 0a57d72

Plan summary

5 to add, 44 to change, 0 to destroy

🆕 Creates

module.service.module.eventbridge_sns.aws_cloudwatch_event_rule.this["batch-fail-sns"]
module.service.module.eventbridge_sns.aws_cloudwatch_event_target.this["batch-fail-event"]
module.service.module.eventbridge_sns.aws_iam_role.eventbridge[0]
module.service.module.sns_batch_fail.aws_sns_topic.this[0]
module.service.module.sns_batch_fail.aws_sns_topic_policy.this[0]

📖 Reads

module.service.module.sns_batch_fail.data.aws_iam_policy_document.this[0]

🔄 Updates

module.service.module.batch.aws_batch_job_definition.this["cancel-unsubmitted-bilateral"]
module.service.module.batch.aws_batch_job_definition.this["ch-vs-olcs-diffs"]
module.service.module.batch.aws_batch_job_definition.this["clean-up-variations"]
module.service.module.batch.aws_batch_job_definition.this["close-expired-windows"]
module.service.module.batch.aws_batch_job_definition.this["cns"]
module.service.module.batch.aws_batch_job_definition.this["company-profile-dlq"]
module.service.module.batch.aws_batch_job_definition.this["create-psv-licence-surrender-task"]
module.service.module.batch.aws_batch_job_definition.this["data-retention-delete"]
module.service.module.batch.aws_batch_job_definition.this["data-retention-populate"]
module.service.module.batch.aws_batch_job_definition.this["data-retention-postcheck"]
module.service.module.batch.aws_batch_job_definition.this["data-retention-precheck"]
module.service.module.batch.aws_batch_job_definition.this["database-maintenance"]
module.service.module.batch.aws_batch_job_definition.this["digital-continuation-reminders"]
module.service.module.batch.aws_batch_job_definition.this["duplicate-vehicle-warning"]
module.service.module.batch.aws_batch_job_definition.this["enqueue-ch-compare"]
module.service.module.batch.aws_batch_job_definition.this["expire-bus-registration"]
module.service.module.batch.aws_batch_job_definition.this["flag-urgent-tasks"]
module.service.module.batch.aws_batch_job_definition.this["import-users-from-csv"]
module.service.module.batch.aws_batch_job_definition.this["inspection-request-email"]
module.service.module.batch.aws_batch_job_definition.this["interim-end-date-enforcement"]
module.service.module.batch.aws_batch_job_definition.this["international-goods-export"]
module.service.module.batch.aws_batch_job_definition.this["last-tm-letter"]
module.service.module.batch.aws_batch_job_definition.this["licence-status-rules"]
module.service.module.batch.aws_batch_job_definition.this["mark-expired-permits"]
module.service.module.batch.aws_batch_job_definition.this["process-cl"]
module.service.module.batch.aws_batch_job_definition.this["process-company-profile"]
module.service.module.batch.aws_batch_job_definition.this["process-inbox"]
module.service.module.batch.aws_batch_job_definition.this["process-insolvency"]
module.service.module.batch.aws_batch_job_definition.this["process-insolvency-dlq"]
module.service.module.batch.aws_batch_job_definition.this["process-ntu"]
module.service.module.batch.aws_batch_job_definition.this["process-queue-community-licences"]
module.service.module.batch.aws_batch_job_definition.this["process-queue-disc-generation"]
module.service.module.batch.aws_batch_job_definition.this["process-queue-disc-print"]
module.service.module.batch.aws_batch_job_definition.this["process-queue-ecmt-accept"]
module.service.module.batch.aws_batch_job_definition.this["process-queue-general"]
module.service.module.batch.aws_batch_job_definition.this["process-queue-irhp-allocate"]
module.service.module.batch.aws_batch_job_definition.this["process-queue-permit-generation"]
module.service.module.batch.aws_batch_job_definition.this["process-queue-permit-print"]
module.service.module.batch.aws_batch_job_definition.this["process-queue-print"]
module.service.module.batch.aws_batch_job_definition.this["psv-operator-list-export"]
module.service.module.batch.aws_batch_job_definition.this["remove-read-audit"]
module.service.module.batch.aws_batch_job_definition.this["resolve-payments"]
module.service.module.batch.aws_batch_job_definition.this["system-parameter"]
module.service.module.batch.aws_batch_job_definition.this["transxchange-consumer"]

Show full plan
Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create
  ~ update in-place
 <= read (data resources)

Terraform will perform the following actions:

  # module.service.module.batch.aws_batch_job_definition.this["cancel-unsubmitted-bilateral"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-dev-cancel-unsubmitted-bilateral:34"
        name                       = "vol-app-dev-cancel-unsubmitted-bilateral"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "dev"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["ch-vs-olcs-diffs"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-dev-ch-vs-olcs-diffs:34"
        name                       = "vol-app-dev-ch-vs-olcs-diffs"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "dev"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["clean-up-variations"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-dev-clean-up-variations:34"
        name                       = "vol-app-dev-clean-up-variations"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "dev"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["close-expired-windows"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-dev-close-expired-windows:34"
        name                       = "vol-app-dev-close-expired-windows"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "dev"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["cns"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-dev-cns:34"
        name                       = "vol-app-dev-cns"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "dev"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["company-profile-dlq"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-dev-company-profile-dlq:34"
        name                       = "vol-app-dev-company-profile-dlq"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "dev"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["create-psv-licence-surrender-task"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-dev-create-psv-licence-surrender-task:34"
        name                       = "vol-app-dev-create-psv-licence-surrender-task"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "dev"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["data-retention-delete"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-dev-data-retention-delete:34"
        name                       = "vol-app-dev-data-retention-delete"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "dev"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["data-retention-populate"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-dev-data-retention-populate:34"
        name                       = "vol-app-dev-data-retention-populate"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "dev"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["data-retention-postcheck"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-dev-data-retention-postcheck:34"
        name                       = "vol-app-dev-data-retention-postcheck"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "dev"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["data-retention-precheck"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-dev-data-retention-precheck:34"
        name                       = "vol-app-dev-data-retention-precheck"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "dev"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["database-maintenance"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-dev-database-maintenance:34"
        name                       = "vol-app-dev-database-maintenance"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "dev"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["digital-continuation-reminders"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-dev-digital-continuation-reminders:34"
        name                       = "vol-app-dev-digital-continuation-reminders"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "dev"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["duplicate-vehicle-warning"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-dev-duplicate-vehicle-warning:34"
        name                       = "vol-app-dev-duplicate-vehicle-warning"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "dev"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["enqueue-ch-compare"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-dev-enqueue-ch-compare:34"
        name                       = "vol-app-dev-enqueue-ch-compare"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "dev"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["expire-bus-registration"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-dev-expire-bus-registration:34"
        name                       = "vol-app-dev-expire-bus-registration"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "dev"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["flag-urgent-tasks"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-dev-flag-urgent-tasks:34"
        name                       = "vol-app-dev-flag-urgent-tasks"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "dev"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["import-users-from-csv"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-dev-import-users-from-csv:34"
        name                       = "vol-app-dev-import-users-from-csv"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "dev"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["inspection-request-email"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-dev-inspection-request-email:34"
        name                       = "vol-app-dev-inspection-request-email"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "dev"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["interim-end-date-enforcement"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-dev-interim-end-date-enforcement:34"
        name                       = "vol-app-dev-interim-end-date-enforcement"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "dev"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["international-goods-export"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-dev-international-goods-export:34"
        name                       = "vol-app-dev-international-goods-export"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "dev"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["last-tm-letter"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-dev-last-tm-letter:34"
        name                       = "vol-app-dev-last-tm-letter"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "dev"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["licence-status-rules"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-dev-licence-status-rules:34"
        name                       = "vol-app-dev-licence-status-rules"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "dev"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["mark-expired-permits"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-dev-mark-expired-permits:34"
        name                       = "vol-app-dev-mark-expired-permits"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "dev"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["process-cl"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-dev-process-cl:34"
        name                       = "vol-app-dev-process-cl"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "dev"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["process-company-profile"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-dev-process-company-profile:34"
        name                       = "vol-app-dev-process-company-profile"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "dev"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["process-inbox"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-dev-process-inbox:34"
        name                       = "vol-app-dev-process-inbox"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "dev"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["process-insolvency"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-dev-process-insolvency:34"
        name                       = "vol-app-dev-process-insolvency"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "dev"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["process-insolvency-dlq"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-dev-process-insolvency-dlq:34"
        name                       = "vol-app-dev-process-insolvency-dlq"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "dev"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["process-ntu"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-dev-process-ntu:34"
        name                       = "vol-app-dev-process-ntu"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "dev"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["process-queue-community-licences"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-dev-process-queue-community-licences:34"
        name                       = "vol-app-dev-process-queue-community-licences"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "dev"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["process-queue-disc-generation"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-dev-process-queue-disc-generation:34"
        name                       = "vol-app-dev-process-queue-disc-generation"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "dev"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["process-queue-disc-print"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-dev-process-queue-disc-print:34"
        name                       = "vol-app-dev-process-queue-disc-print"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "dev"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["process-queue-ecmt-accept"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-dev-process-queue-ecmt-accept:34"
        name                       = "vol-app-dev-process-queue-ecmt-accept"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "dev"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["process-queue-general"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-dev-process-queue-general:34"
        name                       = "vol-app-dev-process-queue-general"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "dev"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["process-queue-irhp-allocate"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-dev-process-queue-irhp-allocate:34"
        name                       = "vol-app-dev-process-queue-irhp-allocate"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "dev"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["process-queue-permit-generation"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-dev-process-queue-permit-generation:34"
        name                       = "vol-app-dev-process-queue-permit-generation"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "dev"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["process-queue-permit-print"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-dev-process-queue-permit-print:34"
        name                       = "vol-app-dev-process-queue-permit-print"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "dev"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["process-queue-print"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-dev-process-queue-print:34"
        name                       = "vol-app-dev-process-queue-print"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "dev"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["psv-operator-list-export"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-dev-psv-operator-list-export:37"
        name                       = "vol-app-dev-psv-operator-list-export"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "dev"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["remove-read-audit"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-dev-remove-read-audit:34"
        name                       = "vol-app-dev-remove-read-audit"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "dev"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["resolve-payments"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-dev-resolve-payments:34"
        name                       = "vol-app-dev-resolve-payments"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "dev"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["system-parameter"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-dev-system-parameter:34"
        name                       = "vol-app-dev-system-parameter"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "dev"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["transxchange-consumer"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-dev-transxchange-consumer:34"
        name                       = "vol-app-dev-transxchange-consumer"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "dev"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.eventbridge_sns.aws_cloudwatch_event_rule.this["batch-fail-sns"] will be created
  + resource "aws_cloudwatch_event_rule" "this" {
      + arn            = (known after apply)
      + description    = "Capture failed Batch Events sent to SNS"
      + event_bus_name = "default"
      + event_pattern  = jsonencode(
            {
              + detail      = {
                  + jobName = [
                      + {
                          + wildcard = "vol-app-dev-*"
                        },
                    ]
                  + status  = [
                      + "FAILED",
                    ]
                }
              + detail-type = [
                  + "Batch Job State Change",
                ]
              + source      = [
                  + "aws.batch",
                ]
            }
        )
      + force_destroy  = false
      + id             = (known after apply)
      + name           = "batch-fail-sns-rule"
      + name_prefix    = (known after apply)
      + state          = "ENABLED"
      + tags           = {
          + "Name" = "batch-fail-sns-rule"
        }
      + tags_all       = {
          + "Environment" = "dev"
          + "Name"        = "batch-fail-sns-rule"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
    }

  # module.service.module.eventbridge_sns.aws_cloudwatch_event_target.this["batch-fail-event"] will be created
  + resource "aws_cloudwatch_event_target" "this" {
      + arn            = (known after apply)
      + event_bus_name = "default"
      + force_destroy  = false
      + id             = (known after apply)
      + rule           = "batch-fail-sns-rule"
      + target_id      = (known after apply)
    }

  # module.service.module.eventbridge_sns.aws_iam_role.eventbridge[0] will be created
  + resource "aws_iam_role" "eventbridge" {
      + arn                   = (known after apply)
      + assume_role_policy    = jsonencode(
            {
              + Statement = [
                  + {
                      + Action    = "sts:AssumeRole"
                      + Effect    = "Allow"
                      + Principal = {
                          + Service = "events.amazonaws.com"
                        }
                    },
                ]
              + Version   = "2012-10-17"
            }
        )
      + create_date           = (known after apply)
      + force_detach_policies = true
      + id                    = (known after apply)
      + managed_policy_arns   = (known after apply)
      + max_session_duration  = 3600
      + name                  = "vol-app-dev-batch-fail-role"
      + name_prefix           = (known after apply)
      + path                  = "/"
      + tags                  = {
          + "Name" = "vol-app-dev-batch-fail-role"
        }
      + tags_all              = {
          + "Environment" = "dev"
          + "Name"        = "vol-app-dev-batch-fail-role"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
      + unique_id             = (known after apply)

      + inline_policy (known after apply)
    }

  # module.service.module.sns_batch_fail.data.aws_iam_policy_document.this[0] will be read during apply
  # (config refers to values not yet known)
 <= data "aws_iam_policy_document" "this" {
      + id                        = (known after apply)
      + json                      = (known after apply)
      + minified_json             = (known after apply)
      + override_policy_documents = []
      + source_policy_documents   = []

      + statement {
          + actions   = [
              + "sns:AddPermission",
              + "sns:DeleteTopic",
              + "sns:GetTopicAttributes",
              + "sns:ListSubscriptionsByTopic",
              + "sns:Publish",
              + "sns:RemovePermission",
              + "sns:SetTopicAttributes",
              + "sns:Subscribe",
            ]
          + effect    = "Allow"
          + resources = [
              + (known after apply),
            ]
          + sid       = "__default_statement_ID"

          + condition {
              + test     = "StringEquals"
              + values   = [
                  + "054614622558",
                ]
              + variable = "AWS:SourceOwner"
            }

          + principals {
              + identifiers = [
                  + "*",
                ]
              + type        = "AWS"
            }
        }
      + statement {
          + actions   = [
              + "sns:Publish",
            ]
          + resources = (known after apply)
          + sid       = "pub"

          + principals {
              + identifiers = [
                  + "arn:aws:iam::054614622558:root",
                ]
              + type        = "AWS"
            }
        }
      + statement {
          + actions   = [
              + "sns:Receive",
              + "sns:Subscribe",
            ]
          + resources = (known after apply)
          + sid       = "sub"

          + condition {
              + test     = "ArnLike"
              + values   = [
                  + null,
                ]
              + variable = "aws:SourceArn"
            }

          + principals {
              + identifiers = [
                  + "events.amazonaws.com",
                ]
              + type        = "Service"
            }
        }
    }

  # module.service.module.sns_batch_fail.aws_sns_topic.this[0] will be created
  + resource "aws_sns_topic" "this" {
      + arn                         = (known after apply)
      + beginning_archive_time      = (known after apply)
      + content_based_deduplication = false
      + display_name                = "batch-event-failed"
      + fifo_topic                  = false
      + id                          = (known after apply)
      + name                        = (known after apply)
      + name_prefix                 = "vol-app-dev-batch-fail-topic-"
      + owner                       = (known after apply)
      + policy                      = (known after apply)
      + signature_version           = (known after apply)
      + tags                        = {
          + "Name" = "vol-app-dev-aws-sns-batch-fail"
        }
      + tags_all                    = {
          + "Environment" = "dev"
          + "Name"        = "vol-app-dev-aws-sns-batch-fail"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
      + tracing_config              = (known after apply)
    }

  # module.service.module.sns_batch_fail.aws_sns_topic_policy.this[0] will be created
  + resource "aws_sns_topic_policy" "this" {
      + arn    = (known after apply)
      + id     = (known after apply)
      + owner  = (known after apply)
      + policy = (known after apply)
    }

Plan: 5 to add, 44 to change, 0 to destroy.

Copy link
Contributor

github-actions bot commented Oct 4, 2024

Terraform plan for environment: int

Commit: 800787b

API version: 0a57d72
CLI version: 0a57d72
Selfserve version: 0a57d72
Internal version: 0a57d72

Plan summary

5 to add, 44 to change, 0 to destroy

🆕 Creates

module.service.module.eventbridge_sns.aws_cloudwatch_event_rule.this["batch-fail-sns"]
module.service.module.eventbridge_sns.aws_cloudwatch_event_target.this["batch-fail-event"]
module.service.module.eventbridge_sns.aws_iam_role.eventbridge[0]
module.service.module.sns_batch_fail.aws_sns_topic.this[0]
module.service.module.sns_batch_fail.aws_sns_topic_policy.this[0]

📖 Reads

module.service.module.sns_batch_fail.data.aws_iam_policy_document.this[0]

🔄 Updates

module.service.module.batch.aws_batch_job_definition.this["cancel-unsubmitted-bilateral"]
module.service.module.batch.aws_batch_job_definition.this["ch-vs-olcs-diffs"]
module.service.module.batch.aws_batch_job_definition.this["clean-up-variations"]
module.service.module.batch.aws_batch_job_definition.this["close-expired-windows"]
module.service.module.batch.aws_batch_job_definition.this["cns"]
module.service.module.batch.aws_batch_job_definition.this["company-profile-dlq"]
module.service.module.batch.aws_batch_job_definition.this["create-psv-licence-surrender-task"]
module.service.module.batch.aws_batch_job_definition.this["data-retention-delete"]
module.service.module.batch.aws_batch_job_definition.this["data-retention-populate"]
module.service.module.batch.aws_batch_job_definition.this["data-retention-postcheck"]
module.service.module.batch.aws_batch_job_definition.this["data-retention-precheck"]
module.service.module.batch.aws_batch_job_definition.this["database-maintenance"]
module.service.module.batch.aws_batch_job_definition.this["digital-continuation-reminders"]
module.service.module.batch.aws_batch_job_definition.this["duplicate-vehicle-warning"]
module.service.module.batch.aws_batch_job_definition.this["enqueue-ch-compare"]
module.service.module.batch.aws_batch_job_definition.this["expire-bus-registration"]
module.service.module.batch.aws_batch_job_definition.this["flag-urgent-tasks"]
module.service.module.batch.aws_batch_job_definition.this["import-users-from-csv"]
module.service.module.batch.aws_batch_job_definition.this["inspection-request-email"]
module.service.module.batch.aws_batch_job_definition.this["interim-end-date-enforcement"]
module.service.module.batch.aws_batch_job_definition.this["international-goods-export"]
module.service.module.batch.aws_batch_job_definition.this["last-tm-letter"]
module.service.module.batch.aws_batch_job_definition.this["licence-status-rules"]
module.service.module.batch.aws_batch_job_definition.this["mark-expired-permits"]
module.service.module.batch.aws_batch_job_definition.this["process-cl"]
module.service.module.batch.aws_batch_job_definition.this["process-company-profile"]
module.service.module.batch.aws_batch_job_definition.this["process-inbox"]
module.service.module.batch.aws_batch_job_definition.this["process-insolvency"]
module.service.module.batch.aws_batch_job_definition.this["process-insolvency-dlq"]
module.service.module.batch.aws_batch_job_definition.this["process-ntu"]
module.service.module.batch.aws_batch_job_definition.this["process-queue-community-licences"]
module.service.module.batch.aws_batch_job_definition.this["process-queue-disc-generation"]
module.service.module.batch.aws_batch_job_definition.this["process-queue-disc-print"]
module.service.module.batch.aws_batch_job_definition.this["process-queue-ecmt-accept"]
module.service.module.batch.aws_batch_job_definition.this["process-queue-general"]
module.service.module.batch.aws_batch_job_definition.this["process-queue-irhp-allocate"]
module.service.module.batch.aws_batch_job_definition.this["process-queue-permit-generation"]
module.service.module.batch.aws_batch_job_definition.this["process-queue-permit-print"]
module.service.module.batch.aws_batch_job_definition.this["process-queue-print"]
module.service.module.batch.aws_batch_job_definition.this["psv-operator-list-export"]
module.service.module.batch.aws_batch_job_definition.this["remove-read-audit"]
module.service.module.batch.aws_batch_job_definition.this["resolve-payments"]
module.service.module.batch.aws_batch_job_definition.this["system-parameter"]
module.service.module.batch.aws_batch_job_definition.this["transxchange-consumer"]

Show full plan
Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create
  ~ update in-place
 <= read (data resources)

Terraform will perform the following actions:

  # module.service.module.batch.aws_batch_job_definition.this["cancel-unsubmitted-bilateral"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-int-cancel-unsubmitted-bilateral:28"
        name                       = "vol-app-int-cancel-unsubmitted-bilateral"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "int"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["ch-vs-olcs-diffs"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-int-ch-vs-olcs-diffs:28"
        name                       = "vol-app-int-ch-vs-olcs-diffs"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "int"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["clean-up-variations"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-int-clean-up-variations:28"
        name                       = "vol-app-int-clean-up-variations"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "int"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["close-expired-windows"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-int-close-expired-windows:28"
        name                       = "vol-app-int-close-expired-windows"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "int"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["cns"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-int-cns:28"
        name                       = "vol-app-int-cns"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "int"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["company-profile-dlq"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-int-company-profile-dlq:28"
        name                       = "vol-app-int-company-profile-dlq"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "int"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["create-psv-licence-surrender-task"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-int-create-psv-licence-surrender-task:28"
        name                       = "vol-app-int-create-psv-licence-surrender-task"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "int"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["data-retention-delete"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-int-data-retention-delete:28"
        name                       = "vol-app-int-data-retention-delete"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "int"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["data-retention-populate"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-int-data-retention-populate:28"
        name                       = "vol-app-int-data-retention-populate"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "int"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["data-retention-postcheck"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-int-data-retention-postcheck:28"
        name                       = "vol-app-int-data-retention-postcheck"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "int"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["data-retention-precheck"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-int-data-retention-precheck:28"
        name                       = "vol-app-int-data-retention-precheck"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "int"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["database-maintenance"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-int-database-maintenance:28"
        name                       = "vol-app-int-database-maintenance"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "int"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["digital-continuation-reminders"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-int-digital-continuation-reminders:28"
        name                       = "vol-app-int-digital-continuation-reminders"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "int"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["duplicate-vehicle-warning"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-int-duplicate-vehicle-warning:28"
        name                       = "vol-app-int-duplicate-vehicle-warning"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "int"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["enqueue-ch-compare"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-int-enqueue-ch-compare:28"
        name                       = "vol-app-int-enqueue-ch-compare"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "int"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["expire-bus-registration"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-int-expire-bus-registration:28"
        name                       = "vol-app-int-expire-bus-registration"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "int"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["flag-urgent-tasks"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-int-flag-urgent-tasks:28"
        name                       = "vol-app-int-flag-urgent-tasks"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "int"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["import-users-from-csv"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-int-import-users-from-csv:28"
        name                       = "vol-app-int-import-users-from-csv"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "int"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["inspection-request-email"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-int-inspection-request-email:28"
        name                       = "vol-app-int-inspection-request-email"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "int"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["interim-end-date-enforcement"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-int-interim-end-date-enforcement:28"
        name                       = "vol-app-int-interim-end-date-enforcement"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "int"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["international-goods-export"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-int-international-goods-export:28"
        name                       = "vol-app-int-international-goods-export"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "int"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["last-tm-letter"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-int-last-tm-letter:28"
        name                       = "vol-app-int-last-tm-letter"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "int"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["licence-status-rules"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-int-licence-status-rules:28"
        name                       = "vol-app-int-licence-status-rules"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "int"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["mark-expired-permits"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-int-mark-expired-permits:28"
        name                       = "vol-app-int-mark-expired-permits"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "int"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["process-cl"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-int-process-cl:28"
        name                       = "vol-app-int-process-cl"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "int"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["process-company-profile"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-int-process-company-profile:28"
        name                       = "vol-app-int-process-company-profile"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "int"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["process-inbox"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-int-process-inbox:28"
        name                       = "vol-app-int-process-inbox"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "int"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["process-insolvency"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-int-process-insolvency:28"
        name                       = "vol-app-int-process-insolvency"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "int"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["process-insolvency-dlq"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-int-process-insolvency-dlq:28"
        name                       = "vol-app-int-process-insolvency-dlq"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "int"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["process-ntu"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-int-process-ntu:28"
        name                       = "vol-app-int-process-ntu"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "int"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["process-queue-community-licences"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-int-process-queue-community-licences:28"
        name                       = "vol-app-int-process-queue-community-licences"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "int"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["process-queue-disc-generation"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-int-process-queue-disc-generation:28"
        name                       = "vol-app-int-process-queue-disc-generation"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "int"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["process-queue-disc-print"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-int-process-queue-disc-print:28"
        name                       = "vol-app-int-process-queue-disc-print"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "int"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["process-queue-ecmt-accept"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-int-process-queue-ecmt-accept:28"
        name                       = "vol-app-int-process-queue-ecmt-accept"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "int"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["process-queue-general"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-int-process-queue-general:28"
        name                       = "vol-app-int-process-queue-general"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "int"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["process-queue-irhp-allocate"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-int-process-queue-irhp-allocate:28"
        name                       = "vol-app-int-process-queue-irhp-allocate"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "int"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["process-queue-permit-generation"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-int-process-queue-permit-generation:28"
        name                       = "vol-app-int-process-queue-permit-generation"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "int"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["process-queue-permit-print"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-int-process-queue-permit-print:28"
        name                       = "vol-app-int-process-queue-permit-print"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "int"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["process-queue-print"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-int-process-queue-print:28"
        name                       = "vol-app-int-process-queue-print"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "int"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["psv-operator-list-export"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-int-psv-operator-list-export:28"
        name                       = "vol-app-int-psv-operator-list-export"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "int"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["remove-read-audit"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-int-remove-read-audit:28"
        name                       = "vol-app-int-remove-read-audit"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "int"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["resolve-payments"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-int-resolve-payments:28"
        name                       = "vol-app-int-resolve-payments"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "int"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["system-parameter"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-int-system-parameter:28"
        name                       = "vol-app-int-system-parameter"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "int"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.batch.aws_batch_job_definition.this["transxchange-consumer"] will be updated in-place
  ~ resource "aws_batch_job_definition" "this" {
        id                         = "arn:aws:batch:eu-west-1:054614622558:job-definition/vol-app-int-transxchange-consumer:28"
        name                       = "vol-app-int-transxchange-consumer"
        tags                       = {}
      ~ tags_all                   = {
          + "Environment" = "int"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
        # (12 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.service.module.eventbridge_sns.aws_cloudwatch_event_rule.this["batch-fail-sns"] will be created
  + resource "aws_cloudwatch_event_rule" "this" {
      + arn            = (known after apply)
      + description    = "Capture failed Batch Events sent to SNS"
      + event_bus_name = "default"
      + event_pattern  = jsonencode(
            {
              + detail      = {
                  + jobName = [
                      + {
                          + wildcard = "vol-app-int-*"
                        },
                    ]
                  + status  = [
                      + "FAILED",
                    ]
                }
              + detail-type = [
                  + "Batch Job State Change",
                ]
              + source      = [
                  + "aws.batch",
                ]
            }
        )
      + force_destroy  = false
      + id             = (known after apply)
      + name           = "batch-fail-sns-rule"
      + name_prefix    = (known after apply)
      + state          = "ENABLED"
      + tags           = {
          + "Name" = "batch-fail-sns-rule"
        }
      + tags_all       = {
          + "Environment" = "int"
          + "Name"        = "batch-fail-sns-rule"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
    }

  # module.service.module.eventbridge_sns.aws_cloudwatch_event_target.this["batch-fail-event"] will be created
  + resource "aws_cloudwatch_event_target" "this" {
      + arn            = (known after apply)
      + event_bus_name = "default"
      + force_destroy  = false
      + id             = (known after apply)
      + rule           = "batch-fail-sns-rule"
      + target_id      = (known after apply)
    }

  # module.service.module.eventbridge_sns.aws_iam_role.eventbridge[0] will be created
  + resource "aws_iam_role" "eventbridge" {
      + arn                   = (known after apply)
      + assume_role_policy    = jsonencode(
            {
              + Statement = [
                  + {
                      + Action    = "sts:AssumeRole"
                      + Effect    = "Allow"
                      + Principal = {
                          + Service = "events.amazonaws.com"
                        }
                    },
                ]
              + Version   = "2012-10-17"
            }
        )
      + create_date           = (known after apply)
      + force_detach_policies = true
      + id                    = (known after apply)
      + managed_policy_arns   = (known after apply)
      + max_session_duration  = 3600
      + name                  = "vol-app-int-batch-fail-role"
      + name_prefix           = (known after apply)
      + path                  = "/"
      + tags                  = {
          + "Name" = "vol-app-int-batch-fail-role"
        }
      + tags_all              = {
          + "Environment" = "int"
          + "Name"        = "vol-app-int-batch-fail-role"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
      + unique_id             = (known after apply)

      + inline_policy (known after apply)
    }

  # module.service.module.sns_batch_fail.data.aws_iam_policy_document.this[0] will be read during apply
  # (config refers to values not yet known)
 <= data "aws_iam_policy_document" "this" {
      + id                        = (known after apply)
      + json                      = (known after apply)
      + minified_json             = (known after apply)
      + override_policy_documents = []
      + source_policy_documents   = []

      + statement {
          + actions   = [
              + "sns:AddPermission",
              + "sns:DeleteTopic",
              + "sns:GetTopicAttributes",
              + "sns:ListSubscriptionsByTopic",
              + "sns:Publish",
              + "sns:RemovePermission",
              + "sns:SetTopicAttributes",
              + "sns:Subscribe",
            ]
          + effect    = "Allow"
          + resources = [
              + (known after apply),
            ]
          + sid       = "__default_statement_ID"

          + condition {
              + test     = "StringEquals"
              + values   = [
                  + "054614622558",
                ]
              + variable = "AWS:SourceOwner"
            }

          + principals {
              + identifiers = [
                  + "*",
                ]
              + type        = "AWS"
            }
        }
      + statement {
          + actions   = [
              + "sns:Publish",
            ]
          + resources = (known after apply)
          + sid       = "pub"

          + principals {
              + identifiers = [
                  + "arn:aws:iam::054614622558:root",
                ]
              + type        = "AWS"
            }
        }
      + statement {
          + actions   = [
              + "sns:Receive",
              + "sns:Subscribe",
            ]
          + resources = (known after apply)
          + sid       = "sub"

          + condition {
              + test     = "ArnLike"
              + values   = [
                  + null,
                ]
              + variable = "aws:SourceArn"
            }

          + principals {
              + identifiers = [
                  + "events.amazonaws.com",
                ]
              + type        = "Service"
            }
        }
    }

  # module.service.module.sns_batch_fail.aws_sns_topic.this[0] will be created
  + resource "aws_sns_topic" "this" {
      + arn                         = (known after apply)
      + beginning_archive_time      = (known after apply)
      + content_based_deduplication = false
      + display_name                = "batch-event-failed"
      + fifo_topic                  = false
      + id                          = (known after apply)
      + name                        = (known after apply)
      + name_prefix                 = "vol-app-int-batch-fail-topic-"
      + owner                       = (known after apply)
      + policy                      = (known after apply)
      + signature_version           = (known after apply)
      + tags                        = {
          + "Name" = "vol-app-int-aws-sns-batch-fail"
        }
      + tags_all                    = {
          + "Environment" = "int"
          + "Name"        = "vol-app-int-aws-sns-batch-fail"
          + "Repository"  = "https://github.com/dvsa/vol-app"
        }
      + tracing_config              = (known after apply)
    }

  # module.service.module.sns_batch_fail.aws_sns_topic_policy.this[0] will be created
  + resource "aws_sns_topic_policy" "this" {
      + arn    = (known after apply)
      + id     = (known after apply)
      + owner  = (known after apply)
      + policy = (known after apply)
    }

Plan: 5 to add, 44 to change, 0 to destroy.

@Wi11Shell Wi11Shell changed the title Create monitoring in cloudwatch for AWS Batch failures feat: Create monitoring in cloudwatch for AWS Batch failures Oct 8, 2024
@Wi11Shell Wi11Shell changed the title feat: Create monitoring in cloudwatch for AWS Batch failures feat: create monitoring in cloudwatch for aws batch failures Oct 8, 2024
@Wi11Shell Wi11Shell merged commit 58c076c into main Oct 8, 2024
19 checks passed
@Wi11Shell Wi11Shell deleted the 5809-batch-alarms branch October 8, 2024 10:06
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.

3 participants