-
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: update Terragrunt mock values to fix TF plan #583
Conversation
Update the Terragrunt mock values so that the Production release can properly run `terraform plan`. Update the `load_balancer` module to only expect a single hosted zone. This is a temporary workaround while the `forms-formulaires.canada.ca` hosted zone still exists as a `hosted_zone` output and can be removed after the release. Update the deps.sh script to also remove the lambda function `/dist` folders.
⚠ Terrform update availableTerraform: 1.7.0 (using 1.6.6)
Terragrunt: 0.54.21 (using 0.54.8) |
Staging: app✅ Terraform Init: Plan: 1 to add, 1 to change, 0 to destroy Show summary
Show planResource actions are indicated with the following symbols:
+ create
~ update in-place
Terraform will perform the following actions:
# aws_appautoscaling_target.forms[0] will be updated in-place
~ resource "aws_appautoscaling_target" "forms" {
id = "service/arn:aws:ecs:ca-central-1:687401027353:cluster/Forms/form-viewer"
tags = {}
~ tags_all = {
+ "CostCentre" = "forms-platform-staging"
+ "Terraform" = "true"
}
# (6 unchanged attributes hidden)
}
# aws_ecs_task_definition.form_viewer will be created
+ resource "aws_ecs_task_definition" "form_viewer" {
+ arn = (known after apply)
+ arn_without_revision = (known after apply)
+ container_definitions = jsonencode(
[
+ {
+ environment = [
+ {
+ name = "AUDIT_LOG_QUEUE_URL"
+ value = "https://sqs.ca-central-1.amazonaws.com/687401027353/audit_log_queue"
},
+ {
+ name = "COGNITO_CLIENT_ID"
+ value = "17bsg3b2b7q5snon007rru264u"
},
+ {
+ name = "COGNITO_ENDPOINT_URL"
+ value = "cognito-idp.ca-central-1.amazonaws.com/ca-central-1_Cguq9JNQ1"
},
+ {
+ name = "EMAIL_ADDRESS_CONTACT_US"
+ value = "assistance+forms-formulaires@cds-snc.ca"
},
+ {
+ name = "EMAIL_ADDRESS_SUPPORT"
+ value = "assistance+forms-formulaires@cds-snc.ca"
},
+ {
+ name = "METRIC_PROVIDER"
+ value = "stdout"
},
+ {
+ name = "NEXTAUTH_URL"
+ value = "https://forms-staging.cdssandbox.xyz"
},
+ {
+ name = "RECAPTCHA_V3_SITE_KEY"
+ value = "6LfJDN4eAAAAAGvdRF7ZnQ7ciqdo1RQnQDFmh0VY"
},
+ {
+ name = "REDIS_URL"
+ value = "gcforms-redis-rep-group.uwpetx.ng.0001.cac1.cache.amazonaws.com"
},
+ {
+ name = "RELIABILITY_FILE_STORAGE"
+ value = "forms-staging-reliability-file-storage"
},
+ {
+ name = "REPROCESS_SUBMISSION_QUEUE_URL"
+ value = "https://sqs.ca-central-1.amazonaws.com/687401027353/reprocess_submission_queue.fifo"
},
+ {
+ name = "TEMPLATE_ID"
+ value = "8d597a1b-a1d6-4e3c-8421-042a2b4158b7"
},
+ {
+ name = "TEMPORARY_TOKEN_TEMPLATE_ID"
+ value = "b6885d06-d10a-422a-973f-05e274d9aa86"
},
+ {
+ name = "TRACER_PROVIDER"
+ value = "stdout"
},
+ {
+ name = "VAULT_FILE_STORAGE"
+ value = "forms-staging-vault-file-storage"
},
]
+ image = "687401027353.dkr.ecr.ca-central-1.amazonaws.com/form_viewer_staging"
+ linuxParameters = {
+ capabilities = {
+ drop = [
+ "ALL",
]
}
}
+ logConfiguration = {
+ logDriver = "awslogs"
+ options = {
+ awslogs-group = "Forms"
+ awslogs-region = "ca-central-1"
+ awslogs-stream-prefix = "ecs-form-viewer"
}
}
+ name = "form_viewer"
+ portMappings = [
+ {
+ containerPort = 3000
},
]
+ secrets = [
+ {
+ name = "NOTIFY_API_KEY"
+ valueFrom = "arn:aws:secretsmanager:ca-central-1:687401027353:secret:notify_api_key-eR3nNp"
},
+ {
+ name = "RECAPTCHA_V3_SECRET_KEY"
+ valueFrom = "arn:aws:secretsmanager:ca-central-1:687401027353:secret:recaptcha_secret-tTjsBo"
},
+ {
+ name = "DATABASE_URL"
+ valueFrom = "arn:aws:secretsmanager:ca-central-1:687401027353:secret:server-database-url-0PSpE3"
},
+ {
+ name = "TOKEN_SECRET"
+ valueFrom = "arn:aws:secretsmanager:ca-central-1:687401027353:secret:token_secret-n5Doyu"
},
+ {
+ name = "GC_NOTIFY_CALLBACK_BEARER_TOKEN"
+ valueFrom = "arn:aws:secretsmanager:ca-central-1:687401027353:secret:notify_callback_bearer_token-aXJPLs"
},
+ {
+ name = "FRESHDESK_API_KEY"
+ valueFrom = "arn:aws:secretsmanager:ca-central-1:687401027353:secret:freshdesk_api_key-JVyxop"
},
]
},
]
)
+ cpu = "2048"
+ execution_role_arn = "arn:aws:iam::687401027353:role/form-viewer"
+ family = "form-viewer"
+ id = (known after apply)
+ memory = "4096"
+ network_mode = "awsvpc"
+ requires_compatibilities = [
+ "FARGATE",
]
+ revision = (known after apply)
+ skip_destroy = false
+ tags_all = {
+ "CostCentre" = "forms-platform-staging"
+ "Terraform" = "true"
}
+ task_role_arn = "arn:aws:iam::687401027353:role/form-viewer"
}
Plan: 1 to add, 1 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_appautoscaling_target.forms[0]"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_log_group.forms"]
WARN - plan.json - main - Missing Common Tags: ["aws_codedeploy_app.app"]
WARN - plan.json - main - Missing Common Tags: ["aws_codedeploy_deployment_group.app"]
WARN - plan.json - main - Missing Common Tags: ["aws_ecs_cluster.forms"]
WARN - plan.json - main - Missing Common Tags: ["aws_ecs_service.form_viewer"]
WARN - plan.json - main - Missing Common Tags: ["aws_ecs_task_definition.form_viewer"]
WARN - plan.json - main - Missing Common Tags: ["aws_iam_policy.cognito"]
WARN - plan.json - main - Missing Common Tags: ["aws_iam_policy.forms_dynamodb"]
WARN - plan.json - main - Missing Common Tags: ["aws_iam_policy.forms_kms"]
WARN - plan.json - main - Missing Common Tags: ["aws_iam_policy.forms_s3"]
WARN - plan.json - main - Missing Common Tags: ["aws_iam_policy.forms_secrets_manager"]
WARN - plan.json - main - Missing Common Tags: ["aws_iam_policy.forms_sqs"]
WARN - plan.json - main - Missing Common Tags: ["aws_iam_role.codedeploy"]
WARN - plan.json - main - Missing Common Tags: ["aws_iam_role.forms"]
34 tests, 19 passed, 15 warnings, 0 failures, 0 exceptions
|
Staging: lambdas✅ Terraform Init: Plan: 0 to add, 1 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_lambda_function.vault_integrity will be updated in-place
~ resource "aws_lambda_function" "vault_integrity" {
id = "Vault_Data_Integrity_Check"
~ last_modified = "2024-01-12T19:25:55.000+0000" -> (known after apply)
~ source_code_hash = "PD5RmSEVjAYMZc1lvfSSn6O3RadR+J09hCPKVbQS/+g=" -> "TowbMcppnki+0a5fq50Oral3CqleiwGw7U1igvFz0Ws="
tags = {}
# (24 unchanged attributes hidden)
# (3 unchanged blocks hidden)
}
Plan: 0 to add, 1 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_iam_policy.lambda_dynamodb"]
WARN - plan.json - main - Missing Common Tags: ["aws_iam_policy.lambda_kms"]
WARN - plan.json - main - Missing Common Tags: ["aws_iam_policy.lambda_logging"]
WARN - plan.json - main - Missing Common Tags: ["aws_iam_policy.lambda_rds"]
WARN - plan.json - main - Missing Common Tags: ["aws_iam_policy.lambda_s3"]
WARN - plan.json - main - Missing Common Tags: ["aws_iam_policy.lambda_secrets"]
WARN - plan.json - main - Missing Common Tags: ["aws_iam_policy.lambda_sns"]
WARN - plan.json - main - Missing Common Tags: ["aws_iam_policy.lambda_sqs"]
WARN - plan.json - main - Missing Common Tags: ["aws_iam_role.lambda"]
WARN - plan.json - main - Missing Common Tags: ["aws_lambda_function.audit_logs"]
WARN - plan.json - main - Missing Common Tags: ["aws_lambda_function.form_archiver"]
WARN -... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll just need to remember to change the values back to generics after the release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM :)
Is there any reason why we would want to go back to "default values" (like |
The two sides of the argument I can see for specific vs. generic mock values are: Specific mock valuesWould allow for a Generic mock valuesDoes not tie |
Summary
Update the Terragrunt mock values so that the Production release can properly run
terraform plan
.Update the
load_balancer
module to only expect a single hosted zone. This is a temporary workaround while theforms-formulaires.canada.ca
hosted zone still exists as ahosted_zone
output and can be removed after the release.Update the deps.sh script to also remove the lambda function
/dist
folders.Remove the
import
blocks as these will be run using a script before theterraform apply
.Related