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: nagware lambda trigger CRON definition is incorrect #595

Merged
merged 1 commit into from
Feb 8, 2024

Conversation

craigzour
Copy link
Contributor

Summary | Résumé

  • Fixed Nagware lambda trigger CRON definition

@craigzour craigzour self-assigned this Feb 8, 2024
Copy link

github-actions bot commented Feb 8, 2024

⚠ Terrform update available

Terraform: 1.7.3 (using 1.6.6)
Terragrunt: 0.55.1 (using 0.54.8)

Copy link

github-actions bot commented Feb 8, 2024

Staging: lambdas

✅   Terraform Init: success
✅   Terraform Validate: success
✅   Terraform Format: success
✅   Terraform Plan: success
✅   Conftest: success

Plan: 3 to add, 1 to change, 0 to destroy
Show summary
CHANGE NAME
add aws_cloudwatch_event_rule.nagware_lambda_trigger
aws_cloudwatch_event_target.nagware_lambda_trigger
aws_lambda_permission.allow_cloudwatch_to_run_nagware_lambda
update aws_lambda_function.vault_integrity
Show plan
Resource actions are indicated with the following symbols:
  + create
  ~ update in-place

Terraform will perform the following actions:

  # aws_cloudwatch_event_rule.nagware_lambda_trigger will be created
  + resource "aws_cloudwatch_event_rule" "nagware_lambda_trigger" {
      + arn                 = (known after apply)
      + description         = "Fires every Tuesday, Thursday and Sunday at 5am EST"
      + event_bus_name      = "default"
      + id                  = (known after apply)
      + name                = "nagware-lambda-trigger"
      + name_prefix         = (known after apply)
      + schedule_expression = "cron(0 10 ? * TUE,THU,SUN *)"
      + tags_all            = {
          + "CostCentre" = "forms-platform-staging"
          + "Terraform"  = "true"
        }
    }

  # aws_cloudwatch_event_target.nagware_lambda_trigger will be created
  + resource "aws_cloudwatch_event_target" "nagware_lambda_trigger" {
      + arn            = "arn:aws:lambda:ca-central-1:687401027353:function:Nagware"
      + event_bus_name = "default"
      + id             = (known after apply)
      + rule           = "nagware-lambda-trigger"
      + target_id      = (known after apply)
    }

  # aws_lambda_function.vault_integrity will be updated in-place
  ~ resource "aws_lambda_function" "vault_integrity" {
        id                             = "Vault_Data_Integrity_Check"
      ~ last_modified                  = "2024-02-08T18:31:44.000+0000" -> (known after apply)
      ~ source_code_hash               = "PD5RmSEVjAYMZc1lvfSSn6O3RadR+J09hCPKVbQS/+g=" -> "TowbMcppnki+0a5fq50Oral3CqleiwGw7U1igvFz0Ws="
        tags                           = {}
        # (24 unchanged attributes hidden)

        # (3 unchanged blocks hidden)
    }

  # aws_lambda_permission.allow_cloudwatch_to_run_nagware_lambda will be created
  + resource "aws_lambda_permission" "allow_cloudwatch_to_run_nagware_lambda" {
      + action              = "lambda:InvokeFunction"
      + function_name       = "Nagware"
      + id                  = (known after apply)
      + principal           = "events.amazonaws.com"
      + source_arn          = (known after apply)
      + statement_id        = "AllowExecutionFromCloudWatch"
      + statement_id_prefix = (known after apply)
    }

Plan: 3 to add, 1 to change, 0 to destroy.

─────────────────────────────────────────────────────────────────────────────

Saved the plan to: plan.tfplan

To perform exactly these actions, run the following command to apply:
    terraform apply "plan.tfplan"
Show Conftest results
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_event_rule.form_archiver_lambda_trigger"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_event_rule.nagware_lambda_trigger"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_event_rule.reliability_dlq_lambda_trigger"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_event_rule.response_archiver_lambda_trigger"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_log_group.archive_form_templates"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_log_group.audit_logs"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_log_group.dead_letter_queue_consumer"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_log_group.nagware"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_log_group.reliability"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_log_group.response_archiver"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_log_group.submission"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_log_group.vault_integrity"]
WARN - plan.json - main - Missing Common Tags: ["aws_iam_policy.lambda_dynamodb"]
WARN - plan.json - main - Missing Common Tags: ["aws_iam_policy.lambda_kms"]
WARN - plan.json - main - Missing Common Tags: ["aws_iam_policy.lambda_logging"]
WARN - plan.json - main - Missing Common Tags: ["aws_iam_policy.lambda_rds"]
WARN - plan.json - main - Missing Common Tags: ["aws_iam_policy.lambda_s3"]
WARN - plan.json - main - Missing Common Tags: ["aws_iam_policy.lambda_secrets"]
WARN - plan.json - main - Missing Common Tags: ["aws_iam_policy.lambda_sns"]
WARN - plan.json - main - Missing Common Tags: ["aws_iam_policy.lambda_sqs"]
WARN - plan.json - main - Missing Common Tags: ["aws_iam_role.lambda"]
WARN - plan.json - main - Missing Common Tags: ["aws_lambda_function.audit_logs"]
WARN - plan.json - main - Missing Common Tags:...

@craigzour craigzour merged commit c7513ff into develop Feb 8, 2024
4 checks passed
@craigzour craigzour deleted the fix/nagware-lambda-trigger branch February 8, 2024 19:24
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