-
Notifications
You must be signed in to change notification settings - Fork 7
/
common.tf
40 lines (32 loc) · 1.3 KB
/
common.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
32
33
34
35
36
37
38
39
40
/**
* Copyright (C) 2019-2021 Expedia, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
*/
data "aws_region" "current" {}
locals {
instance_alias = var.instance_name == "" ? "beekeeper" : format("beekeeper-%s", var.instance_name)
queue_alias = var.instance_name == "" ? var.queue_name : "${var.queue_name}-${var.instance_name}"
k8s_app_alias = var.k8s_app_name == "" ? "beekeeper" : format("beekeeper-%s", var.k8s_app_name)
dnsdomain = "${data.aws_iam_account_alias.current.account_alias}.aws.away.black"
dnsname = "egdl-eks-${data.aws_region.current.name}"
aws_region_key = "AWS_REGION"
aws_default_region_key = "AWS_DEFAULT_REGION"
db_password_key = "SPRING_DATASOURCE_PASSWORD"
spring_application_json_key = "SPRING_APPLICATION_JSON"
}
data "aws_caller_identity" "current" {}
data "aws_iam_account_alias" "current" {}
data "aws_vpc" "vpc" {
id = var.vpc_id
}
data "aws_secretsmanager_secret" "beekeeper_db" {
name = var.db_password_key
}
data "aws_secretsmanager_secret_version" "beekeeper_db" {
secret_id = data.aws_secretsmanager_secret.beekeeper_db.id
}
data "aws_secretsmanager_secret" "docker_registry" {
count = var.docker_registry_auth_secret_name == "" ? 0 : 1
name = var.docker_registry_auth_secret_name
}