Skip to content

test: add test env var to section mgr lambda to debug missing env var #286

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

Merged
merged 3 commits into from
Apr 7, 2025

Conversation

jpetto
Copy link
Contributor

@jpetto jpetto commented Apr 3, 2025

Goal

the pre-existing JWT_KEY env var (line 48 in the file changed) was never created in prod. hypothesis is the ignoreEnvironmentVars: ['GIT_SHA'] line is buggy, and preventing environment vars from getting deployed.

steps taken here (copied from jira):

submitted a PR with a new env var added (TEST: 'test'). infrastructure plan showed no changes to the lambda, and a deploy to dev did not add the TEST env var.

added a commit to the PR commenting out this line: ignoreEnvironmentVars: ['GIT_SHA']. this time, the infrastructure plan showed changes, including adding the TEST env var.

changed PR to only remove the ignoreEnvironmentVars directive and deployed to dev. even though the GIT_SHA was shown to be changed to null in the plan, it showed up in the lambda as the latest/correct commit hash. (this must be being pulled in elsewhere?)

References

JIRA ticket:

Copy link

github-actions bot commented Apr 3, 2025

Plan Result (section-manager-lambda-cdk-production)

CI link

Plan: 0 to add, 1 to change, 0 to destroy.
  • Update
    • aws_lambda_function.section-manager-sqs-lambda_D7365DAE
Change Result (Click me)
  # aws_lambda_function.section-manager-sqs-lambda_D7365DAE will be updated in-place
  ~ resource "aws_lambda_function" "section-manager-sqs-lambda_D7365DAE" {
        id                             = "SectionManagerLambda-Prod-SQS-Function"
      ~ qualified_arn                  = "arn:aws:lambda:us-east-1:996905175585:function:SectionManagerLambda-Prod-SQS-Function:16" -> (known after apply)
      ~ qualified_invoke_arn           = "arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:996905175585:function:SectionManagerLambda-Prod-SQS-Function:16/invocations" -> (known after apply)
        tags                           = {
            "app_code"       = "content"
            "component_code" = "content-sectionmanagerlambda"
            "env_code"       = "prod"
            "environment"    = "Prod"
            "service"        = "SectionManagerLambda"
        }
      ~ version                        = "16" -> (known after apply)
        # (20 unchanged attributes hidden)

      ~ environment {
          ~ variables = {
              - "GIT_SHA"     = "c949e709fa3114713051f0fff29c7a7b736f55c4" -> null
                # (5 unchanged elements hidden)
            }
        }

        # (4 unchanged blocks hidden)
    }

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

⚠️ Errors

@jpetto jpetto merged commit b0c7ba4 into main Apr 7, 2025
16 checks passed
@jpetto jpetto deleted the MC-1700-section-manager-lambda-env-var-debug branch April 7, 2025 14:37
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