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: release v1.0.4 to production #152

Merged
merged 1 commit into from
Dec 10, 2021
Merged

feat: release v1.0.4 to production #152

merged 1 commit into from
Dec 10, 2021

Conversation

patheard
Copy link
Member

@patheard patheard commented Dec 10, 2021

Summary

Includes AWS Shield DDoS protection for ALB and Route53 as
well as ECS IAM permission changes to allow the form viewer to access
DynamoDB.

Related

Includes AWS Shield DDoS protection for ALB and Route53 as
well as ECS IAM permission changes to allow the task to access
DynamoDB.
@patheard patheard self-assigned this Dec 10, 2021
@github-actions
Copy link

Version diff

v1.0.3...v1.0.4

@github-actions
Copy link

Production: kms

✅   Terraform Format: success
✅   Terraform Plan: success
✅   Conftest: success

Plan: 1 to add, 0 to change, 0 to destroy
Show plan
Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # aws_kms_key.cloudwatch_us_east will be created
  + resource "aws_kms_key" "cloudwatch_us_east" {
      + arn                                = (known after apply)
      + bypass_policy_lockout_safety_check = false
      + customer_master_key_spec           = "SYMMETRIC_DEFAULT"
      + description                        = "CloudWatch Log Group Key"
      + enable_key_rotation                = true
      + id                                 = (known after apply)
      + is_enabled                         = true
      + key_id                             = (known after apply)
      + key_usage                          = "ENCRYPT_DECRYPT"
      + policy                             = jsonencode(
            {
              + Statement = [
                  + {
                      + Action    = "kms:*"
                      + Effect    = "Allow"
                      + Principal = {
                          + AWS = "arn:aws:iam::957818836222:root"
                        }
                      + Resource  = "*"
                      + Sid       = "Enable IAM User Permissions"
                    },
                  + {
                      + Action    = [
                          + "kms:ReEncrypt*",
                          + "kms:GenerateDataKey*",
                          + "kms:Encrypt*",
                          + "kms:Describe*",
                          + "kms:Decrypt*",
                        ]
                      + Effect    = "Allow"
                      + Principal = {
                          + Service = "logs.ca-central-1.amazonaws.com"
                        }
                      + Resource  = "*"
                      + Sid       = ""
                    },
                  + {
                      + Action    = [
                          + "kms:GenerateDataKey*",
                          + "kms:Decrypt",
                        ]
                      + Effect    = "Allow"
                      + Principal = {
                          + Service = "cloudwatch.amazonaws.com"
                        }
                      + Resource  = "*"
                      + Sid       = "Allow_CloudWatch_for_CMK"
                    },
                  + {
                      + Action    = [
                          + "kms:ReEncrypt*",
                          + "kms:GenerateDataKey*",
                          + "kms:Encrypt*",
                          + "kms:Describe*",
                          + "kms:Decrypt*",
                        ]
                      + Effect    = "Allow"
                      + Principal = {
                          + Service = "events.amazonaws.com"
                        }
                      + Resource  = "*"
                      + Sid       = "CloudwatchEvents"
                    },
                ]
              + Version   = "2012-10-17"
            }
        )
      + tags                               = {
          + "CostCentre" = "forms-platform-production"
          + "Terraform"  = "true"
        }
      + tags_all                           = {
          + "CostCentre" = "forms-platform-production"
          + "Terraform"  = "true"
        }
    }

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

Changes to Outputs:
  + kms_key_cloudwatch_us_east_arn = (known after apply)

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

Saved the plan to: plan.tfplan

To perform exactly these actions, run the following command to apply:
    terraform apply "plan.tfplan"
Releasing state lock. This may take a few moments...
Show Conftest results
9 tests, 9 passed, 0 warnings, 0 failures, 0 exceptions

@github-actions
Copy link

Production: load_balancer

✅   Terraform Format: success
✅   Terraform Plan: success
✅   Conftest: success

Plan: 2 to add, 0 to change, 0 to destroy
Show plan
Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # aws_shield_protection.alb will be created
  + resource "aws_shield_protection" "alb" {
      + arn          = (known after apply)
      + id           = (known after apply)
      + name         = "LoadBalancer"
      + resource_arn = "arn:aws:elasticloadbalancing:ca-central-1:957818836222:loadbalancer/app/form-viewer/ef2ad28d416e7d87"
      + tags         = {
          + "CostCentre" = "forms-platform-production"
          + "Terraform"  = "true"
        }
      + tags_all     = {
          + "CostCentre" = "forms-platform-production"
          + "Terraform"  = "true"
        }
    }

  # aws_shield_protection.route53_hosted_zone will be created
  + resource "aws_shield_protection" "route53_hosted_zone" {
      + arn          = (known after apply)
      + id           = (known after apply)
      + name         = "Route53HostedZone"
      + resource_arn = "arn:aws:route53:::hostedzone/Z1031499PBK3926Y7HKK"
      + tags         = {
          + "CostCentre" = "forms-platform-production"
          + "Terraform"  = "true"
        }
      + tags_all     = {
          + "CostCentre" = "forms-platform-production"
          + "Terraform"  = "true"
        }
    }

