Skip to content

Commit

Permalink
docs: Add context on IaC setup and `MB_DB_CONNECTION_URI\' env var
Browse files Browse the repository at this point in the history
  • Loading branch information
DafyddLlyr committed Mar 5, 2024
1 parent b27deee commit 4dd9b14
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions doc/how-to/how-to-grant-metabase-permissions.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ The password for Staging and Production databases can be found the OSL 1Password

The username and password for Metabase are not controlled via IaC - they are manually entered via the Metabase "Admin" dashboard (`Admin Setting > Databases > "staging" | "production" > Username / Password fields`).

Please note - this is separate to the role used to read/write Metabase internal application data (such as dashboard and queries). This role is setup in IaC [here](https://github.com/theopensystemslab/planx-new/blob/main/infrastructure/application/index.ts#L100). For more information, please see [the Metabase docs](https://www.metabase.com/docs/latest/installation-and-operation/configuring-application-database).

### Locally & Pizzas
If you wish to run Metabase locally using the "analytics" Docker profile (`pnpm analytics` from project root), you will need to manually run the above SQL on your local database with a password of your choice. Alternatively, you can use the root DB username/password.

Expand Down
4 changes: 4 additions & 0 deletions infrastructure/application/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ export = async () => {
superuser: false,
});
const metabasePgPassword = config.requireSecret("metabasePgPassword");

// Setup role and database for internal Metabase application data, such as dashboards and queries
// This is separate to the postgres/public one used to hold PlanX application data
// Docs: https://www.metabase.com/docs/latest/installation-and-operation/configuring-application-database
const role = new postgres.Role(
"metabase",
{
Expand Down

0 comments on commit 4dd9b14

Please sign in to comment.