-
Notifications
You must be signed in to change notification settings - Fork 6
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
add new separate terraform plans for staging and production #309
Conversation
69ccb3a
to
6e0479f
Compare
88121cb
to
c3fd7d4
Compare
Production: rds❌ Terraform Format:
rds.tf
rds_proxy.tf
variables.tf Show planWarning: Interpolation-only expressions are deprecated
on rds_proxy.tf line 62, in module "rds_proxy":
62: "${local.db_user}" = {
Terraform 0.11 and earlier required all non-constant expressions to be
provided via interpolation syntax, but this pattern is now deprecated. To
silence this warning, remove the "${ sequence from the start and the }"
sequence from the end of this expression, leaving just the inner expression.
Template interpolation syntax is still used to construct strings from
expressions when the template includes multiple interpolation sequences or a
mixture of literal strings and interpolations. This deprecation applies only
to templates that consist entirely of a single interpolation sequence.
Error: No value for required variable
on variables.tf line 9:
9: variable "rds_server_db_user" {
The root module input variable "rds_server_db_user" is not set, and has no
default value. Use a -var or -var-file command line argument to provide a
value for this variable.
time=2021-10-29T17:21:00Z level=error msg=1 error occurred:
* exit status 1
|
variable "rds_server_db_user" { | ||
type = string | ||
} | ||
|
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.
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.
Thanks for cleaning it up.
Note that this is failing for production (but not staging) because the production |
7ce0241
to
33cc1be
Compare
huh maybe I shouldn't be running Note that |
- "aws/**" | ||
- "env/production/**" | ||
- "env/terragrunt.hcl" |
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.
To cut down on PR noise, it might make sense to set this to the same triggers as the merge_to_main_production.yml
paths:
https://github.com/cds-snc/notification-terraform/blob/main/.github/workflows/merge_to_main_production.yml#L8-L10
That way you only see Prod plan comments if you're expecting to have terraform apply
run against Prod when you merge.
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.
Looks really good Steve! Just had a minor comment for the production plan path
triggers, but it's a preference thing.
Based on your infra, I think it makes sense to run That being said, we have our own Notify Slack module without this behaviour that might do what you need: |
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.
(on Monday!)
Do we know why Terraform still complain about the Slack modules in his plans? |
The timestamp trigger is forcing that resource to get tainted. |
@CalvinRodo Seems like this is linked to the Slack aws notify module and has been addressed: I opened a PR to disable automatic overwriting of the Slack lambda: |
It's still complaining that it's... maybe not going to do anything? This might be as good as it gets unless we replace with SRE's slack integration code. |
Staging: common✅ Terraform Format: Plan: 3 to add, 0 to change, 3 to destroy Show planResource actions are indicated with the following symbols:
-/+ destroy and then create replacement
Terraform will perform the following actions:
# module.notify_slack_critical.module.lambda.null_resource.archive[0] must be replaced
-/+ resource "null_resource" "archive" {
~ id = "3986637290744123574" -> (known after apply)
~ triggers = { # forces replacement
~ "timestamp" = "1635790407125145000" -> "<WARNING: Missing lambda zip artifacts wouldn't be restored>"
# (1 unchanged element hidden)
}
}
# module.notify_slack_general.module.lambda.null_resource.archive[0] must be replaced
-/+ resource "null_resource" "archive" {
~ id = "4054771690764672551" -> (known after apply)
~ triggers = { # forces replacement
~ "timestamp" = "1635790404755724000" -> "<WARNING: Missing lambda zip artifacts wouldn't be restored>"
# (1 unchanged element hidden)
}
}
# module.notify_slack_warning.module.lambda.null_resource.archive[0] must be replaced
-/+ resource "null_resource" "archive" {
~ id = "2275826554682586410" -> (known after apply)
~ triggers = { # forces replacement
~ "timestamp" = "1635790407230048000" -> "<WARNING: Missing lambda zip artifacts wouldn't be restored>"
# (1 unchanged element hidden)
}
}
Plan: 3 to add, 0 to change, 3 to destroy.
------------------------------------------------------------------------
This plan was saved to: plan.tfplan
To perform exactly these actions, run the following command to apply:
terraform apply "plan.tfplan"
|
Summary | Résumé
Separate the terraform plan for staging and production. Use the new action for the plan to better surface results.
Note that changes to the terraform / terragrunt files were to fix formatting issues surfaced by
terraform fmt
(with the exception of the variable removed in
aws/rds/variables.tf
Test instructions | Instructions pour tester la modification
Help requested | Aide requise
Unresolved questions / Out of scope | Questions non résolues ou hors sujet
Reviewer checklist | Liste de vérification du réviseur
This is a suggested checklist of questions reviewers might ask during their
review | Voici une suggestion de liste de vérification comprenant des questions
que les réviseurs pourraient poser pendant leur examen :
langues officielles?
une baisse de la quantité de code couvert par les tests automatisés?
fonctionnalité existante?
que ça devrait être divisé en de plus petites demandes de tirage (« pull
requests ») afin de réduire le risque lié aux modifications?
modification de la politique de confidentialité?
préoccupations liées à la sécurité?
façon importante la performance?
risque d’utiliser des dépendances ajoutées?
setup, etc.) | Faudra-t-il mettre à jour la documentation à la suite de ce
changement (fichier README, etc.)?