Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/test_terraform_module.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.

name: Terraform modules tests

on:
workflow_dispatch:
pull_request:
paths:
- 'terraform/**'

jobs:
terraform-tests:
uses: canonical/operator-workflows/.github/workflows/terraform_modules_test.yaml@main
secrets: inherit
with:
k8s-controller: true
terraform-directories: '["terraform"]'
16 changes: 3 additions & 13 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
]
}
},
"ignorePaths": [],
"regexManagers": [
{
"fileMatch": ["(^|/)rockcraft.yaml$"],
Expand Down Expand Up @@ -53,10 +54,9 @@
},
{
"fileMatch": ["(^|/)main.tftest.hcl$"],
"matchStrings": ["# renovate: depName=\"(?<packageName>[^\"]+)\"\\s*\\n\\s*(?<fieldName>[a-zA-Z0-9_]+)\\s*=\\s*\"(?<currentValue>[^\"]+)\""],
"matchStrings": ["# renovate: depName=\"(?<packageName>[^\"]+)\"\\s*\\n\\s*(?<fieldName>[a-zA-Z0-9_]+)\\s*=\\s*(?<currentValue>\\d+)"],
"versioningTemplate": "semver-coerced",
"datasourceTemplate": "custom.charmhub",
"matchStringsStrategy": "recursive"
"datasourceTemplate": "custom.charmhub"
},
{
"fileMatch": ["(^|/)src/charm\\.py$"],
Expand All @@ -83,16 +83,6 @@
"enabled": true
},
{
"matchDatasources": ["terraform-provider"],
"matchPackageNames": ["juju/juju"],
"enabled": true
},
{
"matchPackageNames": ["boto3"],
"matchUpdateTypes": ["patch"],
"enabled": false
},
{
"matchDatasources": ["github-releases"],
"labels": ["workload-update"]
}
Expand Down
2 changes: 1 addition & 1 deletion terraform/.tflint.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
# See LICENSE file for licensing details.

rule "terraform_required_version" {
enabled = false
enabled = true
}
2 changes: 1 addition & 1 deletion terraform/modules/lego/.tflint.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
# See LICENSE file for licensing details.

rule "terraform_required_version" {
enabled = false
enabled = true
}
3 changes: 2 additions & 1 deletion terraform/modules/lego/terraform.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
# See LICENSE file for licensing details.

terraform {
required_version = "~> 1.12"
required_providers {
juju = {
source = "juju/juju"
version = ">= 0.22.0"
version = "~> 1.0"
}
}
}
2 changes: 1 addition & 1 deletion terraform/modules/maubot/.tflint.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
# See LICENSE file for licensing details.

rule "terraform_required_version" {
enabled = false
enabled = true
}
3 changes: 2 additions & 1 deletion terraform/modules/maubot/terraform.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
# See LICENSE file for licensing details.

terraform {
required_version = "~> 1.12"
required_providers {
juju = {
source = "juju/juju"
version = ">= 0.22.0"
version = "~> 1.0"
}
}
}
2 changes: 1 addition & 1 deletion terraform/modules/nginx-ingress-integrator/.tflint.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
# See LICENSE file for licensing details.

rule "terraform_required_version" {
enabled = false
enabled = true
}
3 changes: 2 additions & 1 deletion terraform/modules/nginx-ingress-integrator/terraform.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
# See LICENSE file for licensing details.

terraform {
required_version = "~> 1.12"
required_providers {
juju = {
source = "juju/juju"
version = ">= 0.22.0"
version = "~> 1.0"
}
}
}
2 changes: 1 addition & 1 deletion terraform/modules/postgresql-k8s/.tflint.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
# See LICENSE file for licensing details.

rule "terraform_required_version" {
enabled = false
enabled = true
}
43 changes: 43 additions & 0 deletions terraform/modules/postgresql-k8s/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
## Requirements

| Name | Version |
|------|---------|
| <a name="requirement_juju"></a> [juju](#requirement\_juju) | ~> 1.0 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_juju"></a> [juju](#provider\_juju) | ~> 1.0 |

## Modules

No modules.

## Resources

| Name | Type |
|------|------|
| [juju_application.postgresql_k8s](https://registry.terraform.io/providers/juju/juju/latest/docs/resources/application) | resource |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_app_name"></a> [app\_name](#input\_app\_name) | Name of the application in the Juju model. | `string` | `"postgresql-k8s"` | no |
| <a name="input_base"></a> [base](#input\_base) | Application base | `string` | `"ubuntu@22.04"` | no |
| <a name="input_channel"></a> [channel](#input\_channel) | Charm channel to use when deploying | `string` | `"14/stable"` | no |
| <a name="input_config"></a> [config](#input\_config) | Application configuration. Details at https://charmhub.io/postgresql-k8s/configurations | `map(string)` | `{}` | no |
| <a name="input_constraints"></a> [constraints](#input\_constraints) | Juju constraints to apply for this application. | `string` | `"arch=amd64"` | no |
| <a name="input_model_uuid"></a> [model\_uuid](#input\_model\_uuid) | Juju model name | `string` | n/a | yes |
| <a name="input_resources"></a> [resources](#input\_resources) | Resources to use with the application | `map(string)` | `{}` | no |
| <a name="input_revision"></a> [revision](#input\_revision) | Revision number to deploy charm | `number` | `null` | no |
| <a name="input_storage_size"></a> [storage\_size](#input\_storage\_size) | Storage size | `string` | `"10G"` | no |
| <a name="input_units"></a> [units](#input\_units) | Number of units to deploy | `number` | `1` | no |

## Outputs

| Name | Description |
|------|-------------|
| <a name="output_application_name"></a> [application\_name](#output\_application\_name) | Name of the deployed application. |
| <a name="output_provides"></a> [provides](#output\_provides) | n/a |
7 changes: 5 additions & 2 deletions terraform/modules/postgresql-k8s/terraform.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.

terraform {
required_version = ">= 1.6.6"
required_version = "~> 1.12"
required_providers {
juju = {
source = "juju/juju"
version = ">= 0.14.0"
version = "~> 1.0"
}
}
}
2 changes: 1 addition & 1 deletion terraform/modules/redis-k8s/.tflint.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
# See LICENSE file for licensing details.

rule "terraform_required_version" {
enabled = false
enabled = true
}
3 changes: 2 additions & 1 deletion terraform/modules/redis-k8s/terraform.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
# See LICENSE file for licensing details.

terraform {
required_version = "~> 1.12"
required_providers {
juju = {
source = "juju/juju"
version = ">= 0.22.0"
version = "~> 1.0"
}
}
}
2 changes: 1 addition & 1 deletion terraform/modules/s3-integrator/.tflint.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
# See LICENSE file for licensing details.

rule "terraform_required_version" {
enabled = false
enabled = true
}
3 changes: 2 additions & 1 deletion terraform/modules/s3-integrator/terraform.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
# See LICENSE file for licensing details.

terraform {
required_version = "~> 1.12"
required_providers {
juju = {
source = "juju/juju"
version = ">= 0.22.0"
version = "~> 1.0"
}
}
}
2 changes: 1 addition & 1 deletion terraform/modules/saml-integrator/.tflint.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
# See LICENSE file for licensing details.

rule "terraform_required_version" {
enabled = false
enabled = true
}
41 changes: 41 additions & 0 deletions terraform/modules/saml-integrator/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
## Requirements

| Name | Version |
|------|---------|
| <a name="requirement_juju"></a> [juju](#requirement\_juju) | ~> 1.0 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_juju"></a> [juju](#provider\_juju) | ~> 1.0 |

## Modules

No modules.

## Resources

| Name | Type |
|------|------|
| [juju_application.saml_integrator](https://registry.terraform.io/providers/juju/juju/latest/docs/resources/application) | resource |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_app_name"></a> [app\_name](#input\_app\_name) | Name of the application in the Juju model. | `string` | `"saml-integrator"` | no |
| <a name="input_base"></a> [base](#input\_base) | The operating system on which to deploy | `string` | `"ubuntu@22.04"` | no |
| <a name="input_channel"></a> [channel](#input\_channel) | The channel to use when deploying a charm. | `string` | `"4.9/edge"` | no |
| <a name="input_config"></a> [config](#input\_config) | Application config. Details about available options can be found at https://charmhub.io/saml-integrator/configurations. | `map(string)` | `{}` | no |
| <a name="input_constraints"></a> [constraints](#input\_constraints) | Juju constraints to apply for this application. | `string` | `""` | no |
| <a name="input_model_uuid"></a> [model\_uuid](#input\_model\_uuid) | Reference to a `juju_model`. | `string` | `""` | no |
| <a name="input_revision"></a> [revision](#input\_revision) | Revision number of the charm | `number` | `null` | no |
| <a name="input_units"></a> [units](#input\_units) | Number of units to deploy | `number` | `1` | no |

## Outputs

| Name | Description |
|------|-------------|
| <a name="output_app_name"></a> [app\_name](#output\_app\_name) | Name of the deployed application. |
| <a name="output_provides"></a> [provides](#output\_provides) | n/a |
3 changes: 2 additions & 1 deletion terraform/modules/saml-integrator/terraform.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
# See LICENSE file for licensing details.

terraform {
required_version = "~> 1.12"
required_providers {
juju = {
source = "juju/juju"
version = ">= 0.17.1"
version = "~> 1.0"
}
}
}
2 changes: 1 addition & 1 deletion terraform/modules/smtp-integrator/.tflint.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
# See LICENSE file for licensing details.

rule "terraform_required_version" {
enabled = false
enabled = true
}
3 changes: 2 additions & 1 deletion terraform/modules/smtp-integrator/terraform.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
# See LICENSE file for licensing details.

terraform {
required_version = "~> 1.12"
required_providers {
juju = {
source = "juju/juju"
version = ">= 0.22.0"
version = "~> 1.0"
}
}
}
2 changes: 1 addition & 1 deletion terraform/product/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ locals {
constraints = "root-disk-source=volume"
}

model = merge(local.model_defaults, var.model)
model = merge(local.model_defaults, var.model_uuid)

offer_urls_defaults = {}
offer_urls = merge(local.offer_urls_defaults, var.offer_urls)
Expand Down
4 changes: 2 additions & 2 deletions terraform/product/terraform.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
# See LICENSE file for licensing details.

terraform {
required_version = ">= 1.6.6"
required_version = "~> 1.12"
required_providers {
vault = {
source = "hashicorp/vault"
version = "~> 5.7.0"
}
juju = {
source = "juju/juju"
version = "~> 1.2.0"
version = "~> 1.0"
}
}
}
2 changes: 1 addition & 1 deletion terraform/product/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ variable "lego_secret" {
}
}

variable "model" {
variable "model_uuid" {
description = "Partial overrides for the model configuration."
type = map(string)
default = {}
Expand Down
3 changes: 2 additions & 1 deletion terraform/terraform.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
# See LICENSE file for licensing details.

terraform {
required_version = "~> 1.12"
required_providers {
juju = {
source = "juju/juju"
version = "1.2.0"
version = "~> 1.0"
}
}
}
2 changes: 1 addition & 1 deletion terraform/tests/.tflint.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
# See LICENSE file for licensing details.

rule "terraform_required_version" {
enabled = false
enabled = true
}
Loading
Loading