-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapi.tf
45 lines (36 loc) · 1.32 KB
/
api.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
41
42
43
44
45
data "terraform_remote_state" "auth0" {
backend = "remote"
config = {
organization = "smartatransit"
workspaces = {
name = "auth0"
}
}
}
module "api-gateway" {
source = "./modules/service"
name = "api-gateway"
subdomain = "api-gateway"
image = "smartatransit/api-gateway:build-30"
port = 8080
env = {
AUTH0_TENANT_URL = data.terraform_remote_state.auth0.outputs.api_url
AUTH0_CLIENT_AUDIENCE = data.terraform_remote_state.auth0.outputs.audience
CLIENT_ID = data.terraform_remote_state.auth0.outputs.anonymous_client.client_id
CLIENT_SECRET = data.terraform_remote_state.auth0.outputs.anonymous_client.client_secret
}
traefik_network_name = docker_network.traefik.id
services_domain = local.services_domain
alternate_domains = local.alternate_services_domains
}
locals {
gateway_info = {
address = "https://api-gateway.${local.services_domain}/v1/verify"
// Traefik will automagically blacklist these from the request and set
// them based on the repsonse from the gateway.
auth_response_headers = "X-Smarta-Auth-Id,X-Smarta-Auth-Role,X-Smarta-Auth-Session,X-Smarta-Auth-Anonymous,X-Smarta-Auth-Superuser,X-Smarta-Auth-Issuer,X-Smarta-Auth-Phone,X-Smarta-Auth-Email"
}
}
output "gateway_info" {
value = local.gateway_info
}