2022-08-18 18:08:03 +02:00
|
|
|
# terraform
|
|
|
|
|
2022-08-18 18:15:34 +02:00
|
|
|
The terraform code for my small personal infrastructure
|
|
|
|
|
|
|
|
## Backend
|
|
|
|
|
|
|
|
I use the pg backend on a PostgreSQL hosted on my NAS. Create the user (named
|
|
|
|
`terraform`) and database (`terraform_backend`) for it. The user's password is
|
|
|
|
managed with `pass`.
|
|
|
|
|
|
|
|
```sh
|
|
|
|
pass generate pg.monotremata.xyz/terraform
|
2022-08-18 18:20:37 +02:00
|
|
|
psql --host pg.monotremata.xyz
|
2022-08-18 18:15:34 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
```sql
|
|
|
|
CREATE DATABASE terraform_backend;
|
|
|
|
CREATE USER terraform WITH ENCRYPTED PASSWORD '****';
|
|
|
|
GRANT ALL PRIVILEGES ON DATABASE terraform_backend TO terraform;
|
|
|
|
```
|