aboutsummaryrefslogtreecommitdiffstats
path: root/fdio.infra.terraform/terraform-nomad-prometheus/fdio
diff options
context:
space:
mode:
authorPeter Mikus <pmikus@cisco.com>2022-03-31 15:59:10 +0200
committerPeter Mikus <pmikus@cisco.com>2022-04-01 10:54:23 +0000
commitca81b6ccfdcee62846217f824c1e4a1610b8a950 (patch)
treef0f836509b346cd59e9d10b5d67abe71cddb3264 /fdio.infra.terraform/terraform-nomad-prometheus/fdio
parente972e67afac3ab3eb785668d01d3bdf1833eade9 (diff)
refactor(terraform): Directory structure
Signed-off-by: Peter Mikus <pmikus@cisco.com> Change-Id: I2f3cdf0241aaf7c4a8ba4e00b701df10c9165cf8
Diffstat (limited to 'fdio.infra.terraform/terraform-nomad-prometheus/fdio')
-rw-r--r--fdio.infra.terraform/terraform-nomad-prometheus/fdio/main.tf10
-rw-r--r--fdio.infra.terraform/terraform-nomad-prometheus/fdio/providers.tf13
-rw-r--r--fdio.infra.terraform/terraform-nomad-prometheus/fdio/variables.tf47
-rw-r--r--fdio.infra.terraform/terraform-nomad-prometheus/fdio/versions.tf17
4 files changed, 87 insertions, 0 deletions
diff --git a/fdio.infra.terraform/terraform-nomad-prometheus/fdio/main.tf b/fdio.infra.terraform/terraform-nomad-prometheus/fdio/main.tf
new file mode 100644
index 0000000000..e0ca417a78
--- /dev/null
+++ b/fdio.infra.terraform/terraform-nomad-prometheus/fdio/main.tf
@@ -0,0 +1,10 @@
+module "prometheus" {
+ providers = {
+ nomad = nomad.yul1
+ }
+ source = "../"
+
+ # prometheus
+ datacenters = ["yul1"]
+ pm_version = "2.33.1"
+} \ No newline at end of file
diff --git a/fdio.infra.terraform/terraform-nomad-prometheus/fdio/providers.tf b/fdio.infra.terraform/terraform-nomad-prometheus/fdio/providers.tf
new file mode 100644
index 0000000000..42a6a45ce0
--- /dev/null
+++ b/fdio.infra.terraform/terraform-nomad-prometheus/fdio/providers.tf
@@ -0,0 +1,13 @@
+provider "nomad" {
+ address = var.nomad_provider_address
+ alias = "yul1"
+ # ca_file = var.nomad_provider_ca_file
+ # cert_file = var.nomad_provider_cert_file
+ # key_file = var.nomad_provider_key_file
+}
+
+provider "vault" {
+ address = var.vault_provider_address
+ skip_tls_verify = var.vault_provider_skip_tls_verify
+ token = var.vault_provider_token
+} \ No newline at end of file
diff --git a/fdio.infra.terraform/terraform-nomad-prometheus/fdio/variables.tf b/fdio.infra.terraform/terraform-nomad-prometheus/fdio/variables.tf
new file mode 100644
index 0000000000..7d5be09d21
--- /dev/null
+++ b/fdio.infra.terraform/terraform-nomad-prometheus/fdio/variables.tf
@@ -0,0 +1,47 @@
+variable "nomad_acl" {
+ description = "Nomad ACLs enabled/disabled."
+ type = bool
+ default = false
+}
+
+variable "nomad_provider_address" {
+ description = "FD.io Nomad cluster address."
+ type = string
+ default = "http://10.32.8.14:4646"
+}
+
+variable "nomad_provider_ca_file" {
+ description = "A local file path to a PEM-encoded certificate authority."
+ type = string
+ default = "/etc/nomad.d/ssl/nomad-ca.pem"
+}
+
+variable "nomad_provider_cert_file" {
+ description = "A local file path to a PEM-encoded certificate."
+ type = string
+ default = "/etc/nomad.d/ssl/nomad-cli.pem"
+}
+
+variable "nomad_provider_key_file" {
+ description = "A local file path to a PEM-encoded private key."
+ type = string
+ default = "/etc/nomad.d/ssl/nomad-cli-key.pem"
+}
+
+variable "vault_provider_address" {
+ description = "Vault cluster address."
+ type = string
+ default = "http://10.30.51.28:8200"
+}
+
+variable "vault_provider_skip_tls_verify" {
+ description = "Verification of the Vault server's TLS certificate."
+ type = bool
+ default = false
+}
+
+variable "vault_provider_token" {
+ description = "Vault root token."
+ type = string
+ sensitive = true
+} \ No newline at end of file
diff --git a/fdio.infra.terraform/terraform-nomad-prometheus/fdio/versions.tf b/fdio.infra.terraform/terraform-nomad-prometheus/fdio/versions.tf
new file mode 100644
index 0000000000..f83709d154
--- /dev/null
+++ b/fdio.infra.terraform/terraform-nomad-prometheus/fdio/versions.tf
@@ -0,0 +1,17 @@
+terraform {
+ backend "consul" {
+ address = "10.32.8.14:8500"
+ scheme = "http"
+ path = "terraform/prometheus"
+ }
+ required_providers {
+ nomad = {
+ source = "hashicorp/nomad"
+ version = ">= 1.4.16"
+ }
+ vault = {
+ version = ">= 3.2.1"
+ }
+ }
+ required_version = ">= 1.1.4"
+} \ No newline at end of file