Merge branch '20482-further-terraform-improvements'. Refs #20482
authorLucas Di Pentima <lucas.dipentima@curii.com>
Wed, 17 May 2023 13:28:16 +0000 (10:28 -0300)
committerLucas Di Pentima <lucas.dipentima@curii.com>
Wed, 17 May 2023 13:28:16 +0000 (10:28 -0300)
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima@curii.com>

tools/salt-install/installer.sh
tools/salt-install/terraform/aws/vpc/main.tf
tools/salt-install/terraform/aws/vpc/terraform.tfvars
tools/salt-install/terraform/aws/vpc/variables.tf

index e5aff213ee45aa1bf43ca55f3578b75fec904c3c..5a55e337da3248e22c335f5ac7d9be3e020d9ae6 100755 (executable)
@@ -264,7 +264,7 @@ case "$subcmd" in
            exit 1
        fi
 
-       BRANCH=$(git branch --show-current)
+       BRANCH=$(git rev-parse --abbrev-ref HEAD)
 
        set -x
 
index f0779d4fc596fa0d3f5af096a637ef81baa3158e..da98f1ac8357af95ba6bed2f8aa61027ed8a5783 100644 (file)
@@ -66,12 +66,13 @@ resource "aws_subnet" "private_subnet" {
 # VPC S3 access
 #
 resource "aws_vpc_endpoint" "s3" {
+  count = var.vpc_id == "" ? 1 : 0
   vpc_id = local.arvados_vpc_id
   service_name = "com.amazonaws.${var.region_name}.s3"
 }
 resource "aws_vpc_endpoint_route_table_association" "compute_s3_route" {
   count = var.private_subnet_id == "" ? 1 : 0
-  vpc_endpoint_id = aws_vpc_endpoint.s3.id
+  vpc_endpoint_id = aws_vpc_endpoint.s3[0].id
   route_table_id = aws_route_table.private_subnet_rt[0].id
 }
 
index d65b7272f828ccf23342e5ab4995ff8287025c38..bbc5f84958df40cff6c44ef7a7b9f3cc42a52c71 100644 (file)
 #
 # Map assigning each node name an internal IP address
 # private_ip = {
-#   node1 = "1.2.3.4",
+#   node1 = "1.2.3.4"
 #   ...
 # }
 #
 # Map assigning DNS aliases for service node names
-# dns_aliases {
-#   node1 = ["alias1", "alias2", ...],
+# dns_aliases {
+#   node1 = ["alias1", "alias2", ...]
 #   ...
 # }
\ No newline at end of file
index faba8856294063c2f85d4dc286d44f6bc36cf04d..b91cc421497c15a0e9fde05be7378ba528052dd5 100644 (file)
@@ -43,10 +43,10 @@ variable "private_ip" {
   description = "Map with every node's private IP address"
   type = map(string)
   default = {
-    controller: "10.1.1.11",
-    workbench: "10.1.1.15",
-    shell: "10.1.2.17",
-    keep0: "10.1.2.13",
+    controller = "10.1.1.11"
+    workbench = "10.1.1.15"
+    shell = "10.1.2.17"
+    keep0 = "10.1.2.13"
   }
 }
 
@@ -54,8 +54,8 @@ variable "dns_aliases" {
   description = "Sets DNS name aliases for every service node"
   type = map(list(string))
   default = {
-    controller: ["ws"]
-    workbench: [
+    controller = ["ws"]
+    workbench = [
       "workbench2",
       "webshell",
       "keep",