Skip to content

feat: Add terraform product#137

Open
arturo-seijas wants to merge 2 commits intocanonical:mainfrom
arturo-seijas:add-tf-module
Open

feat: Add terraform product#137
arturo-seijas wants to merge 2 commits intocanonical:mainfrom
arturo-seijas:add-tf-module

Conversation

@arturo-seijas
Copy link

@arturo-seijas arturo-seijas commented Nov 13, 2025

Description

Add the TF product for the LEGO charm

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that validate the behaviour of the software
  • I validated that new and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@arturo-seijas arturo-seijas requested a review from a team as a code owner November 13, 2025 16:51
@arturo-seijas arturo-seijas changed the title Add terraform product feat: Add terraform product Nov 13, 2025
Copy link
Contributor

@shipperizer shipperizer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we merged yesterday a more "barebone" tf module

said that, i do believe this is a good example of how a deployment might look like so i m happy to pick it and move it to the examples folder and use it as a reference, would that work?see this as refrerence

Comment on lines +4 to +6
data "juju_model" "lego" {
name = var.model
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this tends to create problems when deployed in a bigger project, data sources get evaluated before resources so it might create a failure unless a specific depends_on clause is applied to the lego module

Comment on lines +8 to +13
resource "juju_secret" "lego_credentials" {
model = data.juju_model.lego.name
name = var.secret_name
value = var.secret_value
info = "LEGO plugin configuration credentials"
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

secret might be passed from the outside, so this is more part of how an opinionated module deployment should look like, i'm not sure we want this in

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Up to you. We are currently packing several charms in our modules, which is by definition opinionated

Comment on lines +31 to +37
resource "juju_access_secret" "lego_credentials_access" {
model = data.juju_model.lego.name
applications = [
juju_application.lego.name
]
secret_id = juju_secret.lego_credentials.secret_id
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see above comment on the secret

@arturo-seijas
Copy link
Author

we merged yesterday a more "barebone" tf module

said that, i do believe this is a good example of how a deployment might look like so i m happy to pick it and move it to the examples folder and use it as a reference, would that work?see this as refrerence

Feel free to close this PR is you think it's too opinionated for the module and leave this as an example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants