Terraform: Small fixup in storage templates
[csit.git] / terraform-ci-infra / 1n_nmd / main.tf
1 # For convenience in simple configurations, a child module automatically
2 # inherits default (un-aliased) provider configurations from its parent.
3 # This means that explicit provider blocks appear only in the root module,
4 # and downstream modules can simply declare resources for that provider
5 # and have them automatically associated with the root provider
6 # configurations.
7 module "minio" {
8   source                = "./minio"
9   providers             = {
10     nomad = nomad.yul1
11   }
12
13   # nomad
14   nomad_datacenters     = [ "yul1" ]
15   nomad_host_volume     = "prod-volume-data1-1"
16
17   # minio
18   minio_job_name        = "prod-minio"
19   minio_group_count     = 4
20   minio_service_name    = "storage"
21   minio_host            = "http://10.32.8.1{4...7}"
22   minio_port            = 9000
23   minio_container_image = "minio/minio:RELEASE.2020-12-03T05-49-24Z"
24   minio_vault_secret    = {
25     use_vault_provider        = false,
26     vault_kv_policy_name      = "kv-secret",
27     vault_kv_path             = "secret/data/minio",
28     vault_kv_field_access_key = "access_key",
29     vault_kv_field_secret_key = "secret_key"
30   }
31   minio_data_dir        = "/data/"
32   minio_use_host_volume = true
33   minio_use_canary      = true
34   minio_envs            = [ "MINIO_BROWSER=\"off\"" ]
35
36   # minio client
37   mc_job_name           = "prod-mc"
38   mc_container_image    = "minio/mc:RELEASE.2020-12-10T01-26-17Z"
39   mc_extra_commands     = [
40     "mc policy set public LOCALMINIO/logs.fd.io",
41     "mc policy set public LOCALMINIO/docs.fd.io",
42     "mc ilm add --expiry-days '180' LOCALMINIO/logs.fd.io",
43     "mc admin user add LOCALMINIO storage Storage1234",
44     "mc admin policy set LOCALMINIO writeonly user=storage"
45   ]
46   minio_buckets         = [ "logs.fd.io", "docs.fd.io" ]
47 }
48
49 module "nginx" {
50   source                = "./nginx"
51   providers             = {
52     nomad = nomad.yul1
53   }
54
55   # nomad
56   nomad_datacenters     = [ "yul1" ]
57
58   # nginx
59   nginx_job_name        = "prod-nginx"
60 }
61
62 #module "vpp_device" {
63 #  source = "./vpp_device"
64 #  providers = {
65 #    nomad = nomad.yul1
66 #  }
67 #}