diff options
author | Peter Mikus <pmikus@cisco.com> | 2022-03-31 15:59:10 +0200 |
---|---|---|
committer | Peter Mikus <pmikus@cisco.com> | 2022-04-01 10:54:23 +0000 |
commit | ca81b6ccfdcee62846217f824c1e4a1610b8a950 (patch) | |
tree | f0f836509b346cd59e9d10b5d67abe71cddb3264 /fdio.infra.terraform/terraform-nomad-pyspark-etl/main.tf | |
parent | e972e67afac3ab3eb785668d01d3bdf1833eade9 (diff) |
refactor(terraform): Directory structure
Signed-off-by: Peter Mikus <pmikus@cisco.com>
Change-Id: I2f3cdf0241aaf7c4a8ba4e00b701df10c9165cf8
Diffstat (limited to 'fdio.infra.terraform/terraform-nomad-pyspark-etl/main.tf')
-rw-r--r-- | fdio.infra.terraform/terraform-nomad-pyspark-etl/main.tf | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/fdio.infra.terraform/terraform-nomad-pyspark-etl/main.tf b/fdio.infra.terraform/terraform-nomad-pyspark-etl/main.tf new file mode 100644 index 0000000000..c477da81a8 --- /dev/null +++ b/fdio.infra.terraform/terraform-nomad-pyspark-etl/main.tf @@ -0,0 +1,33 @@ +locals { + datacenters = join(",", var.datacenters) + envs = join("\n", concat([], var.envs)) +} + +resource "nomad_job" "nomad_job_etl" { + jobspec = templatefile( + "${path.module}/conf/nomad/etl.hcl.tftpl", + { + aws_access_key_id = var.aws_access_key_id, + aws_secret_access_key = var.aws_secret_access_key, + aws_default_region = var.aws_default_region + cpu = var.cpu, + cron = var.cron, + datacenters = local.datacenters, + envs = local.envs, + image = var.image, + job_name = var.job_name, + memory = var.memory, + out_aws_access_key_id = var.out_aws_access_key_id, + out_aws_secret_access_key = var.out_aws_secret_access_key, + out_aws_default_region = var.out_aws_default_region + prohibit_overlap = var.prohibit_overlap, + time_zone = var.time_zone, + type = var.type, + use_vault_provider = var.vault_secret.use_vault_provider, + vault_kv_policy_name = var.vault_secret.vault_kv_policy_name, + vault_kv_path = var.vault_secret.vault_kv_path, + vault_kv_field_access_key = var.vault_secret.vault_kv_field_access_key, + vault_kv_field_secret_key = var.vault_secret.vault_kv_field_secret_key + }) + detach = false +} |