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: add IdP Staging Terraform plan/apply steps #714

Merged
merged 5 commits into from
Jul 3, 2024

Conversation

patheard
Copy link
Member

@patheard patheard commented Jul 2, 2024

Summary

Update the Terraform plan/apply workflows for Staging to deploy and manage the IdP Docker image and infrastructure.

⚠️ Note

  1. For now, this will build and deploy the latest IdP image. Before this hits prod, I'll create a PR that pins the IdP image so we'll have better control over the version and config being deployed.
  2. Once this is in prod, I'm planning to update the ./.github/workflows/build-lambda-images action so that it is generic and builds all Docker images, rather than having a dedicated step for building just the IdP image.

Related

Update the Terraform plan/apply workflows for Staging to deploy and
manage the IdP Docker image and infrastructure.
@patheard patheard self-assigned this Jul 2, 2024
Copy link

github-actions bot commented Jul 3, 2024

⚠ Terrform update available

Terraform: 1.9.1 (using 1.6.6)
Terragrunt: 0.59.6 (using 0.54.8)

Copy link

github-actions bot commented Jul 3, 2024

Staging: ecr

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

Plan: 2 to add, 0 to change, 0 to destroy
Show summary
CHANGE NAME
add aws_ecr_lifecycle_policy.idp[0]
aws_ecr_repository.idp[0]
Show plan
Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # aws_ecr_lifecycle_policy.idp[0] will be created
  + resource "aws_ecr_lifecycle_policy" "idp" {
      + id          = (known after apply)
      + policy      = jsonencode(
            {
              + rules = [
                  + {
                      + action       = {
                          + type = "expire"
                        }
                      + description  = "Keep last 10 images"
                      + rulePriority = 1
                      + selection    = {
                          + countNumber = 10
                          + countType   = "imageCountMoreThan"
                          + tagStatus   = "any"
                        }
                    },
                ]
            }
        )
      + registry_id = (known after apply)
      + repository  = "idp/zitadel"
    }

  # aws_ecr_repository.idp[0] will be created
  + resource "aws_ecr_repository" "idp" {
      + arn                  = (known after apply)
      + id                   = (known after apply)
      + image_tag_mutability = "MUTABLE"
      + name                 = "idp/zitadel"
      + registry_id          = (known after apply)
      + repository_url       = (known after apply)
      + tags_all             = {
          + "CostCentre" = "forms-platform-staging"
          + "Terraform"  = "true"
        }

      + image_scanning_configuration {
          + scan_on_push = true
        }
    }

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

