Skip to content

Commit

Permalink
add auth variables to internal ui
Browse files Browse the repository at this point in the history
  • Loading branch information
peterdudfield committed Oct 16, 2023
1 parent cc873fa commit bb0d94f
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 0 deletions.
2 changes: 2 additions & 0 deletions terraform/modules/services/internal_ui/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ services:
SITES_DB_URL: $SITES_DB_URL
ORIGINS: $ORIGINS
ENVIRONMENT: $ENVIRONMENT
AUTH0_DOMAIN: $AUTH0_DOMAIN
AUTH0_CLIENT_ID: $AUTH0_CLIENT_ID
container_name: ${EB_APP_NAME}
ports:
- 80:8501
12 changes: 12 additions & 0 deletions terraform/modules/services/internal_ui/eb.tf
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,18 @@ resource "aws_elastic_beanstalk_environment" "eb-env" {
value = var.environment
}

setting {
namespace = "aws:elasticbeanstalk:application:environment"
name = "AUTH0_CLIENT_ID"
value = var.auth_config.auth0_client_id
}

setting {
namespace = "aws:elasticbeanstalk:application:environment"
name = "AUTH0_DOMAIN"
value = var.auth_config.auth0_domain
}

# =========== EB Settings =========== #

setting {
Expand Down
15 changes: 15 additions & 0 deletions terraform/modules/services/internal_ui/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ variable "docker_config" {
EOT
}


variable "database_config" {
type = object({
secret = any
Expand All @@ -54,3 +55,17 @@ variable "database_config" {
}
EOT
}


variable "auth_config" {
type = object({
auth0_domain = string
auth0_client = string
})
description = <<EOT
docker_config_info = {
auth0_domain : "Auth0 Domain"
auth0_client_id : "Auth0 Client id"
}
EOT
}
4 changes: 4 additions & 0 deletions terraform/nowcasting/development/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,10 @@ module "analysis_dashboard" {
secret = module.database.forecast-database-secret-url
read_policy_arn = module.database.iam-policy-forecast-db-read.arn
}
auth_config = {
auth0_domain = var.auth0_domain
auth0_client_id = var.auth_dashboard_client_id
}
}

module "forecast_blend" {
Expand Down
5 changes: 5 additions & 0 deletions terraform/nowcasting/development/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ variable "auth_domain" {
default = "not-set"
}

variable "auth_dashboard_client_id" {
description = "The Auth client id for the dashboard that should be used"
default = "not-set"
}

variable "auth_api_audience" {
description = "The Auth API Audience that should be used"
default = "not-set"
Expand Down

0 comments on commit bb0d94f

Please sign in to comment.