forked from outerbounds/terraform-aws-metaflow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
locals.tf
31 lines (25 loc) · 1.5 KB
/
locals.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
module "metaflow-common" {
source = "../common"
}
locals {
# Name of ECS cluster.
# replace() ensures names that are composed of just prefix + suffix do not have duplicate dashes
ecs_cluster_name = replace("${var.resource_prefix}${var.resource_suffix}", "--", "-")
ecs_cluster_id = var.ecs_cluster_id != null ? var.ecs_cluster_id : aws_ecs_cluster.this[0].id
is_gov = var.iam_partition == "aws-us-gov"
# Name of Fargate security group used by the Metadata Service
metadata_service_security_group_name = "${var.resource_prefix}metadata-service-security-group${var.resource_suffix}"
metadata_service_container_image = (
var.metadata_service_container_image == "" ?
module.metaflow-common.default_metadata_service_container_image :
var.metadata_service_container_image
)
api_gateway_endpoint_configuration_type = local.is_gov ? "REGIONAL" : "EDGE"
api_gateway_key_name = "${var.resource_prefix}key${var.resource_suffix}"
api_gateway_stage_name = "api"
api_gateway_usage_plan_name = "${var.resource_prefix}usage-plan${var.resource_suffix}"
db_migrate_lambda_zip_file = "${path.module}/db_migrate_lambda.zip"
db_migrate_lambda_name = "${var.resource_prefix}db_migrate${var.resource_suffix}"
lambda_ecs_execute_role_name = "${var.resource_prefix}lambda_ecs_execute${var.resource_suffix}"
cloudwatch_logs_arn_prefix = "arn:${var.iam_partition}:logs:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}"
}