Page MenuHomePhabricator

Refactor google_monitoring_notification_channel from monitoring module to root
Closed, ResolvedPublic


While I was working on uptime checks alert there was a need to use a notification channel similar to what we currently have in the monitoring module. We want to move this resource up in the root module so it can be used by multiple modules instead of creating one per module.

Event Timeline

So we think that a possible approach might be to use the terraform state mv command to relocate the resource out of the module.
In order to do this we need to remove the resource from the module's .tf file and place it in a .tf file in the root module.
Then, rather than running terraform apply we use the state mv (see:

Given the decision to keep track of, and "release" our modules using git we will need to do this in the following steps.

  1. create a PR that removes the resource and instead adds an input variable for the name of the resource
  2. one it is merged "release" that new version of the module
  3. create a PR for using the new module and adds the resource to the root module (and
  4. one it is merged go ahead *don't* run terraform apply but instead use the state mv command
Evelien_WMDE claimed this task.