Allow labels on a Module to dynamically attach the correct Context based on Space

Take the following scenario:

  • A custom Terraform Module is located in the root Space called alerting-rules. This module interacts with Pagerduty and configures alerting rules. The Module has the label pagerduty assigned to it.

  • We have different Pagerduty credentials per environment

  • We have two Spaces below root called prod and staging which represent our two environments.

  • In each Space, there is a Context called “Pagerduty” with a label autoattach:pagerduty. Each Context defines a PAGERDUTY_TOKEN variable with different values in each environment.

Ideally, I’d like for any Stack which consumes the alerting-rules Module within the prod Space to automatically receive a Context attchment for the “Pagerduty” Context within its Space (and the same for any Stack in the staging Space).

This would remove the need to explicitly attach Contexts directly to Modules and would instead allow different Contexts with the correct labels to be dynamically attached based on the Space in which they’re running.

Workaround
Sort of. Each Stack which consumes the `alerting-rules` Module could itself have a `pagerduty` label attached, or the Space it belongs in could have the `pagerduty` labels attached, but this means the Module consumer needs to be aware of which Contexts the Module requires.
Problem
-

Please authenticate to join the conversation.

Upvoters
Status

❌ Rejected

Board

💡 Feature Requests

Tags

Contexts

Date

7 months ago

Subscribe to post

Get notified by email when there are changes.