Plan: 2 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"
Releasing state lock. This may take a few moments...
Show Conftest results
9 tests, 9 passed, 0 warnings, 0 failures, 0 exceptions

@Moro-Code Moro-Code self-requested a review December 10, 2021 15:43
@github-actions
Copy link

Production: app

✅   Terraform Format: success
✅   Terraform Plan: success
✅   Conftest: success

Plan: 1 to add, 0 to change, 0 to destroy
Show plan
Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # aws_iam_policy.forms_dynamodb will be created
  + resource "aws_iam_policy" "forms_dynamodb" {
      + arn         = (known after apply)
      + description = "IAM policy for allowing access for Forms ECS task to read and write to the vault"
      + id          = (known after apply)
      + name        = "forms_dynamodb"
      + path        = "/"
      + policy      = jsonencode(
            {
              + Statement = [
                  + {
                      + Action   = [
                          + "dynamodb:UpdateItem",
                          + "dynamodb:Scan",
                          + "dynamodb:Query",
                          + "dynamodb:PutItem",
                          + "dynamodb:GetItem",
                          + "dynamodb:DeleteItem",
                          + "dynamodb:BatchWriteItem",
                        ]
                      + Effect   = "Allow"
                      + Resource = [
                          + "arn:aws:dynamodb:ca-central-1:957818836222:table/Vault",
                          + "arn:aws:dynamodb:ca-central-1:957818836222:table/ReliabilityQueue",
                        ]
                      + Sid      = ""
                    },
                ]
              + Version   = "2012-10-17"
            }
        )
      + policy_id   = (known after apply)
      + tags        = {
          + "CostCentre" = "forms-platform-production"
          + "Terraform"  = "true"
        }
      + tags_all    = {
          + "CostCentre" = "forms-platform-production"
          + "Terraform"  = "true"
        }
    }

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"
Releasing state lock. This may take a few moments...
Show Conftest results
9 tests, 9 passed, 0 warnings, 0 failures, 0 exceptions

@github-actions
Copy link

Production: alarms

✅   Terraform Format: success
✅   Terraform Plan: success
✅   Conftest: success

