Skip to content

Commit

Permalink
move PV over to ecs task
Browse files Browse the repository at this point in the history
  • Loading branch information
peterdudfield committed Oct 30, 2024
1 parent ba9c0fc commit fc8061c
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 178 deletions.
8 changes: 0 additions & 8 deletions terraform/modules/services/pv/README.md

This file was deleted.

12 changes: 0 additions & 12 deletions terraform/modules/services/pv/cloudwatch.tf

This file was deleted.

70 changes: 0 additions & 70 deletions terraform/modules/services/pv/ecs.tf

This file was deleted.

18 changes: 0 additions & 18 deletions terraform/modules/services/pv/iam.tf

This file was deleted.

19 changes: 0 additions & 19 deletions terraform/modules/services/pv/secrets.tf

This file was deleted.

43 changes: 0 additions & 43 deletions terraform/modules/services/pv/variables.tf

This file was deleted.

50 changes: 42 additions & 8 deletions terraform/nowcasting/development/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ The componentes ares:
2.1 - Database
2.2 - NWP Consumer Secret
2.3 - Satellite Consumer Secret
2.4 - PV Secret
3.2 - NWP Consumer (MetOffice National)
3.3 - NWP Consumer (ECMWF UK)
3.4 - Satellite Consumer
Expand Down Expand Up @@ -139,6 +140,17 @@ resource "aws_secretsmanager_secret" "satellite_consumer_secret" {
name = "${local.environment}/data/satellite-consumer"
}

# 2.4
# TODO remove
import {
to = aws_secretsmanager_secret.pv_consumer_secret
id = "arn:aws:secretsmanager:eu-west-1:008129123253:secret:development/consumer/solar_sheffield-2Tyskm"
}

resource "aws_secretsmanager_secret" "pv_consumer_secret" {
name = "${local.environment}/data/solar-sheffield"
}


# 3.2
module "nwp-national" {
Expand Down Expand Up @@ -315,15 +327,37 @@ module "sat_clean_up" {

# 3.6
module "pv" {
source = "../../modules/services/pv"

region = var.region
environment = local.environment
public_subnet_ids = module.networking.public_subnet_ids
database_secret_forecast = module.database.forecast-database-secret
docker_version_ss = var.pv_ss_version
iam-policy-rds-read-secret_forecast = module.database.iam-policy-forecast-db-read
source = "../../modules/services/ecs_task"

ecs-task_name = "pv"
ecs-task_type = "consumer"
ecs-task_execution_role_arn = module.ecs.ecs_task_execution_role_arn
ecs-task_size = {
cpu = 256
memory = 512
}

aws-region = var.region
aws-environment = local.environment

s3-buckets = []

container-env_vars = [
{ "name" : "SENTRY_DSN", "value" : var.sentry_dsn },
{ "name" : "ENVIRONMENT", "value" : local.environment },
{ "name" : "LOGLEVEL", "value" : "INFO"},
{ "name" : "PROVIDER", "value" : "solar_sheffield_passiv"},
]
container-secret_vars = [
{secret_policy_arn: module.pvsite_database.secret.arn,
values: ["DB_URL"]},
{secret_policy_arn: module.aws_secretsmanager_secret.pv_consumer_secret.arn,
values: ["SS_USER_ID", "SS_KEY", "SS_URL"]}
]
container-tag = var.pv_ss_version
container-name = "openclimatefix/pvconsumer"
container-registry = "docker.io"
container-command = []
}

# 3.7
Expand Down

0 comments on commit fc8061c

Please sign in to comment.