Skip to content

chore: AWS hosted github runner#1125

Open
bryan-robitaille wants to merge 5 commits intomainfrom
chore/code_build_migration
Open

chore: AWS hosted github runner#1125
bryan-robitaille wants to merge 5 commits intomainfrom
chore/code_build_migration

Conversation

@bryan-robitaille
Copy link
Copy Markdown
Contributor

Summary | Résumé

Creates an AWS hosted Github runner that can access resources in the private VPC. This runner can be activated through github actions by leveraging a webhook.

This removes the requirement of trying to sync prisma files through S3 and then running the migration on a separate lambda instance.

Test instructions | Instructions pour tester la modification

Hard to test locally because the github runner requires internet access and our local scratch accounts do not have an internet gateway and NAT configured by default. But I tested and it works. If we need to troubleshoot more in Staging we can.

Copy link
Copy Markdown
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!

@bryan-robitaille bryan-robitaille force-pushed the chore/code_build_migration branch from d38bb9d to f8d77c2 Compare January 2, 2026 13:10
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jan 2, 2026

⚠ Terrform update available

Terraform: 1.14.3 (using 1.12.2)
Terragrunt: 0.96.1 (using 0.83.0)

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jan 2, 2026

Staging: ecr

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

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

Plan: 0 to add, 0 to change, 2 to destroy
Show summary
CHANGE NAME
delete aws_ecr_lifecycle_policy.lambda["prisma-migration-lambda"]
aws_ecr_repository.lambda["prisma-migration-lambda"]
Show plan
Resource actions are indicated with the following symbols:
  - destroy

Terraform will perform the following actions:

  # aws_ecr_lifecycle_policy.lambda["prisma-migration-lambda"] will be destroyed
  # (because key ["prisma-migration-lambda"] is not in for_each map)
  - resource "aws_ecr_lifecycle_policy" "lambda" {
      - id          = "prisma-migration-lambda" -> null
      - policy      = jsonencode(
            {
              - rules = [
                  - {
                      - action       = {
                          - type = "expire"
                        }
                      - description  = "Keep last 10 images"
                      - rulePriority = 1
                      - selection    = {
                          - countNumber = 10
                          - countType   = "imageCountMoreThan"
                          - tagStatus   = "any"
                        }
                    },
                ]
            }
        ) -> null
      - region      = "ca-central-1" -> null
      - registry_id = "687401027353" -> null
      - repository  = "prisma-migration-lambda" -> null
    }

  # aws_ecr_repository.lambda["prisma-migration-lambda"] will be destroyed
  # (because key ["prisma-migration-lambda"] is not in for_each map)
  - resource "aws_ecr_repository" "lambda" {
      - arn                  = "arn:aws:ecr:ca-central-1:687401027353:repository/prisma-migration-lambda" -> null
      - force_delete         = false -> null
      - id                   = "prisma-migration-lambda" -> null
      - image_tag_mutability = "MUTABLE" -> null
      - name                 = "prisma-migration-lambda" -> null
      - region               = "ca-central-1" -> null
      - registry_id          = "687401027353" -> null
      - repository_url       = "687401027353.dkr.ecr.ca-central-1.amazonaws.com/prisma-migration-lambda" -> null
      - tags                 = {} -> null
      - tags_all             = {
          - "CostCentre" = "forms-platform-staging"
          - "Terraform"  = "true"
        } -> null

      - encryption_configuration {
          - encryption_type = "AES256" -> null
            # (1 unchanged attribute hidden)
        }

      - image_scanning_configuration {
          - scan_on_push = true -> null
        }
    }

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

