21832: Allows custom backup retention period config.
[arvados.git] / tools / salt-install / terraform / aws / services / locals.tf
1 # Copyright (C) The Arvados Authors. All rights reserved.
2 #
3 # SPDX-License-Identifier: CC-BY-SA-3.0
4
5 locals {
6   region_name = data.terraform_remote_state.vpc.outputs.region_name
7   cluster_name = data.terraform_remote_state.vpc.outputs.cluster_name
8   use_external_db = data.terraform_remote_state.data-storage.outputs.use_external_db
9   private_only = data.terraform_remote_state.vpc.outputs.private_only
10   public_ip = data.terraform_remote_state.vpc.outputs.public_ip
11   private_ip = data.terraform_remote_state.vpc.outputs.private_ip
12   pubkey_path = pathexpand(var.pubkey_path)
13   public_hosts = data.terraform_remote_state.vpc.outputs.public_hosts
14   private_hosts = data.terraform_remote_state.vpc.outputs.private_hosts
15   user_facing_hosts = data.terraform_remote_state.vpc.outputs.user_facing_hosts
16   internal_service_hosts = data.terraform_remote_state.vpc.outputs.internal_service_hosts
17   ssl_password_secret_name = "${local.cluster_name}-${var.ssl_password_secret_name_suffix}"
18   instance_ami_id = var.instance_ami != "" ? var.instance_ami : data.aws_ami.debian-11.image_id
19   custom_tags = data.terraform_remote_state.vpc.outputs.custom_tags
20   compute_node_iam_role_name = data.terraform_remote_state.data-storage.outputs.compute_node_iam_role_name
21   instance_profile = {
22     default = aws_iam_instance_profile.default_instance_profile
23     workbench = aws_iam_instance_profile.dispatcher_instance_profile
24     keep0 = aws_iam_instance_profile.keepstore_instance_profile
25   }
26   private_subnet_id = data.terraform_remote_state.vpc.outputs.private_subnet_id
27   public_subnet_id = data.terraform_remote_state.vpc.outputs.public_subnet_id
28   additional_rds_subnet_id = data.terraform_remote_state.vpc.outputs.additional_rds_subnet_id
29   arvados_sg_id = data.terraform_remote_state.vpc.outputs.arvados_sg_id
30   eip_id = data.terraform_remote_state.vpc.outputs.eip_id
31   keepstore_iam_role_name = data.terraform_remote_state.data-storage.outputs.keepstore_iam_role_name
32   use_rds = (var.use_rds && data.terraform_remote_state.vpc.outputs.use_rds)
33   rds_username = var.rds_username != "" ? var.rds_username : "${local.cluster_name}_arvados"
34   rds_password = var.rds_password != "" ? var.rds_password : one(random_string.default_rds_password[*].result)
35   rds_allocated_storage = var.rds_allocated_storage
36   rds_max_allocated_storage = max(var.rds_max_allocated_storage, var.rds_allocated_storage)
37   rds_instance_type = var.rds_instance_type
38   rds_backup_retention_period = var.rds_backup_retention_period
39 }