canonical / canonical/mongodb-operator

Allow charm source to be fetched directly from Git instead of local path

Open
#581 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
HCL
Stars
14
Forks
15
Avg merge
9h 44m
Merged PRs (30d)
17

Description

## Steps to reproduce

The current module implementation works perfectly — everything deploys as expected.
However, it would be great to have an option to reference the charm source directly from Git instead of using a local relative path.

This would simplify integration with tools like Terragrunt, making it easier to manage module dependencies and versions consistently across environments.

## Expected behavior

```
module "mongodb" {
source = "git::https://github.com/canonical/mongodb-operator.git//terraform/charm/replica_set?ref=6/edge"

channel = var.mongodb.channel
revision = var.mongodb.revision
base = var.mongodb.base

app_name = var.mongodb.app_name
units = var.mongodb.units
machines = var.mongodb.machines
config = merge(var.mongodb.config, { "role" : "replication" })
model = var.mongodb.model
constraints = var.mongodb.constraints
storage = var.mongodb.storage
endpoint_bindings = var.mongodb.endpoint_bindings
expose = var.mongodb.expose
}
```

## Actual behavior
```
module "mongodb" {
source = "../../charm/replica_set"

channel = var.mongodb.channel
revision = var.mongodb.revision
base = var.mongodb.base

app_name = var.mongodb.app_name
units = var.mongodb.units
machines = var.mongodb.machines
config = merge(var.mongodb.config, { "role" : "replication" })
model = var.mongodb.model
constraints = var.mongodb.constraints
storage = var.mongodb.storage
endpoint_bindings = var.mongodb.endpoint_bindings
expose = var.mongodb.expose
}
```

## Versions

Operating system: ubuntu 22.04

Juju CLI: 3.6.9

Juju agent: 3.6.9

Charm revision: 229

LXD: 5.21/stable

## Log output

Juju debug log:

## Additional context

Contributor guide

Open the contributing guide

Research direction

Start by inspecting the Terraform module under terraform/charm/replica_set and how its current local source is consumed. Reproduce the local-path example, then investigate support for the Git source and ref shown in the issue. Done means the module can be referenced from that Git URL while retaining the listed inputs and behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
terraform
Domain
infrastructure
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.