Changes to Outputs:
  ~ ecr_repository_url_idp                             = "" -> (known after apply)

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

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_ecr_repository.idp[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_ecr_repository.lambda[\"audit-logs-archiver-lambda\"]"]
WARN - plan.json - main - Missing Common Tags: ["aws_ecr_repository.lambda[\"audit-logs-lambda\"]"]
WARN - plan.json - main - Missing Common Tags: ["aws_ecr_repository.lambda[\"cognito-email-sender-lambda\"]"]
WARN - plan.json - main - Missing Common Tags: ["aws_ecr_repository.lambda[\"cognito-pre-sign-up-lambda\"]"]
WARN - plan.json - main - Missing Common Tags: ["aws_ecr_repository.lambda[\"form-archiver-lambda\"]"]
WARN - plan.json - main - Missing Common Tags: ["aws_ecr_repository.lambda[\"load-testing-lambda\"]"]
WARN - plan.json - main - Missing Common Tags: ["aws_ecr_repository.lambda[\"nagware-lambda\"]"]
WARN - plan.json - main - Missing Common Tags: ["aws_ecr_repository.lambda[\"notify-slack-lambda\"]"]
WARN - plan.json - main - Missing Common Tags: ["aws_ecr_repository.lambda[\"reliability-dlq-consumer-lambda\"]"]
WARN - plan.json - main - Missing Common Tags: ["aws_ecr_repository.lambda[\"reliability-lambda\"]"]
WARN - plan.json - main - Missing Common Tags: ["aws_ecr_repository.lambda[\"response-archiver-lambda\"]"]
WARN - plan.json - main - Missing Common Tags: ["aws_ecr_repository.lambda[\"submission-lambda\"]"]
WARN - plan.json - main - Missing Common Tags: ["aws_ecr_repository.lambda[\"vault-integrity-lambda\"]"]
WARN - plan.json - main - Missing Common Tags: ["aws_ecr_repository.viewer_repository"]

34 tests, 19 passed, 15 warnings, 0 failures, 0 exceptions

Copy link

github-actions bot commented Jul 3, 2024

Staging: network

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

Plan: 15 to add, 0 to change, 0 to destroy
Show summary
CHANGE NAME
add aws_security_group.idp_db[0]
aws_security_group.idp_ecs[0]
aws_security_group.idp_lb[0]
aws_security_group_rule.idp_db_egress_privatelink[0]
aws_security_group_rule.idp_db_ingress_ecs[0]
aws_security_group_rule.idp_ecs_egress_db[0]
aws_security_group_rule.idp_ecs_egress_internet[0]
aws_security_group_rule.idp_ecs_egress_privatelink[0]
aws_security_group_rule.idp_ecs_egress_smtp_tls[0]
aws_security_group_rule.idp_ecs_ingress_lb[0]
aws_security_group_rule.idp_lb_egress_ecs[0]
aws_security_group_rule.idp_lb_ingress_internet_http[0]
aws_security_group_rule.idp_lb_ingress_internet_https[0]
aws_security_group_rule.privatelink_idp_db_ingress[0]
aws_security_group_rule.privatelink_idp_ecs_ingress[0]
Show plan
Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # aws_security_group.idp_db[0] will be created
  + resource "aws_security_group" "idp_db" {
      + arn                    = (known after apply)
      + description            = "Zitadel IdP database"
      + egress                 = (known after apply)
      + id                     = (known after apply)
      + ingress                = (known after apply)
      + name                   = "idp_db"
      + name_prefix            = (known after apply)
      + owner_id               = (known after apply)
      + revoke_rules_on_delete = false
      + tags_all               = {
          + "CostCentre" = "forms-platform-staging"
          + "Terraform"  = "true"
        }
      + vpc_id                 = "vpc-0ad5b3739860129d0"
    }

  # aws_security_group.idp_ecs[0] will be created
  + resource "aws_security_group" "idp_ecs" {
      + arn                    = (known after apply)
      + description            = "Zitadel IdP ECS Tasks"
      + egress                 = (known after apply)
      + id                     = (known after apply)
      + ingress                = (known after apply)
      + name                   = "idp_ecs"
      + name_prefix            = (known after apply)
      + owner_id               = (known after apply)
      + revoke_rules_on_delete = false
      + tags_all               = {
          + "CostCentre" = "forms-platform-staging"
          + "Terraform"  = "true"
        }
      + vpc_id                 = "vpc-0ad5b3739860129d0"
    }

  # aws_security_group.idp_lb[0] will be created
  + resource "aws_security_group" "idp_lb" {
      + arn                    = (known after apply)
      + description            = "Zitadel IdP load balancer"
      + egress                 = (known after apply)
      + id                     = (known after apply)
      + ingress                = (known after apply)
      + name                   = "idp_lb"
      + name_prefix            = (known after apply)
      + owner_id               = (known after apply)
      + revoke_rules_on_delete = false
      + tags_all               = {
          + "CostCentre" = "forms-platform-staging"
          + "Terraform"  = "true"
        }
      + vpc_id                 = "vpc-0ad5b3739860129d0"
    }

  # aws_security_group_rule.idp_db_egress_privatelink[0] will be created
  + resource "aws_security_group_rule" "idp_db_egress_privatelink" {
      + description              = "Egress from Zitadel IdP database to PrivateLink endpoints"
      + from_port                = 443
      + id                       = (known after apply)
      + protocol                 = "tcp"
      + security_group_id        = (known after apply)
      + security_group_rule_id   = (known after apply)
      + self                     = false
      + source_security_group_id = "sg-089a83b7d81dff031"
      + to_port                  = 443
      + type                     = "egress"
    }

  # aws_security_group_rule.idp_db_ingress_ecs[0] will be created
  + resource "aws_security_group_rule" "idp_db_ingress_ecs" {
      + description              = "Ingress to database from Zitadel IdP ECS task"
      + from_port                = 5432
      + id                       = (known after apply)
      + protocol                 = "tcp"
      + security_group_id        = (known after apply)
      + security_group_rule_id   = (known after apply)
      + self                     = false
      + source_security_group_id = (known after apply)
      + to_port                  = 5432
      + type                     = "ingress"
    }

  # aws_security_group_rule.idp_ecs_egress_db[0] will be created
  + resource "aws_security_group_rule" "idp_ecs_egress_db" {
      + description              = "Egress from Zitadel IdP ECS task to database"
      + from_port                = 5432
      + id                       = (known after apply)
      + protocol                 = "tcp"
      + security_group_id        = (known after apply)
      + security_group_rule_id   = (known after apply)
      + self                     = false
      + source_security_group_id = (known after apply)
      + to_port                  = 5432
      + type                     = "egress"
    }

  # aws_security_group_rule.idp_ecs_egress_internet[0] will be created
  + resource "aws_security_group_rule" "idp_ecs_egress_internet" {
      + cidr_blocks              = [
          + "0.0.0.0/0",
        ]
      + description              = "Egress from Zitadel IdP ECS task to internet (HTTPS)"
      + from_port                = 443
      + id                       = (known after apply)
      + protocol                 = "tcp"
      + security_group_id        = (known after apply)
      + security_group_rule_id   = (known after apply)
      + self                     = false
      + source_security_group_id = (known after apply)
      + to_port                  = 443
      + type                     = "egress"
    }

  # aws_security_group_rule.idp_ecs_egress_privatelink[0] will be created
  + resource "aws_security_group_rule" "idp_ecs_egress_privatelink" {
      + description              = "Egress from Zitadel IdP ECS task to PrivateLink endpoints"
      + from_port                = 443
      + id                       = (known after apply)
      + protocol                 = "tcp"
      + security_group_id        = (known after apply)
      + security_group_rule_id   = (known after apply)
      + self                     = false
      + source_security_group_id = "sg-089a83b7d81dff031"
      + to_port                  = 443
      + type                     = "egress"
    }

  # aws_security_group_rule.idp_ecs_egress_smtp_tls[0] will be created
  + resource "aws_security_group_rule" "idp_ecs_egress_smtp_tls" {
      + cidr_blocks              = [
          + "0.0.0.0/0",
        ]
      + description              = "Egress from Zitadel IdP ECS task to SMTP"
      + from_port                = 465
      + id                       = (known after apply)
      + protocol                 = "tcp"
      + security_group_id        = (known after apply)
      + security_group_rule_id   = (known after apply)
      + self                     = false
      + source_security_group_id = (known after apply)
      + to_port                  = 465
      + type                     = "egress"
    }

  # aws_security_group_rule.idp_ecs_ingress_lb[0] will be created
  + resource "aws_security_group_rule" "idp_ecs_ingress_lb" {
      + description              = "Ingress from load balancer to Zitadel IdP ECS task"
      + from_port                = 8080
      + id                       = (known after apply)
      + protocol                 = "tcp"
      + security_group_id        = (known after apply)
      + security_group_rule_id   = (known after apply)
      + self                     = false
      + source_security_group_id = (known after apply)
      + to_port                  = 8080
      + type                     = "ingress"
    }

  # aws_security_group_rule.idp_lb_egress_ecs[0] will be created
  + resource "aws_security_group_rule" "idp_lb_egress_ecs" {
      + description              = "Egress from load balancer to Zitadel IdP ECS task"
      + from_port                = 8080
      + id                       = (known after apply)
      + protocol                 = "tcp"
      + security_group_id        = (known after apply)
      + security_group_rule_id   = (known after apply)
      + self                     = false
      + source_security_group_id = (known after apply)
      + to_port                  = 8080
      + type                     = "egress"
    }

  # aws_security_group_rule.idp_lb_ingress_internet_http[0] will be created
  + resource "aws_security_group_rule" "idp_lb_ingress_internet_http" {
      + cidr_blocks              = [
          + "0.0.0.0/0",
        ]
      + description              = "Ingress from internet to the Zitadel IdP load balancer (HTTP)"
      + from_port                = 80
      + id                       = (known after apply)
      + protocol                 = "tcp"
      + security_group_id        = (known after apply)
      + security_group_rule_id   = (known after apply)
      + self                     = false
      + source_security_group_id = (known after apply)
      + to_port                  = 80
      + type                     = "ingress"
    }

  # aws_security_group_rule.idp_lb_ingress_internet_https[0] will be created
  + resource "aws_security_group_rule" "idp_lb_ingress_internet_https" {
      + cidr_blocks              = [
          + "0.0.0.0/0",
        ]
      + description              = "Ingress from internet to the Zitadel IdP load balancer (HTTPS)"
      + from_port                = 443
      + id                       = (known after apply)
      + protocol                 = "tcp"
      + security_group_id        = (known after apply)
      + security_group_rule_id   = (known after apply)
      + self                     = false
      + source_security_group_id = (known after apply)
      + to_port                  = 443
      + type                     = "ingress"
    }

  # aws_security_group_rule.privatelink_idp_db_ingress[0] will be created
  + resource "aws_security_group_rule" "privatelink_idp_db_ingress" {
      + description              = "Security group rule for Zitadel IdP database ingress"
      + from_port                = 443
      + id                       = (known after apply)
      + protocol                 = "tcp"
      + security_group_id        = "sg-089a83b7d81dff031"
      + security_group_rule_id   = (known after apply)
      + self                     = false
      + source_security_group_id = (known after apply)
      + to_port                  = 443
      + type                     = "ingress"
    }

  # aws_security_group_rule.privatelink_idp_ecs_ingress[0] will be created
  + resource "aws_security_group_rule" "privatelink_idp_ecs_ingress" {
      + description              = "Security group rule for Zitadel IdP ECS task ingress"
      + from_port                = 443
      + id                       = (known after apply)
      + protocol                 = "tcp"
      + security_group_id        = "sg-089a83b7d81dff031"
      + security_group_rule_id   = (known after apply)
      + self                     = false
      + source_security_group_id = (known after apply)
      + to_port                  = 443
      + type                     = "ingress"
    }

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

Changes to Outputs:
  ~ idp_db_security_group_id      = "" -> (known after apply)
  ~ idp_ecs_security_group_id     = "" -> (known after apply)
  ~ idp_lb_security_group_id      = "" -> (known after apply)

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

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_default_network_acl.forms"]
WARN - plan.json - main - Missing Common Tags: ["aws_default_security_group.default"]
WARN - plan.json - main - Missing Common Tags: ["aws_eip.forms_natgw[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_eip.forms_natgw[1]"]
WARN - plan.json - main - Missing Common Tags: ["aws_eip.forms_natgw[2]"]
WARN - plan.json - main - Missing Common Tags: ["aws_flow_log.vpc_flow_logs[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_internet_gateway.forms"]
WARN - plan.json - main - Missing Common Tags: ["aws_nat_gateway.forms[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_nat_gateway.forms[1]"]
WARN - plan.json - main - Missing Common Tags: ["aws_nat_gateway.forms[2]"]
WARN - plan.json - main - Missing Common Tags: ["aws_route_table.forms_private_subnet[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_route_table.forms_private_subnet[1]"]
WARN - plan.json - main - Missing Common Tags: ["aws_route_table.forms_private_subnet[2]"]
WARN - plan.json - main - Missing Common Tags: ["aws_route_table.forms_public_subnet"]
WARN - plan.json - main - Missing Common Tags: ["aws_security_group.forms"]
WARN - plan.json - main - Missing Common Tags: ["aws_security_group.forms_database"]
WARN - plan.json - main - Missing Common Tags: ["aws_security_group.forms_egress"]
WARN - plan.json - main - Missing Common Tags: ["aws_security_group.forms_load_balancer"]
WARN - plan.json - main - Missing Common Tags: ["aws_security_group.forms_redis"]
WARN - plan.json - main - Missing Common Tags: ["aws_security_group.idp_db[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_security_group.idp_ecs[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_security_group.idp_lb[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_security_group.privatelink"]
WARN - plan.json - main - Missing Common Tags: ["aws_subnet.forms_private[0]"]
WARN - plan.json - main - Missing Common Tags:...

Copy link

github-actions bot commented Jul 3, 2024

Staging: load_balancer

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

Plan: 0 to add, 0 to change, 0 to destroy
Show summary
CHANGE NAME
Show plan
Changes to Outputs:
  ~ kinesis_firehose_waf_logs_arn = "" -> "arn:aws:firehose:ca-central-1:687401027353:deliverystream/aws-waf-logs-forms"

You can apply this plan to save these new output values to the Terraform
state, without changing any real infrastructure.

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

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_acm_certificate.form_viewer"]
WARN - plan.json - main - Missing Common Tags: ["aws_acm_certificate.form_viewer_maintenance_mode"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudfront_distribution.maintenance_mode"]
WARN - plan.json - main - Missing Common Tags: ["aws_iam_role.firehose_waf_logs"]
WARN - plan.json - main - Missing Common Tags: ["aws_kinesis_firehose_delivery_stream.firehose_waf_logs"]
WARN - plan.json - main - Missing Common Tags: ["aws_lb.form_viewer"]
WARN - plan.json - main - Missing Common Tags: ["aws_lb_listener.form_viewer_http"]
WARN - plan.json - main - Missing Common Tags: ["aws_lb_listener.form_viewer_https"]
WARN - plan.json - main - Missing Common Tags: ["aws_lb_target_group.form_viewer_1"]
WARN - plan.json - main - Missing Common Tags: ["aws_lb_target_group.form_viewer_2"]
WARN - plan.json - main - Missing Common Tags: ["aws_s3_bucket.maintenance_mode"]
WARN - plan.json - main - Missing Common Tags: ["aws_s3_object.maintenance_static_page_css_files[\"style.css\"]"]
WARN - plan.json - main - Missing Common Tags: ["aws_s3_object.maintenance_static_page_html_files[\"index-fr.html\"]"]
WARN - plan.json - main - Missing Common Tags: ["aws_s3_object.maintenance_static_page_html_files[\"index.html\"]"]
WARN - plan.json - main - Missing Common Tags: ["aws_s3_object.maintenance_static_page_ico_files[\"favicon.ico\"]"]
WARN - plan.json - main - Missing Common Tags: ["aws_s3_object.maintenance_static_page_svg_files[\"site-unavailable.svg\"]"]
WARN - plan.json - main - Missing Common Tags: ["aws_shield_protection.alb"]
WARN - plan.json - main - Missing Common Tags: ["aws_shield_protection.route53_hosted_zone[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_wafv2_regex_pattern_set.cognito_login_paths"]
WARN - plan.json - main - Missing Common Tags: ["aws_wafv2_regex_pattern_set.forms_base_url"]
WARN - plan.json - main - Missing Common Tags:...

Copy link

github-actions bot commented Jul 3, 2024

Staging: idp

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

Plan: 43 to add, 0 to change, 0 to destroy
Show summary
CHANGE NAME
add aws_acm_certificate.idp
aws_acm_certificate_validation.idp
aws_lb.idp
aws_lb_listener.idp
aws_lb_listener.idp_http_redirect
aws_lb_target_group.idp
aws_route53_record.idp
aws_route53_record.idp_validation["auth.forms-staging.cdssandbox.xyz"]
aws_shield_protection.idp
aws_ssm_parameter.idp_database_cluster_admin_password
aws_ssm_parameter.idp_database_cluster_admin_username
aws_ssm_parameter.zitadel_admin_password
aws_ssm_parameter.zitadel_admin_username
aws_ssm_parameter.zitadel_database_host
aws_ssm_parameter.zitadel_database_name
aws_ssm_parameter.zitadel_database_user_password
aws_ssm_parameter.zitadel_database_user_username
aws_ssm_parameter.zitadel_secret_key
aws_wafv2_rule_group.rate_limiters_group_idp
aws_wafv2_web_acl.idp
aws_wafv2_web_acl_association.idp
aws_wafv2_web_acl_logging_configuration.idp
random_string.idp_alb_tg_suffix
module.idp_database.aws_cloudwatch_log_group.log_exports["postgresql"]
module.idp_database.aws_db_subnet_group.rds
module.idp_database.aws_rds_cluster.cluster
module.idp_database.aws_rds_cluster_instance.instances[0]
module.idp_database.aws_security_group.rds
module.idp_database.aws_security_group_rule.rds_egress
module.idp_database.aws_security_group_rule.rds_ingress
module.idp_database.random_string.random
module.idp_ecs.aws_appautoscaling_policy.this["cpu"]
module.idp_ecs.aws_appautoscaling_policy.this["memory"]
module.idp_ecs.aws_appautoscaling_target.this[0]
module.idp_ecs.aws_cloudwatch_log_group.this
module.idp_ecs.aws_ecs_cluster.this[0]
module.idp_ecs.aws_ecs_cluster_capacity_providers.this[0]
module.idp_ecs.aws_ecs_service.this
module.idp_ecs.aws_ecs_task_definition.this
module.idp_ecs.aws_iam_policy.this_task_exec
module.idp_ecs.aws_iam_role.this_task
module.idp_ecs.aws_iam_role.this_task_exec
module.idp_ecs.aws_iam_role_policy_attachment.this_task_exec

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

Show plan
Resource actions are indicated with the following symbols:
  + create
 <= read (data resources)

Terraform will perform the following actions:

  # data.aws_iam_policy_document.ecs_task_ssm_parameters will be read during apply
  # (config refers to values not yet known)
 <= data "aws_iam_policy_document" "ecs_task_ssm_parameters" {
      + id   = (known after apply)
      + json = (known after apply)

      + statement {
          + actions   = [
              + "ssm:GetParameter",
              + "ssm:GetParameters",
            ]
          + effect    = "Allow"
          + resources = [
              + (known after apply),
              + (known after apply),
              + (known after apply),
              + (known after apply),
              + (known after apply),
              + (known after apply),
              + (known after apply),
              + (known after apply),
              + (known after apply),
            ]
          + sid       = "GetSSMParameters"
        }
    }

  # aws_acm_certificate.idp will be created
  + resource "aws_acm_certificate" "idp" {
      + arn                       = (known after apply)
      + domain_name               = "auth.forms-staging.cdssandbox.xyz"
      + domain_validation_options = [
          + {
              + domain_name           = "auth.forms-staging.cdssandbox.xyz"
              + resource_record_name  = (known after apply)
              + resource_record_type  = (known after apply)
              + resource_record_value = (known after apply)
            },
        ]
      + id                        = (known after apply)
      + key_algorithm             = (known after apply)
      + not_after                 = (known after apply)
      + not_before                = (known after apply)
      + pending_renewal           = (known after apply)
      + renewal_eligibility       = (known after apply)
      + renewal_summary           = (known after apply)
      + status                    = (known after apply)
      + subject_alternative_names = [
          + "auth.forms-staging.cdssandbox.xyz",
        ]
      + tags                      = {
          + "CostCentre" = "forms-platform-staging"
          + "Terraform"  = "true"
        }
      + tags_all                  = {
          + "CostCentre" = "forms-platform-staging"
          + "Terraform"  = "true"
        }
      + type                      = (known after apply)
      + validation_emails         = (known after apply)
      + validation_method         = "DNS"
    }

  # aws_acm_certificate_validation.idp will be created
  + resource "aws_acm_certificate_validation" "idp" {
      + certificate_arn         = (known after apply)
      + id                      = (known after apply)
      + validation_record_fqdns = (known after apply)
    }

  # aws_lb.idp will be created
  + resource "aws_lb" "idp" {
      + arn                                                          = (known after apply)
      + arn_suffix                                                   = (known after apply)
      + desync_mitigation_mode                                       = "defensive"
      + dns_name                                                     = (known after apply)
      + drop_invalid_header_fields                                   = true
      + enable_deletion_protection                                   = true
      + enable_http2                                                 = true
      + enable_tls_version_and_cipher_suite_headers                  = false
      + enable_waf_fail_open                                         = false
      + enable_xff_client_port                                       = false
      + enforce_security_group_inbound_rules_on_private_link_traffic = (known after apply)
      + id                                                           = (known after apply)
      + idle_timeout                                                 = 60
      + internal                                                     = false
      + ip_address_type                                              = (known after apply)
      + load_balancer_type                                           = "application"
      + name                                                         = "idp"
      + name_prefix                                                  = (known after apply)
      + preserve_host_header                                         = false
      + security_groups                                              = [
          + "",
        ]
      + subnets                                                      = [
          + "subnet-02f5e1518cb9b8687",
          + "subnet-04d5fe34c570252ad",
          + "subnet-0db171c9d80cdcc04",
        ]
      + tags                                                         = {
          + "CostCentre" = "forms-platform-staging"
          + "Terraform"  = "true"
        }
      + tags_all                                                     = {
          + "CostCentre" = "forms-platform-staging"
          + "Terraform"  = "true"
        }
      + vpc_id                                                       = (known after apply)
      + xff_header_processing_mode                                   = "append"
      + zone_id                                                      = (known after apply)

      + access_logs {
          + bucket  = "cbs-satellite-687401027353"
          + enabled = true
          + prefix  = "lb_logs"
        }
    }

  # aws_lb_listener.idp will be created
  + resource "aws_lb_listener" "idp" {
      + arn               = (known after apply)
      + certificate_arn   = (known after apply)
      + id                = (known after apply)
      + load_balancer_arn = (known after apply)
      + port              = 443
      + protocol          = "HTTPS"
      + ssl_policy        = "ELBSecurityPolicy-TLS13-1-2-2021-06"
      + tags              = {
          + "CostCentre" = "forms-platform-staging"
          + "Terraform"  = "true"
        }
      + tags_all          = {
          + "CostCentre" = "forms-platform-staging"
          + "Terraform"  = "true"
        }

      + default_action {
          + order            = (known after apply)
          + target_group_arn = (known after apply)
          + type             = "forward"
        }
    }

  # aws_lb_listener.idp_http_redirect will be created
  + resource "aws_lb_listener" "idp_http_redirect" {
      + arn               = (known after apply)
      + id                = (known after apply)
      + load_balancer_arn = (known after apply)
      + port              = 80
      + protocol          = "HTTP"
      + ssl_policy        = (known after apply)
      + tags              = {
          + "CostCentre" = "forms-platform-staging"
          + "Terraform"  = "true"
        }
      + tags_all          = {
          + "CostCentre" = "forms-platform-staging"
          + "Terraform"  = "true"
        }

      + default_action {
          + order = (known after apply)
          + type  = "redirect"

          + redirect {
              + host        = "#{host}"
              + path        = "/#{path}"
              + port        = "443"
              + protocol    = "HTTPS"
              + query       = "#{query}"
              + status_code = "HTTP_301"
            }
        }
    }

  # aws_lb_target_group.idp will be created
  + resource "aws_lb_target_group" "idp" {
      + arn                                = (known after apply)
      + arn_suffix                         = (known after apply)
      + connection_termination             = (known after apply)
      + deregistration_delay               = "30"
      + id                                 = (known after apply)
      + ip_address_type                    = (known after apply)
      + lambda_multi_value_headers_enabled = false
      + load_balancing_algorithm_type      = (known after apply)
      + load_balancing_anomaly_mitigation  = (known after apply)
      + load_balancing_cross_zone_enabled  = (known after apply)
      + name                               = (known after apply)
      + name_prefix                        = (known after apply)
      + port                               = 8080
      + preserve_client_ip                 = (known after apply)
      + protocol                           = "HTTPS"
      + protocol_version                   = "HTTP2"
      + proxy_protocol_v2                  = false
      + slow_start                         = 0
      + tags                               = {
          + "CostCentre" = "forms-platform-staging"
          + "Terraform"  = "true"
        }
      + tags_all                           = {
          + "CostCentre" = "forms-platform-staging"
          + "Terraform"  = "true"
        }
      + target_type                        = "ip"
      + vpc_id                             = "vpc-0ad5b3739860129d0"

      + health_check {
          + enabled             = true
          + healthy_threshold   = 3
          + interval            = 30
          + matcher             = "200-399"
          + path                = "/debug/healthz"
          + port                = "traffic-port"
          + protocol            = "HTTPS"
          + timeout             = (known after apply)
          + unhealthy_threshold = 3
        }

      + stickiness {
          + cookie_duration = 86400
          + enabled         = true
          + type            = "lb_cookie"
        }
    }

  # aws_route53_record.idp will be created
  + resource "aws_route53_record" "idp" {
      + allow_overwrite = (known after apply)
      + fqdn            = (known after apply)
      + id              = (known after apply)
      + name            = "auth.forms-staging.cdssandbox.xyz"
      + type            = "A"
      + zone_id         = "Z05990652HOQ0SGHD81ZC"

      + alias {
          + evaluate_target_health = true
          + name                   = (known after apply)
          + zone_id                = (known after apply)
        }
    }

  # aws_route53_record.idp_validation["auth.forms-staging.cdssandbox.xyz"] will be created
  + resource "aws_route53_record" "idp_validation" {
      + allow_overwrite = true
      + fqdn            = (known after apply)
      + id              = (known after apply)
      + name            = (known after apply)
      + records         = (known after apply)
      + ttl             = 60
      + type            = (known after apply)
      + zone_id         = "Z05990652HOQ0SGHD81ZC"
    }

  # aws_shield_protection.idp will be created
  + resource "aws_shield_protection" "idp" {
      + arn          = (known after apply)
      + id           = (known after apply)
      + name         = "LoadBalancerIdP"
      + resource_arn = (known after apply)
      + tags_all     = {
          + "CostCentre" = "forms-platform-staging"
          + "Terraform"  = "true"
        }
    }

  # aws_ssm_parameter.idp_database_cluster_admin_password will be created
  + resource "aws_ssm_parameter" "idp_database_cluster_admin_password" {
      + arn            = (known after apply)
      + data_type      = (known after apply)
      + id             = (known after apply)
      + insecure_value = (known after apply)
      + key_id         = (known after apply)
      + name           = "idp_database_cluster_admin_password"
      + tags           = {
          + "CostCentre" = "forms-platform-staging"
          + "Terraform"  = "true"
        }
      + tags_all       = {
          + "CostCentre" = "forms-platform-staging"
          + "Terraform"  = "true"
        }
      + tier           = (known after apply)
      + type           = "SecureString"
      + value          = (sensitive value)
      + version        = (known after apply)
    }

  # aws_ssm_parameter.idp_database_cluster_admin_username will be created
  + resource "aws_ssm_parameter" "idp_database_cluster_admin_username" {
      + arn            = (known after apply)
      + data_type      = (known after apply)
      + id             = (known after apply)
      + insecure_value = (known after apply)
      + key_id         = (known after apply)
      + name           = "idp_database_cluster_admin_username"
      + tags           = {
          + "CostCentre" = "forms-platform-staging"
          + "Terraform"  = "true"
        }
      + tags_all       = {
          + "CostCentre" = "forms-platform-staging"
          + "Terraform"  = "true"
        }
      + tier           = (known after apply)
      + type           = "SecureString"
      + value          = (sensitive value)
      + version        = (known after apply)
    }

  # aws_ssm_parameter.zitadel_admin_password will be created
  + resource "aws_ssm_parameter" "zitadel_admin_password" {
      + arn            = (known after apply)
      + data_type      = (known after apply)
      + id             = (known after apply)
      + insecure_value = (known after apply)
      + key_id         = (known after apply)
      + name           = "zitadel_admin_password"
      + tags           = {
          + "CostCentre" = "forms-platform-staging"
          + "Terraform"  = "true"
        }
      + tags_all       = {
          + "CostCentre" = "forms-platform-staging"
          + "Terraform"  = "true"
        }
      + tier           = (known after apply)
      + type           = "SecureString"
      + value          = (sensitive value)
      + version        = (known after apply)
    }

  # aws_ssm_parameter.zitadel_admin_username will be created
  + resource "aws_ssm_parameter" "zitadel_admin_username" {
      + arn            = (known after apply)
      + data_type      = (known after apply)
      + id             = (known after apply)
      + insecure_value = (known after apply)
      + key_id         = (known after apply)
      + name           = "zitadel_admin_username"
      + tags           = {
          + "CostCentre" = "forms-platform-staging"
          + "Terraform"  = "true"
        }
      + tags_all       = {
          + "CostCentre" = "forms-platform-staging"
          + "Terraform"  = "true"
        }
      + tier           = (known after apply)
      + type           = "SecureString"
      + value          = (sensitive value)
      + version        = (known after apply)
    }

  # aws_ssm_parameter.zitadel_database_host will be created
  + resource "aws_ssm_parameter" "zitadel_database_host" {
      + arn            = (known after apply)
      + data_type      = (known after apply)
      + id             = (known after apply)
      + insecure_value = (known after apply)
      + key_id         = (known after apply)
      + name           = "zitadel_database_host"
      + tags           = {
          + "CostCentre" = "forms-platform-staging"
          + "Terraform"  = "true"
        }
      + tags_all       = {
          + "CostCentre" = "forms-platform-staging"
          + "Terraform"  = "true"
        }
      + tier           = (known after apply)
      + type           = "SecureString"
      + value          = (sensitive value)
      + version        = (known after apply)
    }

  # aws_ssm_parameter.zitadel_database_name will be created
  + resource "aws_ssm_parameter" "zitadel_database_name" {
      + arn            = (known after apply)
      + data_type      = (known after apply)
      + id             = (known after apply)
      + insecure_value = (known after apply)
      + key_id         = (known after apply)
      + name           = "zitadel_database_name"
      + tags           = {
          + "CostCentre" = "forms-platform-staging"
          + "Terraform"  = "true"
        }
      + tags_all       = {
          + "CostCentre" = "forms-platform-staging"
          + "Terraform"  = "true"
        }
      + tier           = (known after apply)
      + type           = "SecureString"
      + value          = (sensitive value)
      + version        = (known after apply)
    }

  # aws_ssm_parameter.zitadel_database_user_password will be created
  + resource "aws_ssm_parameter" "zitadel_database_user_password" {
      + arn            = (known after apply)
      + data_type      = (known after apply)
      + id             = (known after apply)
      + insecure_value = (known after apply)
      + key_id         = (known after apply)
      + name           = "zitadel_database_user_password"
      + tags           = {
          + "CostCentre" = "forms-platform-staging"
          + "Terraform"  = "true"
        }
      + tags_all       = {
          + "CostCentre" = "forms-platform-staging"
          + "Terraform"  = "true"
        }
      + tier           = (known after apply)
      + type           = "SecureString"
      + value          = (sensitive value)
      + version        = (known after apply)
    }

  # aws_ssm_parameter.zitadel_database_user_username will be created
  + resource "aws_ssm_parameter" "zitadel_database_user_username" {
      + arn            = (known after apply)
      + data_type      = (known after apply)
      + id             = (known after apply)
      + insecure_value = (known after apply)
      + key_id         = (known after apply)
      + name           = "zitadel_database_user_username"
      + tags           = {
          + "CostCentre" = "forms-platform-staging"
          + "Terraform"  = "true"
        }
      + tags_all       = {
          + "CostCentre" = "forms-platform-staging"
          + "Terraform"  = "true"
        }
      + tier           = (known after apply)
      + type           = "SecureString"
      + value          = (sensitive value)
      + version        = (known after apply)
    }

  # aws_ssm_parameter.zitadel_secret_key will be created
  + resource "aws_ssm_parameter" "zitadel_secret_key" {
      + arn            = (known after apply)
      + data_type      = (known after apply)
      + id             = (known after apply)
      + insecure_value = (known after apply)
      + key_id         = (known after apply)
      + name           = "zitadel_secret_key"
      + tags           = {
          + "CostCentre" = "forms-platform-staging"
          + "Terraform"  = "true"
        }
      + tags_all       = {
          + "CostCentre" = "forms-platform-staging"
          + "Terraform"  = "true"
        }
      + tier           = (known after apply)
      + type           = "SecureString"
      + value          = (sensitive value)
      + version        = (known after apply)
    }

  # aws_wafv2_rule_group.rate_limiters_group_idp will be created
  + resource "aws_wafv2_rule_group" "rate_limiters_group_idp" {
      + arn         = (known after apply)
      + capacity    = 32
      + id          = (known after apply)
      + lock_token  = (known after apply)
      + name        = "RateLimitersGroupIdP"
      + name_prefix = (known after apply)
      + scope       = "REGIONAL"
      + tags        = {
          + "CostCentre" = "forms-platform-staging"
          + "Terraform"  = "true"
        }
      + tags_all    = {
          + "CostCentre" = "forms-platform-staging"
          + "Terraform"  = "true"
        }

      + rule {
          + name     = "BlanketRequestLimit"
          + priority = 1

          + action {
              + block {
                }
            }

          + statement {
              + rate_based_statement {
                  + aggregate_key_type = "IP"
                  + limit              = 5000
                }
            }

          + visibility_config {
              + cloudwatch_metrics_enabled = true
              + metric_name                = "BlanketRequestLimit"
              + sampled_requests_enabled   = true
            }
        }
      + rule {
          + name     = "PostRequestLimit"
          + priority = 2

          + action {
              + block {
                }
            }

          + statement {
              + rate_based_statement {
                  + aggregate_key_type = "IP"
                  + limit              = 1000

                  + scope_down_statement {
                      + byte_match_statement {
                          + positional_constraint = "EXACTLY"
                          + search_string         = "post"

                          + field_to_match {
                              + method {}
                            }

                          + text_transformation {
                              + priority = 1
                              + type     = "LOWERCASE"
                            }
                        }
                    }
                }
            }

          + visibility_config {
              + cloudwatch_metrics_enabled = true
              + metric_name                = "PostRequestRateLimit"
              + sampled_requests_enabled   = true
            }
        }

      + visibility_config {
          + cloudwatch_metrics_enabled = true
          + metric_name                = "RateLimitersGroup"
          + sampled_requests_enabled   = false
        }
    }

  # aws_wafv2_web_acl.idp will be created
  + resource "aws_wafv2_web_acl" "idp" {
      + arn        = (known after apply)
      + capacity   = (known after apply)
      + id         = (known after apply)
      + lock_token = (known after apply)
      + name       = "idp"
      + scope      = "REGIONAL"
      + tags       = {
          + "CostCentre" = "forms-platform-staging"
          + "Terraform"  = "true"
        }
      + tags_all   = {
          + "CostCentre" = "forms-platform-staging"
          + "Terraform"  = "true"
        }

      + default_action {
          + allow {
            }
        }

      + rule {
          + name     = "AWSManagedRulesAmazonIpReputationList"
          + priority = 10

          + override_action {
              + none {}
            }

          + statement {
              + managed_rule_group_statement {
                  + name        = "AWSManagedRulesAmazonIpReputationList"
                  + vendor_name = "AWS"
                }
            }

          + visibility_config {
              + cloudwatch_metrics_enabled = true
              + metric_name                = "AWSManagedRulesAmazonIpReputationList"
              + sampled_requests_enabled   = true
            }
        }
      + rule {
          + name     = "AWSManagedRulesKnownBadInputsRuleSet"
          + priority = 30

          + override_action {
              + none {}
            }

          + statement {
              + managed_rule_group_statement {
                  + name        = "AWSManagedRulesKnownBadInputsRuleSet"
                  + vendor_name = "AWS"
                }
            }

          + visibility_config {
              + cloudwatch_metrics_enabled = true
              + metric_name                = "AWSManagedRulesKnownBadInputsRuleSet"
              + sampled_requests_enabled   = true
            }
        }
      + rule {
          + name     = "AWSManagedRulesLinuxRuleSet"
          + priority = 40

          + override_action {
              + none {}
            }

          + statement {
              + managed_rule_group_statement {
                  + name        = "AWSManagedRulesLinuxRuleSet"
                  + vendor_name = "AWS"
                }
            }

          + visibility_config {
              + cloudwatch_metrics_enabled = true
              + metric_name                = "AWSManagedRulesLinuxRuleSet"
              + sampled_requests_enabled   = true
            }
        }
      + rule {
          + name     = "RateLimitersRuleGroup"
          + priority = 20

          + override_action {
              + none {}
            }

          + statement {
              + rule_group_reference_statement {
                  + arn = (known after apply)
                }
            }

          + visibility_config {
              + cloudwatch_metrics_enabled = true
              + metric_name                = "rate_limiters_rule_group"
              + sampled_requests_enabled   = false
            }
        }

      + visibility_config {
          + cloudwatch_metrics_enabled = true
          + metric_name                = "idp"
          + sampled_requests_enabled   = true
        }
    }

  # aws_wafv2_web_acl_association.idp will be created
  + resource "aws_wafv2_web_acl_association" "idp" {
      + id           = (known after apply)
      + resource_arn = (known after apply)
      + web_acl_arn  = (known after apply)
    }

  # aws_wafv2_web_acl_logging_configuration.idp will be created
  + resource "aws_wafv2_web_acl_logging_configuration" "idp" {
      + id                      = (known after apply)
      + log_destination_configs = [
          + "",
        ]
      + resource_arn            = (known after apply)

      + redacted_fields {
          + single_header {
              + name = "authorization"
            }
        }
    }

  # random_string.idp_alb_tg_suffix will be created
  + resource "random_string" "idp_alb_tg_suffix" {
      + id          = (known after apply)
      + keepers     = {
          + "port"             = "8080"
          + "protocol"         = "HTTPS"
          + "protocol_version" = "HTTP2"
        }
      + length      = 3
      + lower       = true
      + min_lower   = 0
      + min_numeric = 0
      + min_special = 0
      + min_upper   = 0
      + number      = true
      + numeric     = true
      + result      = (known after apply)
      + special     = false
      + upper       = false
    }

  # module.idp_database.aws_cloudwatch_log_group.log_exports["postgresql"] will be created
  + resource "aws_cloudwatch_log_group" "log_exports" {
      + arn               = (known after apply)
      + id                = (known after apply)
      + log_group_class   = (known after apply)
      + name              = "/aws/rds/cluster/idp-cluster/postgresql"
      + name_prefix       = (known after apply)
      + retention_in_days = 7
      + skip_destroy      = false
      + tags              = {
          + "CostCentre" = "forms-platform-staging"
          + "Name"       = "idp-cluster"
          + "Terraform"  = "true"
        }
      + tags_all          = {
          + "CostCentre" = "forms-platform-staging"
          + "Name"       = "idp-cluster"
          + "Terraform"  = "true"
        }
    }

  # module.idp_database.aws_db_subnet_group.rds will be created
  + resource "aws_db_subnet_group" "rds" {
      + arn                     = (known after apply)
      + description             = "Managed by Terraform"
      + id                      = (known after apply)
      + name                    = "idp-subnet-group"
      + name_prefix             = (known after apply)
      + subnet_ids              = [
          + "subnet-07e38df0760d389d1",
          + "subnet-07f9debd31e48ce64",
          + "subnet-0af8e6e3cf80f582d",
        ]
      + supported_network_types = (known after apply)
      + tags                    = {
          + "CostCentre" = "forms-platform-staging"
          + "Name"       = "idp-subnet-group"
          + "Terraform"  = "true"
        }
      + tags_all                = {
          + "CostCentre" = "forms-platform-staging"
          + "Name"       = "idp-subnet-group"
          + "Terraform"  = "true"
        }
      + vpc_id                  = (known after apply)
    }

  # module.idp_database.aws_rds_cluster.cluster will be created
  + resource "aws_rds_cluster" "cluster" {
      + allocated_storage                   = (known after apply)
      + allow_major_version_upgrade         = false
      + apply_immediately                   = false
      + arn                                 = (known after apply)
      + availability_zones                  = (known after apply)
      + backtrack_window                    = 0
      + backup_retention_period             = 14
      + cluster_identifier                  = "idp-cluster"
      + cluster_identifier_prefix           = (known after apply)
      + cluster_members                     = (known after apply)
      + cluster_resource_id                 = (known after apply)
      + copy_tags_to_snapshot               = true
      + database_name                       = (sensitive value)
      + db_cluster_parameter_group_name     = (known after apply)
      + db_subnet_group_name                = "idp-subnet-group"
      + db_system_id                        = (known after apply)
      + delete_automated_backups            = true
      + deletion_protection                 = true
      + enable_global_write_forwarding      = false
      + enable_http_endpoint                = false
      + enabled_cloudwatch_logs_exports     = [
          + "postgresql",
        ]
      + endpoint                            = (known after apply)
      + engine                              = "aurora-postgresql"
      + engine_mode                         = "provisioned"
      + engine_version                      = "16.2"
      + engine_version_actual               = (known after apply)
      + final_snapshot_identifier           = (known after apply)
      + hosted_zone_id                      = (known after apply)
      + iam_database_authentication_enabled = false
      + iam_roles                           = (known after apply)
      + id                                  = (known after apply)
      + kms_key_id                          = (known after apply)
      + master_password                     = (sensitive value)
      + master_user_secret                  = (known after apply)
      + master_user_secret_kms_key_id       = (known after apply)
      + master_username                     = (sensitive value)
      + network_type                        = (known after apply)
      + port                                = (known after apply)
      + preferred_backup_window             = "02:00-04:00"
      + preferred_maintenance_window        = "sun:06:00-sun:07:00"
      + reader_endpoint                     = (known after apply)
      + skip_final_snapshot                 = false
      + storage_encrypted            ...
Show Conftest results
WARN - plan.json - main - Missing Common Tags: ["aws_shield_protection.idp"]

20 tests, 19 passed, 1 warning, 0 failures, 0 exceptions

Copy link
Contributor

@craigzour craigzour left a comment

Choose a reason for hiding this comment

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

LGTM!

@patheard patheard merged commit c3f3958 into develop Jul 3, 2024
11 checks passed
@patheard patheard deleted the feat/idp-staging-workflows branch July 3, 2024 14:57
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