Plan: 8 to add, 0 to change, 0 to destroy
Show plan
Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # aws_cloudwatch_metric_alarm.alb_ddos will be created
  + resource "aws_cloudwatch_metric_alarm" "alb_ddos" {
      + actions_enabled                       = true
      + alarm_actions                         = [
          + "arn:aws:sns:ca-central-1:957818836222:alert-warning",
        ]
      + alarm_description                     = "DDoS detection for ALB"
      + alarm_name                            = "ALBDDoS"
      + arn                                   = (known after apply)
      + comparison_operator                   = "GreaterThanThreshold"
      + dimensions                            = {
          + "ResourceArn" = "arn:aws:elasticloadbalancing:ca-central-1:957818836222:loadbalancer/app/form-viewer/ef2ad28d416e7d87"
        }
      + evaluate_low_sample_count_percentiles = (known after apply)
      + evaluation_periods                    = 1
      + id                                    = (known after apply)
      + metric_name                           = "DDoSDetected"
      + namespace                             = "AWS/DDoSProtection"
      + ok_actions                            = [
          + "arn:aws:sns:ca-central-1:957818836222:alert-ok",
        ]
      + period                                = 60
      + statistic                             = "Sum"
      + tags_all                              = (known after apply)
      + threshold                             = 0
      + treat_missing_data                    = "notBreaching"
    }

  # aws_cloudwatch_metric_alarm.route53_ddos will be created
  + resource "aws_cloudwatch_metric_alarm" "route53_ddos" {
      + actions_enabled                       = true
      + alarm_actions                         = (known after apply)
      + alarm_description                     = "DDoS detection for Route53"
      + alarm_name                            = "Route53DDoS"
      + arn                                   = (known after apply)
      + comparison_operator                   = "GreaterThanThreshold"
      + dimensions                            = {
          + "ResourceArn" = "arn:aws:route53:::hostedzone/Z1031499PBK3926Y7HKK"
        }
      + evaluate_low_sample_count_percentiles = (known after apply)
      + evaluation_periods                    = 1
      + id                                    = (known after apply)
      + metric_name                           = "DDoSDetected"
      + namespace                             = "AWS/DDoSProtection"
      + ok_actions                            = (known after apply)
      + period                                = 60
      + statistic                             = "Sum"
      + tags_all                              = (known after apply)
      + threshold                             = 0
      + treat_missing_data                    = "notBreaching"
    }

  # aws_lambda_permission.notify_slack_ok_us_east will be created
  + resource "aws_lambda_permission" "notify_slack_ok_us_east" {
      + action        = "lambda:InvokeFunction"
      + function_name = "NotifySlackSNS"
      + id            = (known after apply)
      + principal     = "sns.amazonaws.com"
      + source_arn    = (known after apply)
      + statement_id  = "AllowExecutionFromSNSOkAlertUSEast"
    }

  # aws_lambda_permission.notify_slack_warning_us_east will be created
  + resource "aws_lambda_permission" "notify_slack_warning_us_east" {
      + action        = "lambda:InvokeFunction"
      + function_name = "NotifySlackSNS"
      + id            = (known after apply)
      + principal     = "sns.amazonaws.com"
      + source_arn    = (known after apply)
      + statement_id  = "AllowExecutionFromSNSWarningAlertUSEast"
    }

  # aws_sns_topic.alert_ok_us_east will be created
  + resource "aws_sns_topic" "alert_ok_us_east" {
      + arn                         = (known after apply)
      + content_based_deduplication = false
      + fifo_topic                  = false
      + id                          = (known after apply)
      + name                        = "alert-ok"
      + name_prefix                 = (known after apply)
      + owner                       = (known after apply)
      + policy                      = (known after apply)
      + tags                        = {
          + "CostCentre" = "forms-platform-production"
          + "Terraform"  = "true"
        }
      + tags_all                    = {
          + "CostCentre" = "forms-platform-production"
          + "Terraform"  = "true"
        }
    }

  # aws_sns_topic.alert_warning_us_east will be created
  + resource "aws_sns_topic" "alert_warning_us_east" {
      + arn                         = (known after apply)
      + content_based_deduplication = false
      + fifo_topic                  = false
      + id                          = (known after apply)
      + name                        = "alert-warning"
      + name_prefix                 = (known after apply)
      + owner                       = (known after apply)
      + policy                      = (known after apply)
      + tags                        = {
          + "CostCentre" = "forms-platform-production"
          + "Terraform"  = "true"
        }
      + tags_all                    = {
          + "CostCentre" = "forms-platform-production"
          + "Terraform"  = "true"
        }
    }

  # aws_sns_topic_subscription.topic_ok_us_east will be created
  + resource "aws_sns_topic_subscription" "topic_ok_us_east" {
      + arn                             = (known after apply)
      + confirmation_timeout_in_minutes = 1
      + confirmation_was_authenticated  = (known after apply)
      + endpoint                        = "arn:aws:lambda:ca-central-1:957818836222:function:NotifySlackSNS"
      + endpoint_auto_confirms          = false
      + id                              = (known after apply)
      + owner_id                        = (known after apply)
      + pending_confirmation            = (known after apply)
      + protocol                        = "lambda"
      + raw_message_delivery            = false
      + topic_arn                       = (known after apply)
    }

  # aws_sns_topic_subscription.topic_warning_us_east will be created
  + resource "aws_sns_topic_subscription" "topic_warning_us_east" {
      + arn                             = (known after apply)
      + confirmation_timeout_in_minutes = 1
      + confirmation_was_authenticated  = (known after apply)
      + endpoint                        = "arn:aws:lambda:ca-central-1:957818836222:function:NotifySlackSNS"
      + endpoint_auto_confirms          = false
      + id                              = (known after apply)
      + owner_id                        = (known after apply)
      + pending_confirmation            = (known after apply)
      + protocol                        = "lambda"
      + raw_message_delivery            = false
      + topic_arn                       = (known after apply)
    }

Plan: 8 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"
Releasing state lock. This may take a few moments...
Show Conftest results
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_metric_alarm.alb_ddos"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_metric_alarm.route53_ddos"]

10 tests, 8 passed, 2 warnings, 0 failures, 0 exceptions

@patheard patheard merged commit 580f343 into main Dec 10, 2021
@patheard patheard deleted the feat/release-1.0.4 branch December 10, 2021 15:48
craigzour pushed a commit that referenced this pull request Dec 15, 2021
Includes AWS Shield DDoS protection for ALB and Route53 as
well as ECS IAM permission changes to allow the task to access
DynamoDB.
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.

WAF: add resources to Shield Advanced
2 participants