-
Notifications
You must be signed in to change notification settings - Fork 7
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
fix: GC Notify API Key is not properly passed to Nagware and Reliability lambdas #553
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
⚠ Terrform update availableTerragrunt: 0.54.2 (using 0.53.8) |
Staging: secrets✅ Terraform Init: Plan: 1 to add, 0 to change, 1 to destroy Show summary
Show planResource actions are indicated with the following symbols:
-/+ destroy and then create replacement
Terraform will perform the following actions:
# aws_secretsmanager_secret_version.notify_callback_bearer_token must be replaced
-/+ resource "aws_secretsmanager_secret_version" "notify_callback_bearer_token" {
~ arn = "arn:aws:secretsmanager:ca-central-1:687401027353:secret:notify_callback_bearer_token-aXJPLs" -> (known after apply)
~ id = "arn:aws:secretsmanager:ca-central-1:687401027353:secret:notify_callback_bearer_token-aXJPLs|4A43D97C-2937-4E91-A924-ADF60955E459" -> (known after apply)
~ secret_string = (sensitive value) # forces replacement
~ version_id = "4A43D97C-2937-4E91-A924-ADF60955E459" -> (known after apply)
~ version_stages = [
- "AWSCURRENT",
] -> (known after apply)
# (1 unchanged attribute hidden)
}
Plan: 1 to add, 0 to change, 1 to destroy.
Changes to Outputs:
+ notify_api_key_secret_value = (sensitive value)
─────────────────────────────────────────────────────────────────────────────
Saved the plan to: plan.tfplan
To perform exactly these actions, run the following command to apply:
terraform apply "plan.tfplan"
Show Conftest results20 tests, 20 passed, 0 warnings, 0 failures, 0 exceptions
|
Staging: lambdas✅ Terraform Init: Plan: 0 to add, 4 to change, 0 to destroy Show summary
Show planResource actions are indicated with the following symbols:
~ update in-place
Terraform will perform the following actions:
# aws_iam_policy.lambda_secrets will be updated in-place
~ resource "aws_iam_policy" "lambda_secrets" {
id = "arn:aws:iam::687401027353:policy/lambda_secrets"
name = "lambda_secrets"
~ policy = jsonencode(
~ {
~ Statement = [
~ {
~ Resource = [
- "arn:aws:secretsmanager:ca-central-1:687401027353:secret:token_secret-n5Doyu",
- "arn:aws:secretsmanager:ca-central-1:687401027353:secret:notify_api_key-eR3nNp",
- "arn:aws:secretsmanager:ca-central-1:687401027353:secret:database-secret-vHJuTe",
] -> "arn:aws:secretsmanager:ca-central-1:687401027353:secret:database-secret-vHJuTe"
# (3 unchanged attributes hidden)
},
]
# (1 unchanged attribute hidden)
}
)
tags = {
"CostCentre" = "forms-platform-staging"
"Terraform" = "true"
}
# (5 unchanged attributes hidden)
}
# aws_lambda_function.nagware will be updated in-place
~ resource "aws_lambda_function" "nagware" {
id = "Nagware"
tags = {
"CostCentre" = "forms-platform-staging"
"Terraform" = "true"
}
# (22 unchanged attributes hidden)
~ environment {
~ variables = {
# Warning: this attribute value will be marked as sensitive and will not
# display in UI output after applying this change.
~ "NOTIFY_API_KEY" = (sensitive value)
# (10 unchanged elements hidden)
}
}
# (1 unchanged block hidden)
}
# aws_lambda_function.reliability will be updated in-place
~ resource "aws_lambda_function" "reliability" {
id = "Reliability"
tags = {
"CostCentre" = "forms-platform-staging"
"Terraform" = "true"
}
# (22 unchanged attributes hidden)
~ environment {
~ variables = {
# Warning: this attribute value will be marked as sensitive and will not
# display in UI output after applying this change.
~ "NOTIFY_API_KEY" = (sensitive value)
# (7 unchanged elements hidden)
}
}
# (1 unchanged block hidden)
}
# aws_lambda_function.vault_integrity will be updated in-place
~ resource "aws_lambda_function" "vault_integrity" {
id = "Vault_Data_Integrity_Check"
~ last_modified = "2023-12-11T15:10:23.000+0000" -> (known after apply)
~ source_code_hash = "9opCvMNrZA+BCLvHUGkHDweCXfVwLgP5jcHfkTPLySc=" -> "TowbMcppnki+0a5fq50Oral3CqleiwGw7U1igvFz0Ws="
tags = {
"CostCentre" = "forms-platform-staging"
"Terraform" = "true"
}
# (22 unchanged attributes hidden)
# (2 unchanged blocks hidden)
}
Plan: 0 to add, 4 to change, 0 to destroy.
─────────────────────────────────────────────────────────────────────────────
Saved the plan to: plan.tfplan
To perform exactly these actions, run the following command to apply:
terraform apply "plan.tfplan"
Show Conftest resultsWARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_event_rule.cron_2am_every_day"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_event_rule.cron_3am_every_day"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_event_rule.cron_4am_every_day"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_event_rule.cron_5am_every_business_day"]
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.dead_letter_queue_consumer"]
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_s3_bucket_object.audit_logs_code"]
WARN - plan.json - main - Missing Common Tags: ["aws_s3_bucket_object.form_archiver_code"]
WARN - plan.json - main - Missing Common Tags: ["aws_s3_bucket_object.nagware_code"]
WARN - plan.json - main - Missing Common Tags: ["aws_s3_bucket_object.reliability_code"]
WARN - plan.json - main - Missing Common Tags: ["aws_s3_bucket_object.reliability_dlq_consumer_code"]
WARN - plan.json - main - Missing Common Tags: ["aws_s3_bucket_object.response_archiver_code"]
WARN - plan.json - main - Missing Common Tags: ["aws_s3_bucket_object.submission_code"]
WARN - plan.json - main - Missing Common Tags: ["aws_s3_bucket_object.vault_integrity_code"]
WARN - plan.json - main - Missing Common Tags: ["aws_signer_signing_profile.lambda_signing_profile[0]"]
40 tests, 19 passed, 21 warnings, 0... |
patheard
reviewed
Dec 13, 2023
patheard
approved these changes
Dec 13, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary | Résumé
token_secret
from lambda module as it was not usedWhat happened:
With the new infra rework we did not take into account the fact that two of our lambdas were using the string value of the GC Notify API key secret. We converted it to an ARN value but the code does not know how to handle such value.
Note: We could definitely rework that at some point by adding an extra request to go get the secret value using the ARN.