Skip to content

Commit

Permalink
Merge pull request #378 from DFE-Digital/tf-gf-env-plugin
Browse files Browse the repository at this point in the history
Add plugins to load into Grafana at runtime
  • Loading branch information
albal authored Jan 18, 2024
2 parents 59ba188 + ee132c3 commit 2ec035e
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/load-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
TF_VAR_cpd_search_index_name: ${{secrets.TF_VAR_CPD_SEARCH_INDEX_NAME}}
TF_VAR_cpd_search_recreate_index_on_rebuild: ${{secrets.TF_VAR_CPD_SEARCH_RECREATE_INDEX_ON_REBUILD}}
TF_VAR_cpd_gf_password: ${{secrets.TF_CPD_GF_PASSWORD}}
TF_VAR_cpd_gf_plugins: ${{secrets.TF_VAR_CPD_GF_PLUGINS}}
TF_VAR_vcs_tag: ${{github.event.release.tag_name}}
TF_WORKSPACE: Load-Test
SITE_URL: https://20.107.65.156/
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/terraform-destroy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ jobs:
TF_VAR_cpd_search_index_name: ${{secrets.TF_VAR_CPD_SEARCH_INDEX_NAME}}
TF_VAR_cpd_search_recreate_index_on_rebuild: ${{secrets.TF_VAR_CPD_SEARCH_RECREATE_INDEX_ON_REBUILD}}
TF_VAR_cpd_gf_password: ${{secrets.TF_CPD_GF_PASSWORD}}
TF_VAR_cpd_gf_plugins: ${{secrets.TF_VAR_CPD_GF_PLUGINS}}
TF_VAR_vcs_tag: ${{github.event.release.tag_name}}
TF_WORKSPACE: ${{inputs.workspace}}

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/terraform-plan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ jobs:
TF_VAR_cpd_search_index_name: ${{secrets.TF_VAR_CPD_SEARCH_INDEX_NAME}}
TF_VAR_cpd_search_recreate_index_on_rebuild: ${{secrets.TF_VAR_CPD_SEARCH_RECREATE_INDEX_ON_REBUILD}}
TF_VAR_cpd_gf_password: ${{secrets.TF_CPD_GF_PASSWORD}}
TF_VAR_cpd_gf_plugins: ${{secrets.TF_VAR_CPD_GF_PLUGINS}}
TF_VAR_vcs_tag: ${{github.event.release.tag_name}}
TF_WORKSPACE: ${{inputs.workspace}}

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ jobs:
TF_VAR_cpd_search_index_name: ${{secrets.TF_VAR_CPD_SEARCH_INDEX_NAME}}
TF_VAR_cpd_search_recreate_index_on_rebuild: ${{secrets.TF_VAR_CPD_SEARCH_RECREATE_INDEX_ON_REBUILD}}
TF_VAR_cpd_gf_password: ${{secrets.TF_CPD_GF_PASSWORD}}
TF_VAR_cpd_gf_plugins: ${{secrets.TF_VAR_CPD_GF_PLUGINS}}
TF_VAR_vcs_tag: ${{github.event.release.tag_name}}
TF_WORKSPACE: ${{inputs.workspace}}

Expand Down
1 change: 1 addition & 0 deletions Terraform/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ No modules.
| <a name="input_cpd_delivery_key"></a> [cpd\_delivery\_key](#input\_cpd\_delivery\_key) | Contentful Delivery Key | `string` | n/a | yes |
| <a name="input_cpd_feature_polling_interval"></a> [cpd\_feature\_polling\_interval](#input\_cpd\_feature\_polling\_interval) | Feature polling interval | `number` | n/a | yes |
| <a name="input_cpd_gf_password"></a> [cpd\_gf\_password](#input\_cpd\_gf\_password) | Grafana password | `string` | n/a | yes |
| <a name="input_cpd_gf_plugins"></a> [cpd\_gf\_plugins](#input\_cpd\_gf\_plugins) | List of Grafana plugins to install | `string` | n/a | yes |
| <a name="input_cpd_googleanalyticstag"></a> [cpd\_googleanalyticstag](#input\_cpd\_googleanalyticstag) | Google Analytics Tag | `string` | n/a | yes |
| <a name="input_cpd_image_tag"></a> [cpd\_image\_tag](#input\_cpd\_image\_tag) | Docker image tag of application | `string` | n/a | yes |
| <a name="input_cpd_instrumentation_connectionstring"></a> [cpd\_instrumentation\_connectionstring](#input\_cpd\_instrumentation\_connectionstring) | The Azure ApplicationInsights connection string | `string` | n/a | yes |
Expand Down
1 change: 1 addition & 0 deletions Terraform/grafana.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ resource "azurerm_linux_web_app" "grafana-web-app" {
GF_SECURITY_CSRF_ADDITIONAL_HEADERS = "X-Forwarded-Host"
GF_SECURITY_CSRF_TRUSTED_ORIGINS = var.origins[terraform.workspace]
GF_SECURITY_ADMIN_PASSWORD = var.cpd_gf_password
GF_INSTALL_PLUGINS = var.cpd_gf_plugins
}

site_config {
Expand Down
5 changes: 5 additions & 0 deletions Terraform/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -836,6 +836,11 @@ variable "cpd_search_index_name" {
type = string
}

variable "cpd_gf_plugins" {
type = string
description = "List of Grafana plugins to install"
}

variable "cpd_search_recreate_index_on_rebuild" {
description = "Whether to delete the index and recreate before populating"
type = bool
Expand Down

0 comments on commit 2ec035e

Please sign in to comment.