20482: Extracts DNS aliases map as configurable variables. 20482-terraform-private-only-infra
authorLucas Di Pentima <lucas.dipentima@curii.com>
Wed, 10 May 2023 20:05:55 +0000 (17:05 -0300)
committerLucas Di Pentima <lucas.dipentima@curii.com>
Wed, 10 May 2023 20:05:55 +0000 (17:05 -0300)
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima@curii.com>

tools/salt-install/terraform/aws/vpc/locals.tf
tools/salt-install/terraform/aws/vpc/terraform.tfvars
tools/salt-install/terraform/aws/vpc/variables.tf

index 83929c14f91dc6ad7c507df2c598bfd4deca3f57..7f433950fe99764d25f6490a198f79ef1747cf23 100644 (file)
@@ -30,12 +30,8 @@ locals {
     for k, v in aws_eip.arvados_eip: k => v.public_ip
   }
   private_ip = var.private_ip
-  aliases = {
-    controller: ["ws"]
-    workbench: ["workbench2", "webshell", "keep", "download", "prometheus", "grafana", "*.collections"]
-  }
   cname_by_host = flatten([
-    for host, aliases in local.aliases : [
+    for host, aliases in var.dns_aliases : [
       for alias in aliases : {
         record = alias
         cname = host
index 61e1a37bba456d198e7843e0bd7f10785c7537a0..d65b7272f828ccf23342e5ab4995ff8287025c38 100644 (file)
@@ -2,7 +2,8 @@
 #
 # SPDX-License-Identifier: CC-BY-SA-3.0
 
-region_name = "us-east-1"
+# Main cluster configurations. No sensible defaults provided for these:
+# region_name = "us-east-1"
 # cluster_name = "xarv1"
 # domain_name = "xarv1.example.com"
 
@@ -12,10 +13,10 @@ region_name = "us-east-1"
 # Optional networking options. Set existing resources to be used instead of
 # creating new ones.
 # NOTE: We only support fully managed or fully custom networking, not a mix of both.
-# vpc_id = "vpc-"
-# sg_id = "sg-"
-# public_subnet_id = "subnet-"
-# private_subnet_id = "subnet-"
+# vpc_id = "vpc-aaaa"
+# sg_id = "sg-bbbb"
+# public_subnet_id = "subnet-cccc"
+# private_subnet_id = "subnet-dddd"
 
 # Optional custom tags to add to every resource. Default: {}
 # custom_tags = {
@@ -27,8 +28,17 @@ region_name = "us-east-1"
 # Optional cluster service nodes configuration:
 #
 # List of node names which either will be hosting user-facing or internal services
-# user_facing_hosts = [...]
-# internal_service_hosts = [...]
+# user_facing_hosts = ["node1", "node2", ...]
+# internal_service_hosts = ["node3", ...]
 #
 # Map assigning each node name an internal IP address
-# private_ip = {...}
\ No newline at end of file
+# private_ip = {
+#   node1 = "1.2.3.4",
+#   ...
+# }
+#
+# Map assigning DNS aliases for service node names
+# dns_aliases {
+#   node1 = ["alias1", "alias2", ...],
+#   ...
+# }
\ No newline at end of file
index 020c697ab037cb07ff8cc2782a953e958d02c694..faba8856294063c2f85d4dc286d44f6bc36cf04d 100644 (file)
@@ -50,6 +50,23 @@ variable "private_ip" {
   }
 }
 
+variable "dns_aliases" {
+  description = "Sets DNS name aliases for every service node"
+  type = map(list(string))
+  default = {
+    controller: ["ws"]
+    workbench: [
+      "workbench2",
+      "webshell",
+      "keep",
+      "download",
+      "prometheus",
+      "grafana",
+      "*.collections"
+    ]
+  }
+}
+
 variable "vpc_id" {
   description = "Use existing VPC instead of creating one for the cluster"
   type = string