-
Notifications
You must be signed in to change notification settings - Fork 8
/
post-install.sh
executable file
·31 lines (26 loc) · 1.15 KB
/
post-install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env bash
sed -i '/run_post_install/s/false/true/g' terraform.tfvars
cat << EOF >vault-config.tf
# This file is auto-generated by vault-config.sh
# The reason why is that vault provider requires a vault server is running & a valid login
# to be present else it will throw an error when running "terraform plan"
# https://github.com/hashicorp/terraform/issues/2430#issuecomment-370685911
module "vault-config" {
source = "./modules/vault-cloud-run/vault-config"
vault_address = module.vault.app_url
root_token_decrypt_command = module.vault.root_token_decrypt_command
host = module.gke_auth.host
cluster_ca_certificate = module.gke_auth.cluster_ca_certificate
domain = var.domain
project = var.project_id
location = var.region
token = module.vault-sa.token
ca_crt = module.vault-sa.ca_crt
oidc_config = var.oidc_config
email = var.email
}
EOF
terraform init
terraform plan
echo "Run below command to configure your vault instance."
echo "terraform apply --auto-approve"