-
Notifications
You must be signed in to change notification settings - Fork 0
[DPE-7796] Define Terraform modules #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
4cb793a
Define K8s terraform module
sinclert-canonical 2d314f6
Define K8s terraform tox command
sinclert-canonical 0bf3193
Define VM terraform module
sinclert-canonical 75779f8
Define VM terraform command
sinclert-canonical bec9868
Extend CI with terraform linting
sinclert-canonical cd4b376
Define Tox terraform path variable
sinclert-canonical 80b0664
Apply Carl suggestions
sinclert-canonical bc83fc8
Apply Paulo suggestions
sinclert-canonical b4ebcb9
Apply underscore convention to vars
sinclert-canonical File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,3 +8,6 @@ build/ | |
| .coverage | ||
| __pycache__/ | ||
| *.py[cod] | ||
|
|
||
| .terraform | ||
| .terraform.lock.hcl | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| resource "juju_application" "mysql_router" { | ||
| name = var.app_name | ||
| model = var.model_name | ||
|
|
||
| charm { | ||
| name = "mysql-router-k8s" | ||
| base = var.base | ||
| channel = var.channel | ||
| revision = var.revision | ||
| } | ||
|
|
||
| config = var.config | ||
| constraints = var.constraints | ||
| units = var.units | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| output "app_name" { | ||
| description = "Name of the MySQL Router K8s application" | ||
| value = juju_application.mysql_router.name | ||
| } | ||
|
|
||
| output "provides" { | ||
| description = "Map of all the provided endpoints" | ||
| value = { | ||
| database = "database" | ||
| grafana_dashboard = "grafana-dashboard" | ||
| metrics_endpoint = "metrics-endpoint" | ||
| } | ||
| } | ||
|
|
||
| output "requires" { | ||
| description = "Map of all the required endpoints" | ||
| value = { | ||
| backend_database = "backend-database" | ||
| certificates = "certificates" | ||
| logging = "logging" | ||
| tracing = "tracing" | ||
| } | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| variable "model_name" { | ||
| description = "Name of the juju model to deploy to" | ||
| type = string | ||
| } | ||
|
|
||
| variable "app_name" { | ||
| description = "Name of the juju application" | ||
| type = string | ||
| default = "mysql-router-k8s" | ||
| } | ||
|
|
||
| variable "base" { | ||
| description = "Application base" | ||
| type = string | ||
| default = "ubuntu@22.04" | ||
| } | ||
|
|
||
| variable "config" { | ||
| description = "Application configuration. Details at https://charmhub.io/mysql-router-k8s/configurations" | ||
| type = map(string) | ||
| default = {} | ||
| } | ||
|
|
||
| variable "constraints" { | ||
| description = "Juju constraints for the application" | ||
| type = string | ||
| default = "arch=amd64" | ||
| } | ||
|
|
||
| variable "channel" { | ||
| description = "Charm channel to deploy from" | ||
| type = string | ||
| default = "8.0/stable" | ||
| } | ||
|
|
||
| variable "revision" { | ||
| description = "Charm revision to deploy" | ||
| type = number | ||
| default = null | ||
| } | ||
|
|
||
| variable "units" { | ||
| description = "Number of units to deploy" | ||
| type = number | ||
| default = 1 | ||
| } | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| terraform { | ||
| required_version = ">= 1.6.6" | ||
|
|
||
| required_providers { | ||
| juju = { | ||
| source = "juju/juju" | ||
| version = ">= 0.20.0, < 1.0.0" | ||
| } | ||
| } | ||
| } |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,3 +9,6 @@ build/ | |
| coverage.xml | ||
| __pycache__/ | ||
| *.py[cod] | ||
|
|
||
| .terraform | ||
| .terraform.lock.hcl | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| resource "juju_application" "mysql_router" { | ||
| name = var.app_name | ||
| model = var.model_name | ||
|
|
||
| charm { | ||
| name = "mysql-router" | ||
| base = var.base | ||
| channel = var.channel | ||
| revision = var.revision | ||
| } | ||
|
|
||
| config = var.config | ||
| constraints = var.constraints | ||
| units = var.units | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| output "app_name" { | ||
| description = "Name of the MySQL Router VM application" | ||
| value = juju_application.mysql_router.name | ||
| } | ||
|
|
||
| output "provides" { | ||
| description = "Map of all the provided endpoints" | ||
| value = { | ||
| database = "database" | ||
| cos_agent = "cos-agent" | ||
| } | ||
| } | ||
|
|
||
| output "requires" { | ||
| description = "Map of all the required endpoints" | ||
| value = { | ||
| backend_database = "backend-database" | ||
| certificates = "certificates" | ||
| tracing = "tracing" | ||
| } | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| variable "model_name" { | ||
| description = "Name of the juju model to deploy to" | ||
| type = string | ||
| } | ||
|
|
||
| variable "app_name" { | ||
| description = "Name of the juju application" | ||
| type = string | ||
| default = "mysql-router" | ||
| } | ||
|
|
||
| variable "base" { | ||
| description = "Application base" | ||
| type = string | ||
| default = "ubuntu@22.04" | ||
| } | ||
|
|
||
| variable "config" { | ||
| description = "Application configuration. Details at https://charmhub.io/mysql-router/configurations" | ||
| type = map(string) | ||
| default = {} | ||
| } | ||
|
|
||
| variable "constraints" { | ||
| description = "Juju constraints for the application" | ||
| type = string | ||
| default = "arch=amd64" | ||
| } | ||
|
|
||
| variable "channel" { | ||
| description = "Charm channel to deploy from" | ||
| type = string | ||
| default = "dpe/candidate" | ||
| } | ||
|
|
||
| variable "revision" { | ||
| description = "Charm revision to deploy" | ||
| type = number | ||
| default = null | ||
| } | ||
|
|
||
| variable "units" { | ||
| description = "Number of units to deploy" | ||
| type = number | ||
| default = 1 | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| terraform { | ||
| required_version = ">= 1.6.6" | ||
|
|
||
| required_providers { | ||
| juju = { | ||
| source = "juju/juju" | ||
| version = ">= 0.20.0, < 1.0.0" | ||
| } | ||
| } | ||
| } |
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
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.
Uh oh!
There was an error while loading. Please reload this page.