Skip to content

chore: remove unused load testing lambda env variables #1061

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

craigzour
Copy link
Contributor

@craigzour craigzour commented Jul 9, 2025

Summary | Résumé

  • Removes unused load testing lambda env variables

Note: once merged we can remove STAGING_LOAD_TESTING_FORM_ID and STAGING_LOAD_TESTING_FORM_PRIVATE_KEY from our Github secrets

@craigzour craigzour self-assigned this Jul 9, 2025
@craigzour craigzour force-pushed the chore/remove-unused-load-testing-lambda-env-variables branch from 3772918 to 49abf36 Compare July 9, 2025 13:05
Copy link

github-actions bot commented Jul 9, 2025

⚠ Terrform update available

Terraform: 1.12.2 (using 1.11.2)
Terragrunt: 0.83.0 (using 0.75.10)

Copy link

github-actions bot commented Jul 9, 2025

Staging: load_testing

✅   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, 2 to change, 3 to destroy
Show summary
CHANGE NAME
delete aws_ssm_parameter.load_testing_form_id
aws_ssm_parameter.load_testing_form_private_key
aws_ssm_parameter.load_testing_submit_form_server_action_id_key
update aws_iam_policy.load_test_lambda
aws_lambda_function.load_testing
Show plan
Resource actions are indicated with the following symbols:
  ~ update in-place
  - destroy

Terraform will perform the following actions:

  # aws_iam_policy.load_test_lambda will be updated in-place
  ~ resource "aws_iam_policy" "load_test_lambda" {
        id               = "arn:aws:iam::687401027353:policy/LoadTestLambda"
        name             = "LoadTestLambda"
      ~ policy           = jsonencode(
          ~ {
              ~ Statement = [
                  ~ {
                      ~ Resource = [
                          - "arn:aws:ssm:ca-central-1:687401027353:parameter/load-testing/zitadel-app-private-key",
                          - "arn:aws:ssm:ca-central-1:687401027353:parameter/load-testing/submit-form-server-action-id",
                          - "arn:aws:ssm:ca-central-1:687401027353:parameter/load-testing/form-private-key",
                          - "arn:aws:ssm:ca-central-1:687401027353:parameter/load-testing/form-id",
                        ] -> "arn:aws:ssm:ca-central-1:687401027353:parameter/load-testing/zitadel-app-private-key"
                        # (3 unchanged attributes hidden)
                    },
                    {
                        Action   = "lambda:InvokeFunction"
                        Effect   = "Allow"
                        Resource = "arn:aws:lambda:ca-central-1:687401027353:function:Submission"
                        Sid      = "InvokeSubmissionLambda"
                    },
                ]
                # (1 unchanged attribute hidden)
            }
        )
        tags             = {}
        # (7 unchanged attributes hidden)
    }

  # aws_lambda_function.load_testing will be updated in-place
  ~ resource "aws_lambda_function" "load_testing" {
        id                             = "load-testing"
        tags                           = {}
        # (28 unchanged attributes hidden)

      - environment {
          - variables = {
              - "LOCUST_HOST"       = "https://forms-staging.cdssandbox.xyz"
              - "LOCUST_LOCUSTFILE" = "./tests/locust_test_file.py"
              - "LOCUST_NUM_USERS"  = "1"
              - "LOCUST_RUN_TIME"   = "3m"
              - "LOCUST_SPAWN_RATE" = "1"
            } -> null
        }

        # (3 unchanged blocks hidden)
    }

  # aws_ssm_parameter.load_testing_form_id will be destroyed
  # (because aws_ssm_parameter.load_testing_form_id is not in configuration)
  - resource "aws_ssm_parameter" "load_testing_form_id" {
      - arn             = "arn:aws:ssm:ca-central-1:687401027353:parameter/load-testing/form-id" -> null
      - data_type       = "text" -> null
      - description     = "Form ID that will be used to generate, retrieve and confirm responses." -> null
      - id              = "/load-testing/form-id" -> null
      - key_id          = "alias/aws/ssm" -> null
      - name            = "/load-testing/form-id" -> null
      - tags            = {} -> null
      - tags_all        = {
          - "CostCentre" = "forms-platform-staging"
          - "Terraform"  = "true"
        } -> null
      - tier            = "Standard" -> null
      - type            = "SecureString" -> null
      - value           = (sensitive value) -> null
      - version         = 11 -> null
        # (1 unchanged attribute hidden)
    }

  # aws_ssm_parameter.load_testing_form_private_key will be destroyed
  # (because aws_ssm_parameter.load_testing_form_private_key is not in configuration)
  - resource "aws_ssm_parameter" "load_testing_form_private_key" {
      - arn             = "arn:aws:ssm:ca-central-1:687401027353:parameter/load-testing/form-private-key" -> null
      - data_type       = "text" -> null
      - description     = "Private key JSON of the form that will be used to authenticate the API requests.  This must be a key for the `/load-testing/form-id` form." -> null
      - id              = "/load-testing/form-private-key" -> null
      - key_id          = "alias/aws/ssm" -> null
      - name            = "/load-testing/form-private-key" -> null
      - tags            = {} -> null
      - tags_all        = {
          - "CostCentre" = "forms-platform-staging"
          - "Terraform"  = "true"
        } -> null
      - tier            = "Standard" -> null
      - type            = "SecureString" -> null
      - value           = (sensitive value) -> null
      - version         = 14 -> null
        # (1 unchanged attribute hidden)
    }

  # aws_ssm_parameter.load_testing_submit_form_server_action_id_key will be destroyed
  # (because aws_ssm_parameter.load_testing_submit_form_server_action_id_key is not in configuration)
  - resource "aws_ssm_parameter" "load_testing_submit_form_server_action_id_key" {
      - arn             = "arn:aws:ssm:ca-central-1:687401027353:parameter/load-testing/submit-form-server-action-id" -> null
      - data_type       = "text" -> null
      - description     = "NextJS server action identifier associated to 'submitForm' function." -> null
      - id              = "/load-testing/submit-form-server-action-id" -> null
      - key_id          = "alias/aws/ssm" -> null
      - name            = "/load-testing/submit-form-server-action-id" -> null
      - tags            = {} -> null
      - tags_all        = {
          - "CostCentre" = "forms-platform-staging"
          - "Terraform"  = "true"
        } -> null
      - tier            = "Standard" -> null
      - type            = "SecureString" -> null
      - value           = (sensitive value) -> null
      - version         = 14 -> null
        # (1 unchanged attribute hidden)
    }

Plan: 0 to add, 2 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.load_test_lambda"]
WARN - plan.json - main - Missing Common Tags: ["aws_iam_role.load_test_lambda"]
WARN - plan.json - main - Missing Common Tags: ["aws_lambda_function.load_testing"]
WARN - plan.json - main - Missing Common Tags: ["aws_ssm_parameter.load_testing_zitadel_app_private_key"]

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

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.

1 participant