@@ -9,6 +9,7 @@ This is the main terraform code for the UK platform. It is used to deploy the pl
990.5 - S3 bucket for forecasters
10100.6 - Database
11111.1 - API
12+ 1.2 - UK-National API
12132.1 - NWP Consumer Secret
13142.2 - Satellite Consumer Secret
14152.3 - PV Secret
@@ -17,10 +18,11 @@ This is the main terraform code for the UK platform. It is used to deploy the pl
17185.1 - PVSite database
18195.2 - PVSite API
19205.3 - PVSite ML bucket
20- 6.1 - Open Data PVnet
21- 7.0 - API Open Quartz Solar
21+ 6.1 - Open Data PVnet (dev only)
22+ 7.0 - API Open Quartz Solar (dev only)
22238.0 - Data Platform Database
23248.1 - Data Platform API
25+ 9.0 - Primaries API
2426
2527Variables used across all modules
2628======*/
@@ -100,6 +102,7 @@ module "api" {
100102 { " name" : " ADJUST_MW_LIMIT" , " value" : " 1000" },
101103 { " name" : " N_HISTORY_DAYS" , " value" : " 2" },
102104 { " name" : " ENVIRONMENT" , " value" : local.environment },
105+ { " name" : " APITALLY_CLIENT_ID" , " value" : var.apitally_client_id},
103106 ]
104107 container-name = " nowcasting_api"
105108 container-tag = var. api_version
@@ -114,6 +117,41 @@ module "api" {
114117 max_ec2_count = 2
115118}
116119
120+ # 1.2
121+ module "uk-national-quartz-api" {
122+ source = " ../../modules/services/eb_app"
123+ domain = local. domain
124+ aws-region = var. region
125+ aws-environment = local. environment
126+ aws-subnet_id = module. networking . public_subnet_ids [0 ]
127+ aws-vpc_id = module. networking . vpc_id
128+ container-command = [" quartz-api" ]
129+ container-env_vars = [
130+ { " name" : " SOURCE" , " value" : " dataplatform" },
131+ { " name" : " ROUTERS" , " value" : " uk_national" },
132+ { " name" : " PORT" , " value" : " 80" },
133+ { " name" : " SENTRY_DSN" , " value" : var.sentry_dsn_api },
134+ { " name" : " ENVIRONMENT" , " value" : local.environment},
135+ { " name" : " DATA_PLATFORM_HOST" , " value" : module.data_platform_api.api_url},
136+ { " name" : " DATA_PLATFORM_PORT" , " value" : " 50051" },
137+ { " name" : " AUTH0_DOMAIN" , " value" : var.auth_domain },
138+ { " name" : " AUTH0_AUDIENCE" , " value" : var.auth_api_audience },
139+ { " name" : " AUTH0_RULE_NAMESPACE" , " value" : " https://openclimatefix.org" },
140+ { " name" : " AUTH0_CLIENT_ID" , " value" : var.auth_client_id},
141+ { " name" : " APITALLY_CLIENT_ID" , " value" : var.apitally_client_id},
142+ # legacy, we shouldnt need this in the future,
143+ # but we need this for status in the mean time
144+ { " name" : " DB_URL" , " value" : module.database.forecast- database- secret- url },
145+ { " name" : " HOST_URL" , " value" : " http://uk-development-uk-national-quartz-api.eu-west-1.elasticbeanstalk.com" }
146+ ]
147+ container-name = " quartz-api"
148+ container-tag = var. uk-national-quartz-api
149+ container-registry = " ghcr.io/openclimatefix"
150+ eb-app_name = " uk-national-quartz-api"
151+ s3_bucket = []
152+ }
153+
154+
117155# 2.1
118156resource "aws_secretsmanager_secret" "nwp_consumer_secret" {
119157 name = " ${ local . environment } /data/nwp-consumer"
@@ -317,3 +355,35 @@ module "data_platform_api" {
317355 elbscheme = " internal"
318356 elb_ports = [" 80" ," 50051" ]
319357}
358+
359+
360+ # 9.0 Primaries API
361+ module "quartz-api" {
362+ source = " ../../modules/services/eb_app"
363+ domain = local. domain
364+ aws-region = var. region
365+ aws-environment = local. environment
366+ aws-subnet_id = module. networking . public_subnet_ids [0 ]
367+ aws-vpc_id = module. networking . vpc_id
368+ container-command = [" quartz-api" ]
369+ container-env_vars = [
370+ { " name" : " SOURCE" , " value" : " dataplatform" },
371+ { " name" : " ROUTERS" , " value" : " substations" },
372+ { " name" : " PORT" , " value" : " 80" },
373+ { " name" : " DB_URL" , " value" : module.database.forecast- database- secret- url },
374+ { " name" : " AUTH0_DOMAIN" , " value" : var.auth_domain },
375+ { " name" : " AUTH0_AUDIENCE" , " value" : var.auth_api_audience },
376+ { " name" : " AUTH0_CLIENT_ID" , " value" : var.auth_client_id},
377+ { " name" : " SENTRY_DSN" , " value" : var.sentry_dsn_api },
378+ { " name" : " ENVIRONMENT" , " value" : local.environment},
379+ { " name" : " DATA_PLATFORM_HOST" , " value" : module.data_platform_api.api_url},
380+ { " name" : " DATA_PLATFORM_PORT" , " value" : " 50051" },
381+ { " name" : " APITALLY_CLIENT_ID" , " value" : var.apitally_client_id},
382+ { " name" : " HOST_URL" , " value" : " http://uk-development-quartz-api.eu-west-1.elasticbeanstalk.com" }
383+ ]
384+ container-name = " quartz-api"
385+ container-tag = var. quartz-api
386+ container-registry = " ghcr.io/openclimatefix"
387+ eb-app_name = " quartz-api"
388+ s3_bucket = []
389+ }
0 commit comments