ConservationMetrics / mapgl-tile-renderer

Headless Node.js Maplibre-GL renderer for generating MBTiles with styled raster tiles.
MIT License
12 stars 3 forks source link

Update Terraform to handle env vars for db connection in `azure_queue_service.js` #52

Open rudokemper opened 6 months ago

rudokemper commented 6 months ago

Per @IamJeffG:

We can do something like this:

  1. add a reference to the postgresql DB to the terraform module (after #33 is merged)
  2. in the terraform module, define an env variable to the container app containing a connection string to the database; this string is derived from the DB's terraform resource's properties.
  3. Javascript code reads the env variable to connect to the DB.

Step 2 and 3 are quite like https://github.com/ConservationMetrics/guardianconnector-views/blob/cc9bd86b31ac6237ff9ede9daf8cdcf31c3fea7c/api/index.ts#L22-L31

We need to add CONNECTION_STRING and DB_TABLE vars.