From 173fb843c7bbbbb323f3bcae3f5571acd5c49964 Mon Sep 17 00:00:00 2001 From: Ricard Illa Date: Thu, 18 Aug 2022 18:15:21 +0200 Subject: [PATCH] simple initial boilerplate --- init.sh | 11 +++++++++++ main.tf | 3 +++ run_terraform | 6 ++++++ 3 files changed, 20 insertions(+) create mode 100755 init.sh create mode 100644 main.tf create mode 100755 run_terraform diff --git a/init.sh b/init.sh new file mode 100755 index 0000000..451af6f --- /dev/null +++ b/init.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +PG_USER=terraform +PG_HOST=pg.monotremata.xyz +PG_DB=terraform_backend +PG_PORT=5432 + +passwd=$(pass "${PG_HOST}/${PG_USER}") +conn_str="postgres://${PG_USER}:${passwd}@${PG_HOST}:${PG_PORT}/${PG_DB}" + +terraform init -backend-config="conn_str=${conn_str}" diff --git a/main.tf b/main.tf new file mode 100644 index 0000000..637aeee --- /dev/null +++ b/main.tf @@ -0,0 +1,3 @@ +terraform { + backend "pg" {} +} diff --git a/run_terraform b/run_terraform new file mode 100755 index 0000000..1eb62e5 --- /dev/null +++ b/run_terraform @@ -0,0 +1,6 @@ +#!/bin/sh + +export HTTP_PROXY=caladan:8888 +export HTTPS_PROXY=caladan:8888 + +terraform "$@"