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

deploy 2.3.52 #1068

Merged
merged 1 commit into from
Dec 7, 2023
Merged

deploy 2.3.52 #1068

merged 1 commit into from
Dec 7, 2023

Conversation

jzbahrai
Copy link
Contributor

@jzbahrai jzbahrai commented Dec 7, 2023

Summary | Résumé

add joined notifications_history table (#1066)
Setting scalable and primary celery alarms (#1067)

  • Setting scalable and primary celery alarms

  • fixing typo

Join notifications with cloud formation (#1062)

Setting log group retention for lambda functions. (#1060)

  • Setting log group retention for lambda functions.

  • Explicitly setting kms for new log grou

  • Creating two log retention variables for normal and sensitive

add restricted and org_id to services dataset (#1059)

@jzbahrai jzbahrai requested a review from jimleroyer as a code owner December 7, 2023 16:23
Copy link

github-actions bot commented Dec 7, 2023

Production: common

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

Plan: 0 to add, 4 to change, 0 to destroy
Show summary
CHANGE NAME
update aws_cloudwatch_log_group.sns_deliveries[0]
aws_cloudwatch_log_group.sns_deliveries_failures[0]
aws_cloudwatch_log_group.sns_deliveries_failures_us_west_2[0]
aws_cloudwatch_log_group.sns_deliveries_us_west_2[0]
Show plan
Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # aws_cloudwatch_log_group.sns_deliveries[0] will be updated in-place
  ~ resource "aws_cloudwatch_log_group" "sns_deliveries" {
        id                = "sns/ca-central-1/296255494825/DirectPublishToPhoneNumber"
        name              = "sns/ca-central-1/296255494825/DirectPublishToPhoneNumber"
      ~ retention_in_days = 0 -> 7
      + skip_destroy      = false
        tags              = {
            "CostCenter" = "notification-canada-ca-production"
        }
        # (2 unchanged attributes hidden)
    }

  # aws_cloudwatch_log_group.sns_deliveries_failures[0] will be updated in-place
  ~ resource "aws_cloudwatch_log_group" "sns_deliveries_failures" {
        id                = "sns/ca-central-1/296255494825/DirectPublishToPhoneNumber/Failure"
        name              = "sns/ca-central-1/296255494825/DirectPublishToPhoneNumber/Failure"
      ~ retention_in_days = 0 -> 7
      + skip_destroy      = false
        tags              = {
            "CostCenter" = "notification-canada-ca-production"
        }
        # (2 unchanged attributes hidden)
    }

  # aws_cloudwatch_log_group.sns_deliveries_failures_us_west_2[0] will be updated in-place
  ~ resource "aws_cloudwatch_log_group" "sns_deliveries_failures_us_west_2" {
        id                = "sns/us-west-2/296255494825/DirectPublishToPhoneNumber/Failure"
        name              = "sns/us-west-2/296255494825/DirectPublishToPhoneNumber/Failure"
      ~ retention_in_days = 0 -> 7
      + skip_destroy      = false
        tags              = {
            "CostCenter" = "notification-canada-ca-production"
        }
        # (2 unchanged attributes hidden)
    }

  # aws_cloudwatch_log_group.sns_deliveries_us_west_2[0] will be updated in-place
  ~ resource "aws_cloudwatch_log_group" "sns_deliveries_us_west_2" {
        id                = "sns/us-west-2/296255494825/DirectPublishToPhoneNumber"
        name              = "sns/us-west-2/296255494825/DirectPublishToPhoneNumber"
      ~ retention_in_days = 0 -> 7
      + skip_destroy      = false
        tags              = {
            "CostCenter" = "notification-canada-ca-production"
        }
        # (2 unchanged attributes hidden)
    }

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

Warning: Argument is deprecated

  with aws_s3_bucket.csv_bucket,
  on s3.tf line 5, in resource "aws_s3_bucket" "csv_bucket":
   5: resource "aws_s3_bucket" "csv_bucket" {

Use the aws_s3_bucket_lifecycle_configuration resource instead

(and 53 more similar warnings elsewhere)

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

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_athena_workgroup.primary"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_event_rule.aws_health[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_log_group.route53_resolver_query_log[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_log_group.sns_deliveries[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_log_group.sns_deliveries_failures[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_log_group.sns_deliveries_failures_us_west_2[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_log_group.sns_deliveries_us_west_2[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_metric_alarm.bulk-bulk-not-being-processed-critical[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_metric_alarm.bulk-bulk-not-being-processed-warning[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_metric_alarm.bulk-inflights-not-being-processed-critical[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_metric_alarm.bulk-inflights-not-being-processed-warning[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_metric_alarm.bulk-not-being-processed-critical[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_metric_alarm.bulk-not-being-processed-warning[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_metric_alarm.contact-3-500-error-15-minutes-critical[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_metric_alarm.document-download-bucket-size-warning[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_metric_alarm.expired-inflight-critical[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_metric_alarm.expired-inflight-warning[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_metric_alarm.healtheck-page-slow-response-critical[0]"]
WARN -...

Copy link

github-actions bot commented Dec 7, 2023

Production: ses_receiving_emails

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

Plan: 1 to add, 1 to change, 0 to destroy
Show summary
CHANGE NAME
update module.ses_receiving_emails.aws_cloudwatch_log_group.this
add module.ses_receiving_emails.aws_cloudwatch_query_definition.lambda_statistics
Show plan
Resource actions are indicated with the following symbols:
  + create
  ~ update in-place

Terraform will perform the following actions:

  # module.ses_receiving_emails.aws_cloudwatch_log_group.this will be updated in-place
  ~ resource "aws_cloudwatch_log_group" "this" {
        id                = "/aws/lambda/ses_receiving_emails"
        name              = "/aws/lambda/ses_receiving_emails"
      ~ retention_in_days = 14 -> 7
      + skip_destroy      = false
        tags              = {
            "CostCentre" = "notification-canada-ca-production"
            "Terraform"  = "true"
        }
        # (2 unchanged attributes hidden)
    }

  # module.ses_receiving_emails.aws_cloudwatch_query_definition.lambda_statistics will be created
  + resource "aws_cloudwatch_query_definition" "lambda_statistics" {
      + id                  = (known after apply)
      + log_group_names     = [
          + "aws_cloudwatch_log_group.this",
        ]
      + name                = "Lambda Statistics - ses_receiving_emails"
      + query_definition_id = (known after apply)
      + query_string        = <<-EOT
            filter @type = “REPORT”
            | stats
            count(@type) as countInvocations,
            count(@initDuration) as countColdStarts, (count(@initDuration)/count(@type))*100 as percentageColdStarts,
            max(@initDuration) as maxColdStartTime,
            avg(@duration) as averageDuration,
            max(@duration) as maxDuration,
            min(@duration) as minDuration,
            avg(@maxMemoryUsed) as averageMemoryUsed,
            max(@memorySize) as memoryAllocated, (avg(@maxMemoryUsed)/max(@memorySize))*100 as percentageMemoryUsed
            by bin(1h) as timeFrame
        EOT
    }

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

Warning: Reference to undefined provider

  on lambda.tf line 4, in module "ses_receiving_emails":
   4:     aws = aws.us-east-1

There is no explicit declaration for local provider name "aws" in
module.ses_receiving_emails, so Terraform is assuming you mean to pass a
configuration for "hashicorp/aws".

If you also control the child module, add a required_providers entry named
"aws" with the source address "hashicorp/aws".

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

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_metric_alarm.logs-1-500-error-1-minute-warning-ses_receiving_emails-api[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_metric_alarm.logs-10-500-error-5-minutes-critical-ses_receiving_emails-api[0]"]

21 tests, 19 passed, 2 warnings, 0 failures, 0 exceptions

Copy link

github-actions bot commented Dec 7, 2023

Production: ses_to_sqs_email_callbacks

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

Plan: 1 to add, 2 to change, 0 to destroy
Show summary
CHANGE NAME
add module.ses_to_sqs_email_callbacks.aws_cloudwatch_query_definition.lambda_statistics
update aws_cloudwatch_log_group.ses_to_sqs_email_callbacks_log_group[0]
module.ses_to_sqs_email_callbacks.aws_cloudwatch_log_group.this
Show plan
Resource actions are indicated with the following symbols:
  + create
  ~ update in-place

Terraform will perform the following actions:

  # aws_cloudwatch_log_group.ses_to_sqs_email_callbacks_log_group[0] will be updated in-place
  ~ resource "aws_cloudwatch_log_group" "ses_to_sqs_email_callbacks_log_group" {
        id                = "ses_to_sqs_email_callbacks_log_group"
        name              = "ses_to_sqs_email_callbacks_log_group"
      ~ retention_in_days = 0 -> 7
        tags              = {
            "Application" = "lambda"
            "CostCenter"  = "notification-canada-ca-production"
            "Environment" = "production"
        }
        # (3 unchanged attributes hidden)
    }

  # module.ses_to_sqs_email_callbacks.aws_cloudwatch_log_group.this will be updated in-place
  ~ resource "aws_cloudwatch_log_group" "this" {
        id                = "/aws/lambda/ses_to_sqs_email_callbacks"
        name              = "/aws/lambda/ses_to_sqs_email_callbacks"
      ~ retention_in_days = 14 -> 7
      + skip_destroy      = false
        tags              = {
            "CostCentre" = "notification-canada-ca-staging"
            "Terraform"  = "true"
        }
        # (2 unchanged attributes hidden)
    }

  # module.ses_to_sqs_email_callbacks.aws_cloudwatch_query_definition.lambda_statistics will be created
  + resource "aws_cloudwatch_query_definition" "lambda_statistics" {
      + id                  = (known after apply)
      + log_group_names     = [
          + "aws_cloudwatch_log_group.this",
        ]
      + name                = "Lambda Statistics - ses_to_sqs_email_callbacks"
      + query_definition_id = (known after apply)
      + query_string        = <<-EOT
            filter @type = “REPORT”
            | stats
            count(@type) as countInvocations,
            count(@initDuration) as countColdStarts, (count(@initDuration)/count(@type))*100 as percentageColdStarts,
            max(@initDuration) as maxColdStartTime,
            avg(@duration) as averageDuration,
            max(@duration) as maxDuration,
            min(@duration) as minDuration,
            avg(@maxMemoryUsed) as averageMemoryUsed,
            max(@memorySize) as memoryAllocated, (avg(@maxMemoryUsed)/max(@memorySize))*100 as percentageMemoryUsed
            by bin(1h) as timeFrame
        EOT
    }

Plan: 1 to add, 2 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_log_group.ses_to_sqs_email_callbacks_log_group[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_metric_alarm.lambda-ses-delivery-receipts-errors-critical[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_metric_alarm.lambda-ses-delivery-receipts-errors-warning[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_metric_alarm.logs-1-500-error-1-minute-warning-ses_to_sqs_email_callbacks-api[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_metric_alarm.logs-10-500-error-5-minutes-critical-ses_to_sqs_email_callbacks-500-errors-api[0]"]

24 tests, 19 passed, 5 warnings, 0 failures, 0 exceptions

Copy link

github-actions bot commented Dec 7, 2023

Production: sns_to_sqs_sms_callbacks

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

Plan: 1 to add, 2 to change, 0 to destroy
Show summary
CHANGE NAME
add module.sns_to_sqs_sms_callbacks.aws_cloudwatch_query_definition.lambda_statistics
update aws_cloudwatch_log_group.sns_to_sqs_sms_callbacks_log_group[0]
module.sns_to_sqs_sms_callbacks.aws_cloudwatch_log_group.this
Show plan
Resource actions are indicated with the following symbols:
  + create
  ~ update in-place

Terraform will perform the following actions:

  # aws_cloudwatch_log_group.sns_to_sqs_sms_callbacks_log_group[0] will be updated in-place
  ~ resource "aws_cloudwatch_log_group" "sns_to_sqs_sms_callbacks_log_group" {
        id                = "sns_to_sqs_sms_callbacks_log_group"
        name              = "sns_to_sqs_sms_callbacks_log_group"
      ~ retention_in_days = 0 -> 7
        tags              = {
            "Application" = "lambda"
            "CostCenter"  = "notification-canada-ca-production"
            "Environment" = "production"
        }
        # (3 unchanged attributes hidden)
    }

  # module.sns_to_sqs_sms_callbacks.aws_cloudwatch_log_group.this will be updated in-place
  ~ resource "aws_cloudwatch_log_group" "this" {
        id                = "/aws/lambda/sns_to_sqs_sms_callbacks"
        name              = "/aws/lambda/sns_to_sqs_sms_callbacks"
      ~ retention_in_days = 14 -> 7
      + skip_destroy      = false
        tags              = {
            "CostCentre" = "notification-canada-ca-staging"
            "Terraform"  = "true"
        }
        # (2 unchanged attributes hidden)
    }

  # module.sns_to_sqs_sms_callbacks.aws_cloudwatch_query_definition.lambda_statistics will be created
  + resource "aws_cloudwatch_query_definition" "lambda_statistics" {
      + id                  = (known after apply)
      + log_group_names     = [
          + "aws_cloudwatch_log_group.this",
        ]
      + name                = "Lambda Statistics - sns_to_sqs_sms_callbacks"
      + query_definition_id = (known after apply)
      + query_string        = <<-EOT
            filter @type = “REPORT”
            | stats
            count(@type) as countInvocations,
            count(@initDuration) as countColdStarts, (count(@initDuration)/count(@type))*100 as percentageColdStarts,
            max(@initDuration) as maxColdStartTime,
            avg(@duration) as averageDuration,
            max(@duration) as maxDuration,
            min(@duration) as minDuration,
            avg(@maxMemoryUsed) as averageMemoryUsed,
            max(@memorySize) as memoryAllocated, (avg(@maxMemoryUsed)/max(@memorySize))*100 as percentageMemoryUsed
            by bin(1h) as timeFrame
        EOT
    }

Plan: 1 to add, 2 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_log_group.sns_to_sqs_sms_callbacks_log_group[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_metric_alarm.lambda-image-sns-delivery-receipts-errors-critical[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_metric_alarm.lambda-image-sns-delivery-receipts-errors-warning[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_metric_alarm.logs-1-500-error-1-minute-warning-sns_to_sqs_sms_callbacks-api[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_metric_alarm.logs-10-500-error-5-minutes-critical-sns_to_sqs_sms_callbacks-api[0]"]

24 tests, 19 passed, 5 warnings, 0 failures, 0 exceptions

Copy link

github-actions bot commented Dec 7, 2023

Production: eks

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

⚠️   Warning: resources will be destroyed by this change!

Plan: 9 to add, 0 to change, 3 to destroy
Show summary
CHANGE NAME
add aws_cloudwatch_metric_alarm.celery-email-send-primary-replicas-unavailable[0]
aws_cloudwatch_metric_alarm.celery-email-send-scalable-replicas-unavailable[0]
aws_cloudwatch_metric_alarm.celery-primary-pods-high-cpu-warning[0]
aws_cloudwatch_metric_alarm.celery-primary-pods-high-memory-warning[0]
aws_cloudwatch_metric_alarm.celery-primary-replicas-unavailable[0]
aws_cloudwatch_metric_alarm.celery-scalable-pods-high-cpu-warning[0]
aws_cloudwatch_metric_alarm.celery-scalable-replicas-unavailable[0]
aws_cloudwatch_metric_alarm.celery-sms-send-primary-replicas-unavailable[0]
aws_cloudwatch_metric_alarm.celery-sms-send-scalable-replicas-unavailable[0]
delete aws_cloudwatch_metric_alarm.celery-pods-high-cpu-warning[0]
aws_cloudwatch_metric_alarm.celery-pods-high-memory-warning[0]
aws_cloudwatch_metric_alarm.celery-replicas-unavailable[0]
Show plan
Resource actions are indicated with the following symbols:
  + create
  - destroy

Terraform will perform the following actions:

  # aws_cloudwatch_metric_alarm.celery-email-send-primary-replicas-unavailable[0] will be created
  + resource "aws_cloudwatch_metric_alarm" "celery-email-send-primary-replicas-unavailable" {
      + actions_enabled                       = true
      + alarm_actions                         = [
          + "arn:aws:sns:ca-central-1:296255494825:alert-warning",
        ]
      + alarm_description                     = "Celery Email Send Primary Replicas Unavailable"
      + alarm_name                            = "celery-email-send-primary-replicas-unavailable"
      + arn                                   = (known after apply)
      + comparison_operator                   = "GreaterThanOrEqualToThreshold"
      + evaluate_low_sample_count_percentiles = (known after apply)
      + evaluation_periods                    = 2
      + id                                    = (known after apply)
      + tags_all                              = (known after apply)
      + threshold                             = 1
      + treat_missing_data                    = "notBreaching"

      + metric_query {
          + id          = "m1"
          + return_data = true

          + metric {
              + dimensions  = {
                  + "ClusterName" = "notification-canada-ca-production-eks-cluster"
                  + "deployment"  = "celery-email-send-primary"
                  + "namespace"   = "notification-canada-ca"
                }
              + metric_name = "kube_deployment_status_replicas_unavailable"
              + namespace   = "ContainerInsights/Prometheus"
              + period      = 300
              + stat        = "Minimum"
            }
        }
    }

  # aws_cloudwatch_metric_alarm.celery-email-send-scalable-replicas-unavailable[0] will be created
  + resource "aws_cloudwatch_metric_alarm" "celery-email-send-scalable-replicas-unavailable" {
      + actions_enabled                       = true
      + alarm_actions                         = [
          + "arn:aws:sns:ca-central-1:296255494825:alert-warning",
        ]
      + alarm_description                     = "Celery Email Send Scalable Replicas Unavailable"
      + alarm_name                            = "celery-email-send-scalable-replicas-unavailable"
      + arn                                   = (known after apply)
      + comparison_operator                   = "GreaterThanOrEqualToThreshold"
      + evaluate_low_sample_count_percentiles = (known after apply)
      + evaluation_periods                    = 3
      + id                                    = (known after apply)
      + tags_all                              = (known after apply)
      + threshold                             = 1
      + treat_missing_data                    = "notBreaching"

      + metric_query {
          + id          = "m1"
          + return_data = true

          + metric {
              + dimensions  = {
                  + "ClusterName" = "notification-canada-ca-production-eks-cluster"
                  + "deployment"  = "celery-email-send-scalable"
                  + "namespace"   = "notification-canada-ca"
                }
              + metric_name = "kube_deployment_status_replicas_unavailable"
              + namespace   = "ContainerInsights/Prometheus"
              + period      = 300
              + stat        = "Minimum"
            }
        }
    }

  # aws_cloudwatch_metric_alarm.celery-pods-high-cpu-warning[0] will be destroyed
  # (because aws_cloudwatch_metric_alarm.celery-pods-high-cpu-warning is not in configuration)
  - resource "aws_cloudwatch_metric_alarm" "celery-pods-high-cpu-warning" {
      - actions_enabled           = true -> null
      - alarm_actions             = [
          - "arn:aws:sns:ca-central-1:296255494825:alert-warning",
        ] -> null
      - alarm_description         = "Average CPU of Celery pods >=50% during 10 minutes" -> null
      - alarm_name                = "celery-pods-high-cpu-warning" -> null
      - arn                       = "arn:aws:cloudwatch:ca-central-1:296255494825:alarm:celery-pods-high-cpu-warning" -> null
      - comparison_operator       = "GreaterThanOrEqualToThreshold" -> null
      - datapoints_to_alarm       = 0 -> null
      - dimensions                = {
          - "ClusterName" = "notification-canada-ca-production-eks-cluster"
          - "Namespace"   = "notification-canada-ca"
          - "Service"     = "celery"
        } -> null
      - evaluation_periods        = 2 -> null
      - id                        = "celery-pods-high-cpu-warning" -> null
      - insufficient_data_actions = [
          - "arn:aws:sns:ca-central-1:296255494825:alert-warning",
        ] -> null
      - metric_name               = "pod_cpu_utilization" -> null
      - namespace                 = "ContainerInsights" -> null
      - ok_actions                = [] -> null
      - period                    = 300 -> null
      - statistic                 = "Average" -> null
      - tags                      = {} -> null
      - tags_all                  = {} -> null
      - threshold                 = 50 -> null
      - treat_missing_data        = "missing" -> null
    }

  # aws_cloudwatch_metric_alarm.celery-pods-high-memory-warning[0] will be destroyed
  # (because aws_cloudwatch_metric_alarm.celery-pods-high-memory-warning is not in configuration)
  - resource "aws_cloudwatch_metric_alarm" "celery-pods-high-memory-warning" {
      - actions_enabled           = true -> null
      - alarm_actions             = [
          - "arn:aws:sns:ca-central-1:296255494825:alert-warning",
        ] -> null
      - alarm_description         = "Average memory of Celery pods >=50% during 10 minutes" -> null
      - alarm_name                = "celery-pods-high-memory-warning" -> null
      - arn                       = "arn:aws:cloudwatch:ca-central-1:296255494825:alarm:celery-pods-high-memory-warning" -> null
      - comparison_operator       = "GreaterThanOrEqualToThreshold" -> null
      - datapoints_to_alarm       = 0 -> null
      - dimensions                = {
          - "ClusterName" = "notification-canada-ca-production-eks-cluster"
          - "Namespace"   = "notification-canada-ca"
          - "Service"     = "celery"
        } -> null
      - evaluation_periods        = 2 -> null
      - id                        = "celery-pods-high-memory-warning" -> null
      - insufficient_data_actions = [
          - "arn:aws:sns:ca-central-1:296255494825:alert-warning",
        ] -> null
      - metric_name               = "pod_memory_utilization" -> null
      - namespace                 = "ContainerInsights" -> null
      - ok_actions                = [] -> null
      - period                    = 300 -> null
      - statistic                 = "Average" -> null
      - tags                      = {} -> null
      - tags_all                  = {} -> null
      - threshold                 = 50 -> null
      - treat_missing_data        = "missing" -> null
    }

  # aws_cloudwatch_metric_alarm.celery-primary-pods-high-cpu-warning[0] will be created
  + resource "aws_cloudwatch_metric_alarm" "celery-primary-pods-high-cpu-warning" {
      + actions_enabled                       = true
      + alarm_actions                         = [
          + "arn:aws:sns:ca-central-1:296255494825:alert-warning",
        ]
      + alarm_description                     = "Average CPU of Primary Celery pods >=50% during 10 minutes"
      + alarm_name                            = "celery-primary-pods-high-cpu-warning"
      + arn                                   = (known after apply)
      + comparison_operator                   = "GreaterThanOrEqualToThreshold"
      + dimensions                            = {
          + "ClusterName" = "notification-canada-ca-production-eks-cluster"
          + "Namespace"   = "notification-canada-ca"
          + "Service"     = "celery-primary"
        }
      + evaluate_low_sample_count_percentiles = (known after apply)
      + evaluation_periods                    = 2
      + id                                    = (known after apply)
      + insufficient_data_actions             = [
          + "arn:aws:sns:ca-central-1:296255494825:alert-warning",
        ]
      + metric_name                           = "pod_cpu_utilization"
      + namespace                             = "ContainerInsights"
      + period                                = 300
      + statistic                             = "Average"
      + tags_all                              = (known after apply)
      + threshold                             = 50
      + treat_missing_data                    = "missing"
    }

  # aws_cloudwatch_metric_alarm.celery-primary-pods-high-memory-warning[0] will be created
  + resource "aws_cloudwatch_metric_alarm" "celery-primary-pods-high-memory-warning" {
      + actions_enabled                       = true
      + alarm_actions                         = [
          + "arn:aws:sns:ca-central-1:296255494825:alert-warning",
        ]
      + alarm_description                     = "Average memory of Primary Celery pods >=50% during 10 minutes"
      + alarm_name                            = "celery-primary-pods-high-memory-warning"
      + arn                                   = (known after apply)
      + comparison_operator                   = "GreaterThanOrEqualToThreshold"
      + dimensions                            = {
          + "ClusterName" = "notification-canada-ca-production-eks-cluster"
          + "Namespace"   = "notification-canada-ca"
          + "Service"     = "celery-primary"
        }
      + evaluate_low_sample_count_percentiles = (known after apply)
      + evaluation_periods                    = 2
      + id                                    = (known after apply)
      + insufficient_data_actions             = [
          + "arn:aws:sns:ca-central-1:296255494825:alert-warning",
        ]
      + metric_name                           = "pod_memory_utilization"
      + namespace                             = "ContainerInsights"
      + period                                = 300
      + statistic                             = "Average"
      + tags_all                              = (known after apply)
      + threshold                             = 50
      + treat_missing_data                    = "missing"
    }

  # aws_cloudwatch_metric_alarm.celery-primary-replicas-unavailable[0] will be created
  + resource "aws_cloudwatch_metric_alarm" "celery-primary-replicas-unavailable" {
      + actions_enabled                       = true
      + alarm_actions                         = [
          + "arn:aws:sns:ca-central-1:296255494825:alert-warning",
        ]
      + alarm_description                     = "Celery Primary Replicas Unavailable"
      + alarm_name                            = "celery-primary-replicas-unavailable"
      + arn                                   = (known after apply)
      + comparison_operator                   = "GreaterThanOrEqualToThreshold"
      + evaluate_low_sample_count_percentiles = (known after apply)
      + evaluation_periods                    = 2
      + id                                    = (known after apply)
      + tags_all                              = (known after apply)
      + threshold                             = 1
      + treat_missing_data                    = "notBreaching"

      + metric_query {
          + id          = "m1"
          + return_data = true

          + metric {
              + dimensions  = {
                  + "ClusterName" = "notification-canada-ca-production-eks-cluster"
                  + "deployment"  = "celery-primary"
                  + "namespace"   = "notification-canada-ca"
                }
              + metric_name = "kube_deployment_status_replicas_unavailable"
              + namespace   = "ContainerInsights/Prometheus"
              + period      = 300
              + stat        = "Minimum"
            }
        }
    }

  # aws_cloudwatch_metric_alarm.celery-replicas-unavailable[0] will be destroyed
  # (because aws_cloudwatch_metric_alarm.celery-replicas-unavailable is not in configuration)
  - resource "aws_cloudwatch_metric_alarm" "celery-replicas-unavailable" {
      - actions_enabled           = true -> null
      - alarm_actions             = [
          - "arn:aws:sns:ca-central-1:296255494825:alert-warning",
        ] -> null
      - alarm_description         = "Celery Replicas Unavailable" -> null
      - alarm_name                = "celery-replicas-unavailable" -> null
      - arn                       = "arn:aws:cloudwatch:ca-central-1:296255494825:alarm:celery-replicas-unavailable" -> null
      - comparison_operator       = "GreaterThanOrEqualToThreshold" -> null
      - datapoints_to_alarm       = 0 -> null
      - dimensions                = {} -> null
      - evaluation_periods        = 2 -> null
      - id                        = "celery-replicas-unavailable" -> null
      - insufficient_data_actions = [] -> null
      - ok_actions                = [] -> null
      - period                    = 0 -> null
      - tags                      = {} -> null
      - tags_all                  = {} -> null
      - threshold                 = 1 -> null
      - treat_missing_data        = "notBreaching" -> null

      - metric_query {
          - id          = "m1" -> null
          - period      = 0 -> null
          - return_data = true -> null

          - metric {
              - dimensions  = {
                  - "ClusterName" = "notification-canada-ca-production-eks-cluster"
                  - "deployment"  = "celery"
                  - "namespace"   = "notification-canada-ca"
                } -> null
              - metric_name = "kube_deployment_status_replicas_unavailable" -> null
              - namespace   = "ContainerInsights/Prometheus" -> null
              - period      = 300 -> null
              - stat        = "Minimum" -> null
            }
        }
    }

  # aws_cloudwatch_metric_alarm.celery-scalable-pods-high-cpu-warning[0] will be created
  + resource "aws_cloudwatch_metric_alarm" "celery-scalable-pods-high-cpu-warning" {
      + actions_enabled                       = true
      + alarm_actions                         = [
          + "arn:aws:sns:ca-central-1:296255494825:alert-warning",
        ]
      + alarm_description                     = "Average CPU of Scalable Celery pods >=50% during 10 minutes"
      + alarm_name                            = "celery-scalable-pods-high-cpu-warning"
      + arn                                   = (known after apply)
      + comparison_operator                   = "GreaterThanOrEqualToThreshold"
      + dimensions                            = {
          + "ClusterName" = "notification-canada-ca-production-eks-cluster"
          + "Namespace"   = "notification-canada-ca"
          + "Service"     = "celery-scalable"
        }
      + evaluate_low_sample_count_percentiles = (known after apply)
      + evaluation_periods                    = 2
      + id                                    = (known after apply)
      + insufficient_data_actions             = [
          + "arn:aws:sns:ca-central-1:296255494825:alert-warning",
        ]
      + metric_name                           = "pod_cpu_utilization"
      + namespace                             = "ContainerInsights"
      + period                                = 300
      + statistic                             = "Average"
      + tags_all                              = (known after apply)
      + threshold                             = 50
      + treat_missing_data                    = "missing"
    }

  # aws_cloudwatch_metric_alarm.celery-scalable-replicas-unavailable[0] will be created
  + resource "aws_cloudwatch_metric_alarm" "celery-scalable-replicas-unavailable" {
      + actions_enabled                       = true
      + alarm_actions                         = [
          + "arn:aws:sns:ca-central-1:296255494825:alert-warning",
        ]
      + alarm_description                     = "Celery Scalable Replicas Unavailable"
      + alarm_name                            = "celery-scalable-replicas-unavailable"
      + arn                                   = (known after apply)
      + comparison_operator                   = "GreaterThanOrEqualToThreshold"
      + evaluate_low_sample_count_percentiles = (known after apply)
      + evaluation_periods                    = 3
      + id                                    = (known after apply)
      + tags_all                              = (known after apply)
      + threshold                             = 1
      + treat_missing_data                    = "notBreaching"

      + metric_query {
          + id          = "m1"
          + return_data = true

          + metric {
              + dimensions  = {
                  + "ClusterName" = "notification-canada-ca-production-eks-cluster"
                  + "deployment"  = "celery-scalable"
                  + "namespace"   = "notification-canada-ca"
                }
              + metric_name = "kube_deployment_status_replicas_unavailable"
              + namespace   = "ContainerInsights/Prometheus"
              + period      = 300
              + stat        = "Minimum"
            }
        }
    }

  # aws_cloudwatch_metric_alarm.celery-sms-send-primary-replicas-unavailable[0] will be created
  + resource "aws_cloudwatch_metric_alarm" "celery-sms-send-primary-replicas-unavailable" {
      + actions_enabled                       = true
      + alarm_actions                         = [
          + "arn:aws:sns:ca-central-1:296255494825:alert-warning",
        ]
      + alarm_description                     = "Celery SMS Send Primary Replicas Unavailable"
      + alarm_name                            = "celery-sms-send-primary-replicas-unavailable"
      + arn                                   = (known after apply)
      + comparison_operator                   = "GreaterThanOrEqualToThreshold"
      + evaluate_low_sample_count_percentiles = (known after apply)
      + evaluation_periods                    = 2
      + id                                    = (known after apply)
      + tags_all                              = (known after apply)
      + threshold                             = 1
      + treat_missing_data                    = "notBreaching"

      + metric_query {
          + id          = "m1"
          + return_data = true

          + metric {
              + dimensions  = {
                  + "ClusterName" = "notification-canada-ca-production-eks-cluster"
                  + "deployment"  = "celery-sms-send-primary"
                  + "namespace"   = "notification-canada-ca"
                }
              + metric_name = "kube_deployment_status_replicas_unavailable"
              + namespace   = "ContainerInsights/Prometheus"
              + period      = 300
              + stat        = "Minimum"
            }
        }
    }

  # aws_cloudwatch_metric_alarm.celery-sms-send-scalable-replicas-unavailable[0] will be created
  + resource "aws_cloudwatch_metric_alarm" "celery-sms-send-scalable-replicas-unavailable" {
      + actions_enabled                       = true
      + alarm_actions                         = [
          + "arn:aws:sns:ca-central-1:296255494825:alert-warning",
        ]
      + alarm_description                     = "Celery SMS Send Scalable Replicas Unavailable"
      + alarm_name                            = "celery-sms-send-scalable-replicas-unavailable"
      + arn                                   = (known after apply)
      + comparison_operator                   = "GreaterThanOrEqualToThreshold"
      + evaluate_low_sample_count_percentiles = (known after apply)
      + evaluation_periods                    = 3
      + id                                    = (known after apply)
      + tags_all                              = (known after apply)
      + threshold                             = 1
      + treat_missing_data                    = "notBreaching"

      + metric_query {
          + id          = "m1"
          + return_data = true

          + metric {
              + dimensions  = {
                  + "ClusterName" = "notification-canada-ca-production-eks-cluster"
                  + "deployment"  = "celery-sms-send-scalable"
                  + "namespace"   = "notification-canada-ca"
                }
              + metric_name = "kube_deployment_status_replicas_unavailable"
              + namespace   = "ContainerInsights/Prometheus"
              + period      = 300
              + stat        = "Minimum"
            }
        }
    }

Plan: 9 to add, 0 to change, 3 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 - Cloudwatch log metric pattern is invalid: ["aws_cloudwatch_log_metric_filter.celery-error[0]"]
WARN - plan.json - main - Cloudwatch log metric pattern is invalid: ["aws_cloudwatch_log_metric_filter.scanfiles-timeout[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_acm_certificate.notification-canada-ca"]
WARN - plan.json - main - Missing Common Tags: ["aws_acm_certificate.notification-canada-ca-alt[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_alb.notification-canada-ca"]
WARN - plan.json - main - Missing Common Tags: ["aws_alb_listener.notification-canada-ca"]
WARN - plan.json - main - Missing Common Tags: ["aws_alb_target_group.notification-canada-ca-admin"]
WARN - plan.json - main - Missing Common Tags: ["aws_alb_target_group.notification-canada-ca-api"]
WARN - plan.json - main - Missing Common Tags: ["aws_alb_target_group.notification-canada-ca-document"]
WARN - plan.json - main - Missing Common Tags: ["aws_alb_target_group.notification-canada-ca-document-api"]
WARN - plan.json - main - Missing Common Tags: ["aws_alb_target_group.notification-canada-ca-documentation"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_log_group.notification-canada-ca-eks-application-logs[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_log_group.notification-canada-ca-eks-cluster-logs[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_log_group.notification-canada-ca-eks-prometheus-logs[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_metric_alarm.admin-evicted-pods[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_metric_alarm.admin-pods-high-cpu-warning[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_metric_alarm.admin-pods-high-memory-warning[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_metric_alarm.admin-replicas-unavailable[0]"]
WARN - plan.json - main - Missing Common Tags:...

Copy link

github-actions bot commented Dec 7, 2023

Production: elasticache

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

Plan: 1 to add, 0 to change, 0 to destroy
Show summary
CHANGE NAME
add aws_cloudwatch_log_group.redis-batch-saving
Show plan
Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # aws_cloudwatch_log_group.redis-batch-saving will be created
  + resource "aws_cloudwatch_log_group" "redis-batch-saving" {
      + arn               = (known after apply)
      + id                = (known after apply)
      + kms_key_id        = "arn:aws:kms:ca-central-1:296255494825:key/e9461cc1-4524-4b50-b6e6-583013da2904"
      + name              = "BatchSaving"
      + name_prefix       = (known after apply)
      + retention_in_days = 0
      + skip_destroy      = false
      + tags_all          = (known after apply)
    }

Plan: 1 to add, 0 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_log_group.notification-canada-ca-elasticache-engine-logs"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_log_group.notification-canada-ca-elasticache-slow-logs"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_log_group.redis-batch-saving"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_metric_alarm.redis-elasticache-high-connection-warning[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_metric_alarm.redis-elasticache-high-connection-warning[1]"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_metric_alarm.redis-elasticache-high-connection-warning[2]"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_metric_alarm.redis-elasticache-high-cpu-warning[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_metric_alarm.redis-elasticache-high-cpu-warning[1]"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_metric_alarm.redis-elasticache-high-cpu-warning[2]"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_metric_alarm.redis-elasticache-high-db-memory-critical[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_metric_alarm.redis-elasticache-high-db-memory-critical[1]"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_metric_alarm.redis-elasticache-high-db-memory-critical[2]"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_metric_alarm.redis-elasticache-high-db-memory-warning[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_metric_alarm.redis-elasticache-high-db-memory-warning[1]"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_metric_alarm.redis-elasticache-high-db-memory-warning[2]"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_metric_alarm.redis-elasticache-medium-cpu-warning[0]"]
WARN - plan.json - main - Missing Common Tags:...

Copy link

github-actions bot commented Dec 7, 2023

Production: quicksight

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

⚠️   Warning: resources will be destroyed by this change!

Plan: 3 to add, 1 to change, 1 to destroy
Show summary
CHANGE NAME
add aws_cloudformation_stack.notification_history
aws_cloudformation_stack.notifications
aws_quicksight_refresh_schedule.notification_history
delete aws_quicksight_data_set.notifications
update aws_quicksight_data_set.services

✂   Warning: plan has been truncated! See the full plan in the logs.

Show plan
Resource actions are indicated with the following symbols:
  + create
  ~ update in-place
  - destroy

Terraform will perform the following actions:

  # aws_cloudformation_stack.notification_history will be created
  + resource "aws_cloudformation_stack" "notification_history" {
      + id                = (known after apply)
      + name              = "notification-history"
      + notification_arns = [
          + "arn:aws:sns:ca-central-1:296255494825:aws-controltower-SecurityNotifications",
        ]
      + outputs           = (known after apply)
      + parameters        = (known after apply)
      + policy_body       = (known after apply)
      + tags_all          = (known after apply)
      + template_body     = jsonencode(
            {
              + Resources = {
                  + notificationHistoryJoined = {
                      + Properties = {
                          + AwsAccountId              = "296255494825"
                          + DataSetId                 = "notification-history"
                          + DataSetUsageConfiguration = {
                              + DisableUseAsDirectQuerySource = false
                              + DisableUseAsImportedSource    = false
                            }
                          + ImportMode                = "SPICE"
                          + LogicalTableMap           = {
                              + nj-notification-history                        = {
                                  + Alias          = "nj-notification-history"
                                  + DataTransforms = [
                                      + {
                                          + RenameColumnOperation = {
                                              + ColumnName    = "id"
                                              + NewColumnName = "notification_id"
                                            }
                                        },
                                      + {
                                          + RenameColumnOperation = {
                                              + ColumnName    = "created_at"
                                              + NewColumnName = "notification_created_at"
                                            }
                                        },
                                      + {
                                          + RenameColumnOperation = {
                                              + ColumnName    = "sent_at"
                                              + NewColumnName = "notification_sent_at"
                                            }
                                        },
                                      + {
                                          + RenameColumnOperation = {
                                              + ColumnName    = "updated_at"
                                              + NewColumnName = "notification_updated_at"
                                            }
                                        },
                                      + {
                                          + RenameColumnOperation = {
                                              + ColumnName    = "queue_name"
                                              + NewColumnName = "notification_queue_name"
                                            }
                                        },
                                      + {
                                          + RenameColumnOperation = {
                                              + ColumnName    = "key_type"
                                              + NewColumnName = "api_key_type"
                                            }
                                        },
                                    ]
                                  + Source         = {
                                      + PhysicalTableId = "nj-notification-history-physical"
                                    }
                                }
                              + nj-notification-history-services               = {
                                  + Alias  = "nj-notification-history-services"
                                  + Source = {
                                      + JoinInstruction = {
                                          + LeftOperand  = "nj-notification-history"
                                          + OnClause     = "{service_id} = {id[Services]}"
                                          + RightOperand = "nj-services"
                                          + Type         = "LEFT"
                                        }
                                    }
                                }
                              + nj-notification-history-services-org           = {
                                  + Alias  = "nj-notification-history-services-org"
                                  + Source = {
                                      + JoinInstruction = {
                                          + LeftOperand  = "nj-notification-history-services"
                                          + OnClause     = "{organisation_id} = {id[Organisation]}"
                                          + RightOperand = "nj-organisation"
                                          + Type         = "LEFT"
                                        }
                                    }
                                }
                              + nj-notification-history-services-org-templates = {
                                  + Alias          = "nj-notification-history-services-org-templates"
                                  + DataTransforms = [
                                      + {
                                          + ProjectOperation = {
                                              + ProjectedColumns = [
                                                  + "notification_id",
                                                  + "notification_created_at",
                                                  + "notification_sent_at",
                                                  + "notification_updated_at",
                                                  + "notification_type",
                                                  + "notification_status",
                                                  + "notification_queue_name",
                                                  + "job_id",
                                                  + "api_key_id",
                                                  + "api_key_type",
                                                  + "service_id",
                                                  + "service_active",
                                                  + "service_count_as_live",
                                                  + "service_go_live_at",
                                                  + "service_name",
                                                  + "service_message_limit",
                                                  + "service_rate_limit",
                                                  + "service_sms_daily_limit",
                                                  + "template_id",
                                                  + "template_version",
                                                  + "template_name",
                                                  + "template_created_at",
                                                  + "template_updated_at",
                                                  + "organisation_name",
                                                  + "organisation_id",
                                                ]
                                            }
                                        },
                                    ]
                                  + Source         = {
                                      + JoinInstruction = {
                                          + LeftOperand  = "nj-notification-history-services-org"
                                          + OnClause     = "{template_id} = {id[Templates]}"
                                          + RightOperand = "nj-templates"
                                          + Type         = "LEFT"
                                        }
                                    }
                                }
                              + nj-organisation                                = {
                                  + Alias          = "nj-organisation"
                                  + DataTransforms = [
                                      + {
                                          + RenameColumnOperation = {
                                              + ColumnName    = "id"
                                              + NewColumnName = "id[Organisation]"
                                            }
                                        },
                                      + {
                                          + RenameColumnOperation = {
                                              + ColumnName    = "created_at"
                                              + NewColumnName = "organisation_created_at"
                                            }
                                        },
                                      + {
                                          + RenameColumnOperation = {
                                              + ColumnName    = "updated_at"
                                              + NewColumnName = "organisation_updated_at"
                                            }
                                        },
                                      + {
                                          + RenameColumnOperation = {
                                              + ColumnName    = "name"
                                              + NewColumnName = "organisation_name"
                                            }
                                        },
                                    ]
                                  + Source         = {
                                      + DataSetArn = "arn:aws:quicksight:ca-central-1:296255494825:dataset/organisation"
                                    }
                                }
                              + nj-services                                    = {
                                  + Alias          = "nj-services"
                                  + DataTransforms = [
                                      + {
                                          + RenameColumnOperation = {
                                              + ColumnName    = "id"
                                              + NewColumnName = "id[Services]"
                                            }
                                        },
                                      + {
                                          + RenameColumnOperation = {
                                              + ColumnName    = "updated_at"
                                              + NewColumnName = "service_updated_at"
                                            }
                                        },
                                      + {
                                          + RenameColumnOperation = {
                                              + ColumnName    = "created_at"
                                              + NewColumnName = "service_created_at"
                                            }
                                        },
                                      + {
                                          + RenameColumnOperation = {
                                              + ColumnName    = "active"
                                              + NewColumnName = "service_active"
                                            }
                                        },
                                      + {
                                          + RenameColumnOperation = {
                                              + ColumnName    = "count_as_live"
                                              + NewColumnName = "service_count_as_live"
                                            }
                                        },
                                      + {
                                          + RenameColumnOperation = {
                                              + ColumnName    = "go_live_at"
                                              + NewColumnName = "service_go_live_at"
                                            }
                                        },
                                      + {
                                          + RenameColumnOperation = {
                                              + ColumnName    = "name"
                                              + NewColumnName = "service_name"
                                            }
                                        },
                                      + {
                                          + RenameColumnOperation = {
                                              + ColumnName    = "message_limit"
                                              + NewColumnName = "service_message_limit"
                                            }
                                        },
                                      + {
                                          + RenameColumnOperation = {
                                              + ColumnName    = "rate_limit"
                                              + NewColumnName = "service_rate_limit"
                                            }
                                        },
                                      + {
                                          + RenameColumnOperation = {
                                              + ColumnName    = "sms_daily_limit"
                                              + NewColumnName = "service_sms_daily_limit"
                                            }
                                        },
                                    ]
                                  + Source         = {
                                      + DataSetArn = "arn:aws:quicksight:ca-central-1:296255494825:dataset/services"
                                    }
                                }
                              + nj-templates                                   = {
                                  + Alias          = "nj-templates"
                                  + DataTransforms = [
                                      + {
                                          + RenameColumnOperation = {
                                              + ColumnName    = "id"
                                              + NewColumnName = "id[Templates]"
                                            }
                                        },
                                      + {
                                          + RenameColumnOperation = {
                                              + ColumnName    = "version"
                                              + NewColumnName = "template[Templates]"
                                            }
                                        },
                                      + {
                                          + RenameColumnOperation = {
                                              + ColumnName    = "service_id"
                                              + NewColumnName = "template_service_id"
                                            }
                                        },
                                      + {
                                          + RenameColumnOperation = {
                                              + ColumnName    = "updated_at"
                                              + NewColumnName = "template_updated_at"
                                            }
                                        },
                                      + {
                                          + RenameColumnOperation = {
                                              + ColumnName    = "created_at"
                                              + NewColumnName = "template_created_at"
                                            }
                                        },
                                      + {
                                          + RenameColumnOperation = {
                                              + ColumnName    = "name"
                                              + NewColumnName = "template_name"
                                            }
                                        },
                                    ]
                                  + Source         = {
                                      + DataSetArn = "arn:aws:quicksight:ca-central-1:296255494825:dataset/templatesv2"
                                    }
                                }
                            }
                          + Name                      = "Notification History"
                          + Permissions               = [
                              + {
                                  + Actions   = [
                                      + "quicksight:DescribeDataSet",
                                      + "quicksight:DescribeDataSetPermissions",
                                      + "quicksight:DescribeIngestion",
                                      + "quicksight:ListIngestions",
                                      + "quicksight:PassDataSet",
                                    ]
                                  + Principal = "arn:aws:quicksight:ca-central-1:296255494825:group/default/quicksight-dataset-viewers"
                                },
                              + {
                                  + Actions   = [
                                      + "quicksight:DescribeDataSet",
                                      + "quicksight:DescribeDataSetPermissions",
                                      + "quicksight:DescribeIngestion",
                                      + "quicksight:ListIngestions",
                                      + "quicksight:PassDataSet",
                                      + "quicksight:DeleteDataSet",
                                      + "quicksight:UpdateDataSet",
                                      + "quicksight:UpdateDataSetPermissions",
                                      + "quicksight:CreateIngestion",
                                      + "quicksight:CancelIngestion",
                                    ]
                                  + Principal = "arn:aws:quicksight:ca-central-1:296255494825:group/default/quicksight-dataset-owners"
                                },
                            ]
                          + PhysicalTableMap          = {
                              + nj-notification-history-physical = {
                                  + RelationalTable = {
                                      + DataSourceArn = "arn:aws:quicksight:ca-central-1:296255494825:datasource/NotificationCanadaCaproduction"
                                      + InputColumns  = [
                                          + {
                                              + Name = "id"
                                              + Type = "STRING"
                                            },
                                          + {
                                              + Name = "job_id"
                                              + Type = "STRING"
                                            },
                                          + {
                                              + Name = "service_id"
                                              + Type = "STRING"
                                            },
                                          + {
                                              + Name = "template_id"
                                              + Type = "STRING"
                                            },
                                          + {
                                              + Name = "created_at"
                                              + Type = "DATETIME"
                                            },
                                          + {
                                              + Name = "sent_at"
                                              + Type = "DATETIME"
                                            },
                                          + {
                                              + Name = "sent_by"
                                              + Type = "STRING"
                                            },
                                          + {
                                              + Name = "updated_at"
                                              + Type = "DATETIME"
                                            },
                                          + {
                                              + Name = "template_version"
                                              + Type = "INTEGER"
                                            },
                                          + {
                                              + Name = "api_key_id"
                                              + Type = "STRING"
                                            },
                                          + {
                                              + Name = "key_type"
                                              + Type = "STRING"
                                            },
                                          + {
                                              + Name = "notification_type"
                                              + Type = "STRING"
                                            },
                                          + {
                                              + Name = "notification_status"
                                              + Type = "STRING"
                                            },
                                          + {
                                              + Name = "queue_name"
                                              + Type = "STRING"
                                            },
                                        ]
                                      + Name          = "notification_history"
                                    }
                                }
                            }
                        }
                      + Type       = "AWS::QuickSight::DataSet"
                    }
                }
            }
        )
    }

  # aws_cloudformation_stack.notifications will be created
  + resource "aws_cloudformation_stack" "notifications" {
      + id                = (known after apply)
      + name              = "notifications"
      + notification_arns = [
          + "arn:aws:sns:ca-central-1:296255494825:aws-controltower-SecurityNotifications",
        ]
      + outputs           = (known after apply)
      + parameters        = (known after apply)
      + policy_body       = (known after apply)
      + tags_all          = (known after apply)
      + template_body     = jsonencode(
            {
              + Resources = {
                  + notificationsJoined = {
                      + Properties = {
                          + AwsAccountId              = "296255494825"
                          + DataSetId                 = "notifications"
                          + DataSetUsageConfiguration = {
                              + DisableUseAsDirectQuerySource = false
                              + DisableUseAsImportedSource    = false
                            }
                          + ImportMode                = "SPICE"
                          + LogicalTableMap           = {
                              + nj-notifications                        = {
                                  + Alias          = "nj-notifications"
                                  + DataTransforms = [
                                      + {
                                          + RenameColumnOperation = {
                                              + ColumnName    = "id"
                                              + NewColumnName = "notification_id"
                                            }
                                        },
                                      + {
                                          + RenameColumnOperation = {
                                              + ColumnName    = "created_at"
                                              + NewColumnName = "notification_created_at"
                                            }
                                        },
                                      + {
                                          + RenameColumnOperation = {
                                              + ColumnName    = "sent_at"
                                              + NewColumnName = "notification_sent_at"
                                            }
                                        },
                                      + {
                                          + RenameColumnOperation = {
                                              + ColumnName    = "updated_at"
                                              + NewColumnName = "notification_updated_at"
                                            }
                                        },
                                      + {
                                          + RenameColumnOperation = {
                                              + ColumnName    = "queue_name"
                                              + NewColumnName = "notification_queue_name"
                                            }
                                        },
                                      + {
                                          + RenameColumnOperation = {
                                              + ColumnName    = "key_type"
                                              + NewColumnName = "api_key_type"
                                            }
                                        },
                                    ]
                                  + Source         = {
                                      + PhysicalTableId = "nj-notifications-physical"
                                    }
                                }
                              + nj-notifications-services               = {
                                  + Alias  = "nj-notifications-services"
                                  + Source = {
                                      + JoinInstruction = {
                                          + LeftOperand  = "nj-notifications"
                                          + OnClause     = "{service_id} = {id[Services]}"
                                          + RightOperand = "nj-services"
                                          + Type         = "LEFT"
                                        }
                                    }
                                }
                              + nj-notifications-services-org           = {
                                  + Alias  = "nj-notifications-services-org"
                                  + Source = {
                                      + JoinInstruction = {
                                          + LeftOperand  = "nj-notifications-services"
                                          + OnClause     = "{organisation_id} = {id[Organisation]}"
                                          + RightOperand = "nj-organisation"
                                          + Type         = "LEFT"
                                        }
                                    }
                                }
                              + nj-notifications-services-org-templates = {
                                  + Alias          = "nj-notifications-services-org-templates"
                                  + DataTransforms = [
                                      + {
                                          + ProjectOperation = {
                                              + ProjectedColumns = [
                                                  + "notification_id",
                                                  + "notification_created_at",
                                                  + "notification_sent_at",
                                                  + "notification_updated_at",
                                                  + "notification_type",
                                                  + "notification_status",
                                                  + "notification_queue_name",
                                                  + "job_id",
                                                  + "api_key_id",
                                                  + "api_key_type",
                                                  + "service_id",
                                                  + "service_active",
                                                  + "service_count_as_live",
                                                  + "service_go_live_at",
                                                  + "service_name",
                                                  + "service_message_limit",
                                                  + "service_rate_limit",
                                                  + "service_sms_daily_limit",
                                                  + "template_id",
                                                  + "template_version",
                                                  +...
Show Conftest results
WARN - plan.json - main - Missing Common Tags: ["aws_cloudformation_stack.notification_history"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudformation_stack.notifications"]
WARN - plan.json - main - Missing Common Tags: ["aws_iam_policy.quicksight-rds"]
WARN - plan.json - main - Missing Common Tags: ["aws_iam_policy.quicksight_vpc_connection_ec2"]
WARN - plan.json - main - Missing Common Tags: ["aws_iam_policy.quicksight_vpc_connection_iam"]
WARN - plan.json - main - Missing Common Tags: ["aws_iam_role.quicksight"]
WARN - plan.json - main - Missing Common Tags: ["aws_iam_role.vpc_connection_role"]
WARN - plan.json - main - Missing Common Tags: ["aws_quicksight_data_set.jobs"]
WARN - plan.json - main - Missing Common Tags: ["aws_quicksight_data_set.organisation"]
WARN - plan.json - main - Missing Common Tags: ["aws_quicksight_data_set.services"]
WARN - plan.json - main - Missing Common Tags: ["aws_quicksight_data_set.templates"]
WARN - plan.json - main - Missing Common Tags: ["aws_quicksight_data_source.rds"]
WARN - plan.json - main - Missing Common Tags: ["aws_quicksight_vpc_connection.rds"]

32 tests, 19 passed, 13 warnings, 0 failures, 0 exceptions

Copy link
Contributor

@ben851 ben851 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import on redis batch log group complete. Ready to go pending Steve's approval of quicksight

@jzbahrai jzbahrai merged commit bd50114 into main Dec 7, 2023
3 checks passed
@jzbahrai jzbahrai deleted the task/new-release branch December 7, 2023 16:38
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