-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add Terraform module * Update Github action * Update Terraform modules with correct names * Update README.md * Remove channel from terraform action * Update default Terraform channel * Update default Terraform channel * Add note about the model name in the tests
- Loading branch information
Showing
50 changed files
with
1,109 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
|
@@ -6,3 +6,5 @@ __pycache__/ | |
.idea | ||
.vscode | ||
venv | ||
.terraform* | ||
*.tfstate* |
This file contains 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,60 @@ | ||
# Terraform module for kfp-api | ||
|
||
This is a Terraform module facilitating the deployment of the kfp-api charm, using the [Terraform juju provider](https://github.com/juju/terraform-provider-juju/). For more information, refer to the provider [documentation](https://registry.terraform.io/providers/juju/juju/latest/docs). | ||
|
||
## Requirements | ||
This module requires a `juju` model to be available. Refer to the [usage section](#usage) below for more details. | ||
|
||
## API | ||
|
||
### Inputs | ||
The module offers the following configurable inputs: | ||
|
||
| Name | Type | Description | Required | | ||
| - | - | - | - | | ||
| `app_name`| string | Application name | False | | ||
| `channel`| string | Channel that the charm is deployed from | False | | ||
| `config`| map(string) | Map of the charm configuration options | False | | ||
| `model_name`| string | Name of the model that the charm is deployed on | True | | ||
| `resources`| map(string) | Map of the charm resources | False | | ||
| `revision`| number | Revision number of the charm name | False | | ||
|
||
### Outputs | ||
Upon applied, the module exports the following outputs: | ||
|
||
| Name | Description | | ||
| - | - | | ||
| `app_name`| Application name | | ||
| `provides`| Map of `provides` endpoints | | ||
| `requires`| Map of `reqruires` endpoints | | ||
|
||
## Usage | ||
|
||
This module is intended to be used as part of a higher-level module. When defining one, users should ensure that Terraform is aware of the `juju_model` dependency of the charm module. There are two options to do so when creating a high-level module: | ||
|
||
### Define a `juju_model` resource | ||
Define a `juju_model` resource and pass to the `model_name` input a reference to the `juju_model` resource's name. For example: | ||
|
||
``` | ||
resource "juju_model" "testing" { | ||
name = kubeflow | ||
} | ||
module "kfp-api" { | ||
source = "<path-to-this-directory>" | ||
model_name = juju_model.testing.name | ||
} | ||
``` | ||
|
||
### Define a `data` source | ||
Define a `data` source and pass to the `model_name` input a reference to the `data.juju_model` resource's name. This will enable Terraform to look for a `juju_model` resource with a name attribute equal to the one provided, and apply only if this is present. Otherwise, it will fail before applying anything. | ||
``` | ||
data "juju_model" "testing" { | ||
name = var.model_name | ||
} | ||
module "kfp-api" { | ||
source = "<path-to-this-directory>" | ||
model_name = data.juju_model.testing.name | ||
} | ||
``` |
This file contains 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,13 @@ | ||
resource "juju_application" "kfp_api" { | ||
charm { | ||
name = "kfp-api" | ||
channel = var.channel | ||
revision = var.revision | ||
} | ||
config = var.config | ||
model = var.model_name | ||
name = var.app_name | ||
resources = var.resources | ||
trust = true | ||
units = 1 | ||
} |
This file contains 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" { | ||
value = juju_application.kfp_api.name | ||
} | ||
|
||
output "provides" { | ||
value = { | ||
kfp_api = "kfp-api", | ||
metrics_endpoint = "metrics-endpoint", | ||
grafana_dashboard = "grafana-dashboard", | ||
} | ||
} | ||
|
||
output "requires" { | ||
value = { | ||
mysql = "mysql", | ||
relational_db = "relational-db", | ||
object_storage = "object-storage", | ||
kfp_viz = "kfp-viz", | ||
logging = "logging", | ||
} | ||
} |
This file contains 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,34 @@ | ||
variable "app_name" { | ||
description = "Application name" | ||
type = string | ||
default = "kfp-api" | ||
} | ||
|
||
variable "channel" { | ||
description = "Charm channel" | ||
type = string | ||
default = null | ||
} | ||
|
||
variable "config" { | ||
description = "Map of charm configuration options" | ||
type = map(string) | ||
default = {} | ||
} | ||
|
||
variable "model_name" { | ||
description = "Model name" | ||
type = string | ||
} | ||
|
||
variable "resources" { | ||
description = "Map of resources" | ||
type = map(string) | ||
default = null | ||
} | ||
|
||
variable "revision" { | ||
description = "Charm revision" | ||
type = number | ||
default = null | ||
} |
This file contains 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,9 @@ | ||
terraform { | ||
required_version = ">= 1.6" | ||
required_providers { | ||
juju = { | ||
source = "juju/juju" | ||
version = "~> 0.14.0" | ||
} | ||
} | ||
} |
This file contains 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 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,57 @@ | ||
# Terraform module for kfp-metadata-writer | ||
|
||
This is a Terraform module facilitating the deployment of the kfp-metadata-writer charm, using the [Terraform juju provider](https://github.com/juju/terraform-provider-juju/). For more information, refer to the provider [documentation](https://registry.terraform.io/providers/juju/juju/latest/docs). | ||
|
||
## API | ||
|
||
### Inputs | ||
The module offers the following configurable inputs: | ||
|
||
| Name | Type | Description | Required | | ||
| - | - | - | - | | ||
| `app_name`| string | Application name | False | | ||
| `channel`| string | Channel that the charm is deployed from | False | | ||
| `config`| map(string) | Map of the charm configuration options | False | | ||
| `model_name`| string | Name of the model that the charm is deployed on | True | | ||
| `resources`| map(string) | Map of the charm resources | False | | ||
| `revision`| number | Revision number of the charm name | False | | ||
|
||
### Outputs | ||
Upon applied, the module exports the following outputs: | ||
|
||
| Name | Description | | ||
| - | - | | ||
| `app_name`| Application name | | ||
| `provides`| Map of `provides` endpoints | | ||
| `requires`| Map of `reqruires` endpoints | | ||
|
||
## Usage | ||
|
||
This module is intended to be used as part of a higher-level module. When defining one, users should ensure that Terraform is aware of the `juju_model` dependency of the charm module. There are two options to do so when creating a high-level module: | ||
|
||
### Define a `juju_model` resource | ||
Define a `juju_model` resource and pass to the `model_name` input a reference to the `juju_model` resource's name. For example: | ||
|
||
``` | ||
resource "juju_model" "testing" { | ||
name = kubeflow | ||
} | ||
module "kfp-metadata-writer" { | ||
source = "<path-to-this-directory>" | ||
model_name = juju_model.testing.name | ||
} | ||
``` | ||
|
||
### Define a `data` source | ||
Define a `data` source and pass to the `model_name` input a reference to the `data.juju_model` resource's name. This will enable Terraform to look for a `juju_model` resource with a name attribute equal to the one provided, and apply only if this is present. Otherwise, it will fail before applying anything. | ||
``` | ||
data "juju_model" "testing" { | ||
name = var.model_name | ||
} | ||
module "kfp-metadata-writer" { | ||
source = "<path-to-this-directory>" | ||
model_name = data.juju_model.testing.name | ||
} | ||
``` |
This file contains 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,13 @@ | ||
resource "juju_application" "kfp_metadata_writer" { | ||
charm { | ||
name = "kfp-metadata-writer" | ||
channel = var.channel | ||
revision = var.revision | ||
} | ||
config = var.config | ||
model = var.model_name | ||
name = var.app_name | ||
resources = var.resources | ||
trust = true | ||
units = 1 | ||
} |
This file contains 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,14 @@ | ||
output "app_name" { | ||
value = juju_application.kfp_metadata_writer.name | ||
} | ||
|
||
output "provides" { | ||
value = {} | ||
} | ||
|
||
output "requires" { | ||
value = { | ||
grpc = "grpc", | ||
logging = "logging" | ||
} | ||
} |
This file contains 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,34 @@ | ||
variable "app_name" { | ||
description = "Application name" | ||
type = string | ||
default = "kfp-metadata-writer" | ||
} | ||
|
||
variable "channel" { | ||
description = "Charm channel" | ||
type = string | ||
default = null | ||
} | ||
|
||
variable "config" { | ||
description = "Map of charm configuration options" | ||
type = map(string) | ||
default = {} | ||
} | ||
|
||
variable "model_name" { | ||
description = "Model name" | ||
type = string | ||
} | ||
|
||
variable "resources" { | ||
description = "Map of resources" | ||
type = map(string) | ||
default = null | ||
} | ||
|
||
variable "revision" { | ||
description = "Charm revision" | ||
type = number | ||
default = null | ||
} |
This file contains 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,9 @@ | ||
terraform { | ||
required_version = ">= 1.6" | ||
required_providers { | ||
juju = { | ||
source = "juju/juju" | ||
version = "~> 0.14.0" | ||
} | ||
} | ||
} |
This file contains 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 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,57 @@ | ||
# Terraform module for kfp-persistence | ||
|
||
This is a Terraform module facilitating the deployment of the kfp-persistence charm, using the [Terraform juju provider](https://github.com/juju/terraform-provider-juju/). For more information, refer to the provider [documentation](https://registry.terraform.io/providers/juju/juju/latest/docs). | ||
|
||
## API | ||
|
||
### Inputs | ||
The module offers the following configurable inputs: | ||
|
||
| Name | Type | Description | Required | | ||
| - | - | - | - | | ||
| `app_name`| string | Application name | False | | ||
| `channel`| string | Channel that the charm is deployed from | False | | ||
| `config`| map(string) | Map of the charm configuration options | False | | ||
| `model_name`| string | Name of the model that the charm is deployed on | True | | ||
| `resources`| map(string) | Map of the charm resources | False | | ||
| `revision`| number | Revision number of the charm name | False | | ||
|
||
### Outputs | ||
Upon applied, the module exports the following outputs: | ||
|
||
| Name | Description | | ||
| - | - | | ||
| `app_name`| Application name | | ||
| `provides`| Map of `provides` endpoints | | ||
| `requires`| Map of `reqruires` endpoints | | ||
|
||
## Usage | ||
|
||
This module is intended to be used as part of a higher-level module. When defining one, users should ensure that Terraform is aware of the `juju_model` dependency of the charm module. There are two options to do so when creating a high-level module: | ||
|
||
### Define a `juju_model` resource | ||
Define a `juju_model` resource and pass to the `model_name` input a reference to the `juju_model` resource's name. For example: | ||
|
||
``` | ||
resource "juju_model" "testing" { | ||
name = kubeflow | ||
} | ||
module "kfp-persistence" { | ||
source = "<path-to-this-directory>" | ||
model_name = juju_model.testing.name | ||
} | ||
``` | ||
|
||
### Define a `data` source | ||
Define a `data` source and pass to the `model_name` input a reference to the `data.juju_model` resource's name. This will enable Terraform to look for a `juju_model` resource with a name attribute equal to the one provided, and apply only if this is present. Otherwise, it will fail before applying anything. | ||
``` | ||
data "juju_model" "testing" { | ||
name = var.model_name | ||
} | ||
module "kfp-persistence" { | ||
source = "<path-to-this-directory>" | ||
model_name = data.juju_model.testing.name | ||
} | ||
``` |
Oops, something went wrong.