feat(terraform): conditional s3 integrator support - #76
Draft
MichaelThamm wants to merge 1 commit into
Draft
Conversation
MichaelThamm
changed the base branch from
feat/monolithic-support
to
test/monolithic-option
May 27, 2026 20:35
This file contains hidden or 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
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.
Issue
Solution
Summary
Two major changes to the Mimir Terraform module:
for_each-based module supporting dynamic roles including monolithic modeMotivation
mimir_backend,mimir_read,mimir_writewere identical modules differing only in the role config key. This made it impossible to deploy in monolithic mode (role-all) without a code change.Dynamic Workers
The three worker modules are replaced by a single
module.mimir_workerwithfor_eachovervar.workers:Each worker entry supports:
units,config,constraints,storage_directives,app_name(all optional with sensible defaults). The role config (role-backend = true, etc.) is injected automatically from the map key.Validations:
all,backend,read,writeallcannot coexist with other role keysAnti-affinity: The top-level
var.anti_affinitybool overrides per-workerconstraintswhen enabled, computing anti-affinity tags from the resolved app name.Optional S3 Integrator
When
var.s3_endpointisnull(the new default), no S3 resources are created:juju_secret.mimir_s3_credentials_secretjuju_access_secret.mimir_s3_secret_accessjuju_application.s3_integratorjuju_integration.coordinator_to_s3_integratorThe caller is responsible for integrating their chosen storage backend with the coordinator's
s3endpoint.Validation:
s3_endpoint,s3_access_key, ands3_secret_keymust all be set or all be null.Breaking Changes
var.backend_name/var.read_name/var.write_namevar.workers.<role>.app_namevar.backend_config/var.read_config/var.write_configvar.workers.<role>.configvar.backend_units/var.read_units/var.write_unitsvar.workers.<role>.unitsvar.backend_worker_storage_directives/ etc.var.workers.<role>.storage_directivesvar.worker_constraintsvar.workers.<role>.constraintsvar.s3_endpoint(required)var.s3_endpoint(optional, defaultnull)var.s3_access_key(required)var.s3_access_key(optional, defaultnull)var.s3_secret_key(required)var.s3_secret_key(optional, defaultnull)module.mimir_backendmodule.mimir_worker["backend"]juju_integration.coordinator_to_backendjuju_integration.coordinator_to_worker["backend"]State migration: Existing deployments will need to recreate worker and integration resources due to the
for_eachaddress change. S3 resources gain a[0]index.Unchanged
var.worker_resourcesandvar.worker_revision(shared across all workers)provides/requiresoutputss3_integrator_*customization variables (channel, name, config, etc.)Context
Testing Instructions
Upgrade Notes