Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 32 additions & 2 deletions terraform/nowcasting/development/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ This is the main terraform code for the UK platform. It is used to deploy the pl
5.1 - PVSite database
5.2 - PVSite API
5.3 - PVSite ML bucket
6.1 - Open Data PVnet
7.0 - API Open Quartz Solar
6.1 - Open Data PVnet (dev only)
7.0 - API Open Quartz Solar (dev only)
8.0 - Data Platform Database
8.1 - Data Platform API
9.0 - Primaries API

Variables used across all modules
======*/
Expand Down Expand Up @@ -317,3 +318,32 @@ module "data_platform_api" {
elbscheme="internal"
elb_ports=["80","50051"]
}


# 9.0 Primaries API
module "primaries-api" {
source = "../../modules/services/eb_app"
domain = local.domain
aws-region = var.region
aws-environment = local.environment
aws-subnet_id = module.networking.public_subnet_ids[0]
aws-vpc_id = module.networking.vpc_id
container-command = ["quartzapi"]
container-env_vars = [
{ "name" : "SOURCE", "value" : "dataplatform" },
{ "name" : "ROUTERS", "value" : "substations" },
{ "name" : "PORT", "value" : "80" },
{ "name" : "DB_URL", "value" : module.database.forecast-database-secret-url },
{ "name" : "AUTH0_DOMAIN", "value" : var.auth_domain },
{ "name" : "AUTH0_API_AUDIENCE", "value" : var.auth_api_audience },
{ "name" : "SENTRY_DSN", "value" : var.sentry_dsn_api },
{ "name" : "ENVIRONMENT", "value": local.environment},
{ "name" : "DATA_PLATFORM_HOST", "value": module.data_platform_api.api_url},
{ "name" : "DATA_PLATFORM_PORT", "value": "50051"},
]
container-name = "quartz-api"
container-tag = var.version-primaries-api
container-registry = "ghcr.io/openclimatefix"
eb-app_name = "primaries-api"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to name this quartz-api instead? Because we might move a bunch of stuff into here and it won't just serve the primaries at that point

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. yea, although i imagine this might be a different API deployment the to the UK one.

Perhaps I could call in quartz-api-primaries, then it shows its quartz-api and it says it for primaries

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thout you wanted to reduce the number of deployments? You can have more than one router now too - so wondering what the change of mind is to split deployments?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah ok, Lets make it general for now. Perhaps the UK National and GSP when it first goes into the quartz-api could be seperate, but then aim to get it all on one

s3_bucket = []
}
6 changes: 6 additions & 0 deletions terraform/nowcasting/development/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,10 @@ variable "data_platform_api_version" {
type = string
description = "Docker verions for the data platform api"
default = "update-build-location"
}

variable "version-primaries-api" {
type = string
description = "Docker verions for the data primaries api"
default = "0.3.4"
}