Refactor storage solution
[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_resource_proxy  = {
35     cpu    = 200
36     memory = 128
37   }
38   minio_envs            = [ "MINIO_BROWSER=\"off\"" ]
39
40   # minio client
41   mc_job_name           = "prod-mc"
42   mc_container_image    = "minio/mc:RELEASE.2020-12-10T01-26-17Z"
43   mc_extra_commands     = [
44     "mc policy set public LOCALMINIO/logs.fd.io",
45     "mc policy set public LOCALMINIO/docs.fd.io",
46     "mc ilm add --expiry-days "180" LOCALMINIO/logs.fd.io",
47     "mc admin user add LOCALMINIO storage Storage1234",
48     "mc admin policy set LOCALMINIO writeonly user=storage"
49   ]
50   minio_buckets         = [ "logs.fd.io", "docs.fd.io" ]
51 }
52
53 module "nginx" {
54   source                = "./nginx"
55   providers             = {
56     nomad = nomad.yul1
57   }
58
59   # nomad
60   nomad_datacenters     = [ "yul1" ]
61
62   # nginx
63   nginx_job_name        = "prod-nginx"
64 }
65
66 #module "vpp_device" {
67 #  source = "./vpp_device"
68 #  providers = {
69 #    nomad = nomad.yul1
70 #  }
71 #}