Changes to Outputs:
  ~ ecr_repository_lambda_urls                     = {
      - prisma-migration-lambda         = "687401027353.dkr.ecr.ca-central-1.amazonaws.com/prisma-migration-lambda"
        # (16 unchanged attributes hidden)
    }

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

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.api"]
WARN - plan.json - main - Missing Common Tags: ["aws_ecr_repository.forms_app_legacy_repository"]
WARN - plan.json - main - Missing Common Tags: ["aws_ecr_repository.idp"]
WARN - plan.json - main - Missing Common Tags: ["aws_ecr_repository.lambda[\"api-end-to-end-test-lambda\"]"]
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[\"file-upload-cleanup-lambda\"]"]
WARN - plan.json - main - Missing Common Tags: ["aws_ecr_repository.lambda[\"file-upload-processor-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:...

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jan 2, 2026

Staging: oidc_roles

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

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

Plan: 0 to add, 0 to change, 3 to destroy
Show summary
CHANGE NAME
delete aws_iam_policy.forms_db_migration
aws_iam_role_policy_attachment.platform_forms_db_migration
module.github_workflow_roles.aws_iam_role.this["platform-forms-client-db-migration"]
Show plan
Resource actions are indicated with the following symbols:
  - destroy

Terraform will perform the following actions:

  # aws_iam_policy.forms_db_migration will be destroyed
  # (because aws_iam_policy.forms_db_migration is not in configuration)
  - resource "aws_iam_policy" "forms_db_migration" {
      - arn              = "arn:aws:iam::687401027353:policy/platform-forms-client-db-migration" -> null
      - attachment_count = 1 -> null
      - id               = "arn:aws:iam::687401027353:policy/platform-forms-client-db-migration" -> null
      - name             = "platform-forms-client-db-migration" -> null
      - path             = "/" -> null
      - policy           = jsonencode(
            {
              - Statement = [
                  - {
                      - Action   = [
                          - "s3:PutObjectTagging",
                          - "s3:PutObject",
                          - "s3:ListBucket",
                          - "s3:GetObjectTagging",
                          - "s3:GetObject",
                          - "s3:DeleteObject",
                        ]
                      - Effect   = "Allow"
                      - Resource = [
                          - "arn:aws:s3:::forms-staging-prisma-migration-storage/*",
                          - "arn:aws:s3:::forms-staging-prisma-migration-storage",
                        ]
                    },
                  - {
                      - Action   = [
                          - "lambda:InvokeFunction",
                          - "lambda:GetFunction",
                        ]
                      - Effect   = "Allow"
                      - Resource = "arn:aws:lambda:ca-central-1:687401027353:function:prisma-migration"
                    },
                ]
              - Version   = "2012-10-17"
            }
        ) -> null
      - policy_id        = "ANPA2ADCLI4MSSSVO2HQS" -> null
      - tags             = {} -> null
      - tags_all         = {
          - "CostCentre" = "forms-platform-staging"
          - "Terraform"  = "true"
        } -> null
        # (2 unchanged attributes hidden)
    }

  # aws_iam_role_policy_attachment.platform_forms_db_migration will be destroyed
  # (because aws_iam_role_policy_attachment.platform_forms_db_migration is not in configuration)
  - resource "aws_iam_role_policy_attachment" "platform_forms_db_migration" {
      - id         = "platform-forms-client-db-migration-20250401123804732500000001" -> null
      - policy_arn = "arn:aws:iam::687401027353:policy/platform-forms-client-db-migration" -> null
      - role       = "platform-forms-client-db-migration" -> null
    }

  # module.github_workflow_roles.aws_iam_role.this["platform-forms-client-db-migration"] will be destroyed
  # (because key ["platform-forms-client-db-migration"] is not in for_each map)
  - resource "aws_iam_role" "this" {
      - arn                   = "arn:aws:iam::687401027353:role/platform-forms-client-db-migration" -> null
      - assume_role_policy    = jsonencode(
            {
              - Statement = [
                  - {
                      - Action    = "sts:AssumeRoleWithWebIdentity"
                      - Condition = {
                          - StringLike = {
                              - "token.actions.githubusercontent.com:sub" = "repo:cds-snc/platform-forms-client:ref:refs/heads/main"
                            }
                        }
                      - Effect    = "Allow"
                      - Principal = {
                          - Federated = "arn:aws:iam::687401027353:oidc-provider/token.actions.githubusercontent.com"
                        }
                    },
                ]
              - Version   = "2012-10-17"
            }
        ) -> null
      - create_date           = "2025-04-01T12:38:04Z" -> null
      - force_detach_policies = false -> null
      - id                    = "platform-forms-client-db-migration" -> null
      - managed_policy_arns   = [
          - "arn:aws:iam::687401027353:policy/platform-forms-client-db-migration",
        ] -> null
      - max_session_duration  = 3600 -> null
      - name                  = "platform-forms-client-db-migration" -> null
      - path                  = "/" -> null
      - tags                  = {
          - "CostCentre" = "forms-platform-staging"
          - "Terraform"  = "true"
        } -> null
      - tags_all              = {
          - "CostCentre" = "forms-platform-staging"
          - "Terraform"  = "true"
        } -> null
      - unique_id             = "AROA2ADCLI4MTHNFHNSAE" -> null
        # (3 unchanged attributes hidden)
    }

Plan: 0 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 - Missing Common Tags: ["aws_iam_policy.platform_forms_client_pr_review_env[0]"]

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

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jan 2, 2026

Staging: s3

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

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

Plan: 0 to add, 0 to change, 4 to destroy
Show summary
CHANGE NAME
delete aws_s3_bucket.prisma_migration_storage
aws_s3_bucket_ownership_controls.prisma_migration_storage
aws_s3_bucket_public_access_block.prisma_migration_storage
aws_s3_bucket_server_side_encryption_configuration.prisma_migration_storage
Show plan
Resource actions are indicated with the following symbols:
  - destroy

Terraform will perform the following actions:

  # aws_s3_bucket.prisma_migration_storage will be destroyed
  # (because aws_s3_bucket.prisma_migration_storage is not in configuration)
  - resource "aws_s3_bucket" "prisma_migration_storage" {
      - arn                         = "arn:aws:s3:::forms-staging-prisma-migration-storage" -> null
      - bucket                      = "forms-staging-prisma-migration-storage" -> null
      - bucket_domain_name          = "forms-staging-prisma-migration-storage.s3.amazonaws.com" -> null
      - bucket_region               = "ca-central-1" -> null
      - bucket_regional_domain_name = "forms-staging-prisma-migration-storage.s3.ca-central-1.amazonaws.com" -> null
      - force_destroy               = false -> null
      - hosted_zone_id              = "Z1QDHH18159H29" -> null
      - id                          = "forms-staging-prisma-migration-storage" -> null
      - object_lock_enabled         = false -> null
      - region                      = "ca-central-1" -> null
      - request_payer               = "BucketOwner" -> null
      - tags                        = {} -> null
      - tags_all                    = {
          - "CostCentre" = "forms-platform-staging"
          - "Terraform"  = "true"
        } -> null
        # (3 unchanged attributes hidden)

      - grant {
          - id          = "8ee828b5522b38b6797b8f886ed0b30f039d4eaa7ea331fa60669a6e0352d7e5" -> null
          - permissions = [
              - "FULL_CONTROL",
            ] -> null
          - type        = "CanonicalUser" -> null
            # (1 unchanged attribute hidden)
        }

      - server_side_encryption_configuration {
          - rule {
              - bucket_key_enabled = false -> null

              - apply_server_side_encryption_by_default {
                  - sse_algorithm     = "AES256" -> null
                    # (1 unchanged attribute hidden)
                }
            }
        }

      - versioning {
          - enabled    = false -> null
          - mfa_delete = false -> null
        }
    }

  # aws_s3_bucket_ownership_controls.prisma_migration_storage will be destroyed
  # (because aws_s3_bucket_ownership_controls.prisma_migration_storage is not in configuration)
  - resource "aws_s3_bucket_ownership_controls" "prisma_migration_storage" {
      - bucket = "forms-staging-prisma-migration-storage" -> null
      - id     = "forms-staging-prisma-migration-storage" -> null
      - region = "ca-central-1" -> null

      - rule {
          - object_ownership = "BucketOwnerEnforced" -> null
        }
    }

  # aws_s3_bucket_public_access_block.prisma_migration_storage will be destroyed
  # (because aws_s3_bucket_public_access_block.prisma_migration_storage is not in configuration)
  - resource "aws_s3_bucket_public_access_block" "prisma_migration_storage" {
      - block_public_acls       = true -> null
      - block_public_policy     = true -> null
      - bucket                  = "forms-staging-prisma-migration-storage" -> null
      - id                      = "forms-staging-prisma-migration-storage" -> null
      - ignore_public_acls      = true -> null
      - region                  = "ca-central-1" -> null
      - restrict_public_buckets = true -> null
    }

  # aws_s3_bucket_server_side_encryption_configuration.prisma_migration_storage will be destroyed
  # (because aws_s3_bucket_server_side_encryption_configuration.prisma_migration_storage is not in configuration)
  - resource "aws_s3_bucket_server_side_encryption_configuration" "prisma_migration_storage" {
      - bucket                = "forms-staging-prisma-migration-storage" -> null
      - id                    = "forms-staging-prisma-migration-storage" -> null
      - region                = "ca-central-1" -> null
        # (1 unchanged attribute hidden)

      - rule {
          - bucket_key_enabled = false -> null

          - apply_server_side_encryption_by_default {
              - sse_algorithm     = "AES256" -> null
                # (1 unchanged attribute hidden)
            }
        }
    }

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

Changes to Outputs:
  - prisma_migration_storage_arn   = "arn:aws:s3:::forms-staging-prisma-migration-storage" -> null
  - prisma_migration_storage_id    = "forms-staging-prisma-migration-storage" -> null

Warning: Argument is deprecated

  with module.etl_bucket.aws_s3_bucket.this,
  on .terraform/modules/etl_bucket/S3/main.tf line 8, in resource "aws_s3_bucket" "this":
   8: resource "aws_s3_bucket" "this" {

lifecycle_rule is deprecated. Use the aws_s3_bucket_lifecycle_configuration
resource instead.

(and 11 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_s3_bucket.archive_storage"]
WARN - plan.json - main - Missing Common Tags: ["aws_s3_bucket.audit_logs_archive_storage"]
WARN - plan.json - main - Missing Common Tags: ["aws_s3_bucket.reliability_file_storage"]
WARN - plan.json - main - Missing Common Tags: ["aws_s3_bucket.vault_file_storage"]

23 tests, 19 passed, 4 warnings, 0 failures, 0 exceptions

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jan 2, 2026

Staging: network

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

Plan: 5 to add, 0 to change, 0 to destroy
Show summary
CHANGE NAME
add aws_security_group.code_build
aws_vpc_security_group_egress_rule.code_build_internet
aws_vpc_security_group_egress_rule.code_build_rds
aws_vpc_security_group_ingress_rule.code_build_private_link
aws_vpc_security_group_ingress_rule.code_build_rds
Show plan
Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # aws_security_group.code_build will be created
  + resource "aws_security_group" "code_build" {
      + arn                    = (known after apply)
      + description            = "Code Build"
      + egress                 = (known after apply)
      + id                     = (known after apply)
      + ingress                = (known after apply)
      + name                   = "code_build"
      + name_prefix            = (known after apply)
      + owner_id               = (known after apply)
      + region                 = "ca-central-1"
      + revoke_rules_on_delete = false
      + tags_all               = {
          + "CostCentre" = "forms-platform-staging"
          + "Terraform"  = "true"
        }
      + vpc_id                 = "vpc-0ad5b3739860129d0"
    }

  # aws_vpc_security_group_egress_rule.code_build_internet will be created
  + resource "aws_vpc_security_group_egress_rule" "code_build_internet" {
      + arn                    = (known after apply)
      + cidr_ipv4              = "0.0.0.0/0"
      + description            = "Egress to the internet from Code Build"
      + from_port              = 443
      + id                     = (known after apply)
      + ip_protocol            = "tcp"
      + region                 = "ca-central-1"
      + security_group_id      = (known after apply)
      + security_group_rule_id = (known after apply)
      + tags_all               = {
          + "CostCentre" = "forms-platform-staging"
          + "Terraform"  = "true"
        }
      + to_port                = 443
    }

  # aws_vpc_security_group_egress_rule.code_build_rds will be created
  + resource "aws_vpc_security_group_egress_rule" "code_build_rds" {
      + arn                          = (known after apply)
      + description                  = "Egress from Code Build to database"
      + from_port                    = 5432
      + id                           = (known after apply)
      + ip_protocol                  = "tcp"
      + referenced_security_group_id = "sg-0b80bb714d886b8ff"
      + region                       = "ca-central-1"
      + security_group_id            = (known after apply)
      + security_group_rule_id       = (known after apply)
      + tags_all                     = {
          + "CostCentre" = "forms-platform-staging"
          + "Terraform"  = "true"
        }
      + to_port                      = 5432
    }

  # aws_vpc_security_group_ingress_rule.code_build_private_link will be created
  + resource "aws_vpc_security_group_ingress_rule" "code_build_private_link" {
      + arn                          = (known after apply)
      + description                  = "Security group rule for Code build ingress"
      + from_port                    = 443
      + id                           = (known after apply)
      + ip_protocol                  = "tcp"
      + referenced_security_group_id = (known after apply)
      + region                       = "ca-central-1"
      + security_group_id            = "sg-089a83b7d81dff031"
      + security_group_rule_id       = (known after apply)
      + tags_all                     = {
          + "CostCentre" = "forms-platform-staging"
          + "Terraform"  = "true"
        }
      + to_port                      = 443
    }

  # aws_vpc_security_group_ingress_rule.code_build_rds will be created
  + resource "aws_vpc_security_group_ingress_rule" "code_build_rds" {
      + arn                          = (known after apply)
      + description                  = "Ingress to database from Code Buiild"
      + from_port                    = 5432
      + id                           = (known after apply)
      + ip_protocol                  = "tcp"
      + referenced_security_group_id = (known after apply)
      + region                       = "ca-central-1"
      + security_group_id            = "sg-0b80bb714d886b8ff"
      + security_group_rule_id       = (known after apply)
      + tags_all                     = {
          + "CostCentre" = "forms-platform-staging"
          + "Terraform"  = "true"
        }
      + to_port                      = 5432
    }

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

Changes to Outputs:
  + code_build_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.api_ecs"]
WARN - plan.json - main - Missing Common Tags: ["aws_security_group.api_end_to_end_test_lambda"]
WARN - plan.json - main - Missing Common Tags: ["aws_security_group.code_build"]
WARN - plan.json - main - Missing Common Tags: ["aws_security_group.connector_db"]
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.glue_job"]
WARN - plan.json - main -...

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jan 2, 2026

Staging: lambdas

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

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

Plan: 0 to add, 1 to change, 2 to destroy
Show summary
CHANGE NAME
delete aws_cloudwatch_log_group.prisma_migration_handler
aws_lambda_function.prisma_migration
update aws_iam_policy.lambda_s3
Show plan
Resource actions are indicated with the following symbols:
  ~ update in-place
  - destroy

Terraform will perform the following actions:

  # aws_cloudwatch_log_group.prisma_migration_handler will be destroyed
  # (because aws_cloudwatch_log_group.prisma_migration_handler is not in configuration)
  - resource "aws_cloudwatch_log_group" "prisma_migration_handler" {
      - arn               = "arn:aws:logs:ca-central-1:687401027353:log-group:/aws/lambda/Prisma_Migration_Handler" -> null
      - id                = "/aws/lambda/Prisma_Migration_Handler" -> null
      - kms_key_id        = "arn:aws:kms:ca-central-1:687401027353:key/c5c2a1c2-c092-4fa1-8daf-3414f3511b1d" -> null
      - log_group_class   = "STANDARD" -> null
      - name              = "/aws/lambda/Prisma_Migration_Handler" -> null
      - region            = "ca-central-1" -> null
      - retention_in_days = 731 -> null
      - skip_destroy      = false -> null
      - tags              = {} -> null
      - tags_all          = {
          - "CostCentre" = "forms-platform-staging"
          - "Terraform"  = "true"
        } -> null
        # (1 unchanged attribute hidden)
    }

  # aws_iam_policy.lambda_s3 will be updated in-place
  ~ resource "aws_iam_policy" "lambda_s3" {
        id               = "arn:aws:iam::687401027353:policy/lambda_s3"
        name             = "lambda_s3"
      ~ policy           = jsonencode(
          ~ {
              ~ Statement = [
                  ~ {
                      ~ Resource = [
                            # (3 unchanged elements hidden)
                            "arn:aws:s3:::forms-staging-reliability-file-storage",
                          - "arn:aws:s3:::forms-staging-prisma-migration-storage/*",
                          - "arn:aws:s3:::forms-staging-prisma-migration-storage",
                            "arn:aws:s3:::forms-staging-audit-logs-archive-storage/*",
                            # (3 unchanged elements hidden)
                        ]
                        # (2 unchanged attributes hidden)
                    },
                ]
                # (1 unchanged attribute hidden)
            }
        )
        tags             = {}
        # (7 unchanged attributes hidden)
    }

  # aws_lambda_function.prisma_migration will be destroyed
  # (because aws_lambda_function.prisma_migration is not in configuration)
  - resource "aws_lambda_function" "prisma_migration" {
      - architectures                  = [
          - "x86_64",
        ] -> null
      - arn                            = "arn:aws:lambda:ca-central-1:687401027353:function:prisma-migration" -> null
      - code_sha256                    = "11af3ff12fdae410a6740ade9e6fcbd8f1075291d1a6de4f414e17e396b91ade" -> null
      - function_name                  = "prisma-migration" -> null
      - id                             = "prisma-migration" -> null
      - image_uri                      = "687401027353.dkr.ecr.ca-central-1.amazonaws.com/prisma-migration-lambda:7d867ce4590741963b922abae8616b3c3a9160a6" -> null
      - invoke_arn                     = "arn:aws:apigateway:ca-central-1:lambda:path/2015-03-31/functions/arn:aws:lambda:ca-central-1:687401027353:function:prisma-migration/invocations" -> null
      - last_modified                  = "2025-11-03T16:14:58.000+0000" -> null
      - layers                         = [] -> null
      - memory_size                    = 512 -> null
      - package_type                   = "Image" -> null
      - publish                        = false -> null
      - qualified_arn                  = "arn:aws:lambda:ca-central-1:687401027353:function:prisma-migration:$LATEST" -> null
      - qualified_invoke_arn           = "arn:aws:apigateway:ca-central-1:lambda:path/2015-03-31/functions/arn:aws:lambda:ca-central-1:687401027353:function:prisma-migration:$LATEST/invocations" -> null
      - region                         = "ca-central-1" -> null
      - reserved_concurrent_executions = -1 -> null
      - role                           = "arn:aws:iam::687401027353:role/iam_for_lambda" -> null
      - skip_destroy                   = false -> null
      - source_code_size               = 0 -> null
      - tags                           = {} -> null
      - tags_all                       = {
          - "CostCentre" = "forms-platform-staging"
          - "Terraform"  = "true"
        } -> null
      - timeout                        = 300 -> null
      - version                        = "$LATEST" -> null
        # (8 unchanged attributes hidden)

      - environment {
          - variables = {
              - "DB_URL_SECRET_ARN"     = "arn:aws:secretsmanager:ca-central-1:687401027353:secret:server-database-url-0PSpE3"
              - "PRISMA_S3_BUCKET_NAME" = "forms-staging-prisma-migration-storage"
            } -> null
        }

      - ephemeral_storage {
          - size = 512 -> null
        }

      - logging_config {
          - log_format            = "Text" -> null
          - log_group             = "/aws/lambda/Prisma_Migration_Handler" -> null
            # (2 unchanged attributes hidden)
        }

      - tracing_config {
          - mode = "Active" -> null
        }

      - vpc_config {
          - ipv6_allowed_for_dual_stack = false -> null
          - security_group_ids          = [
              - "sg-06651d69cd4d3c50f",
            ] -> null
          - subnet_ids                  = [
              - "subnet-07e38df0760d389d1",
              - "subnet-07f9debd31e48ce64",
              - "subnet-0af8e6e3cf80f582d",
            ] -> null
          - vpc_id                      = "vpc-0ad5b3739860129d0" -> null
        }
    }

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

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

Saved the plan to: plan.tfplan

To perform exactly these actions, run the following command to apply:
    terraform apply "plan.tfplan"
Show Conftest results
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_event_rule.api_end_to_end_test_lambda_trigger"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_event_rule.audit_logs_archiver_lambda_trigger"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_event_rule.file_upload_cleanup_trigger"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_event_rule.form_archiver_lambda_trigger"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_event_rule.nagware_lambda_trigger"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_event_rule.reliability_dlq_lambda_trigger"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_event_rule.response_archiver_lambda_trigger"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_log_group.api_end_to_end_test"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_log_group.archive_form_templates"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_log_group.audit_logs"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_log_group.audit_logs_archiver"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_log_group.dead_letter_queue_consumer"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_log_group.file_upload"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_log_group.file_upload_cleanup"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_log_group.nagware"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_log_group.reliability"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_log_group.response_archiver"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_log_group.submission"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_log_group.vault_integrity"]
WARN - plan.json - main - Missing Common Tags: ["aws_iam_policy.lambda_dynamodb"]
WARN - plan.json - main - Missing Common Tags:...

@craigzour
Copy link
Copy Markdown
Contributor

@bryan-robitaille I believe this PR can now be closed?

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