thehardwarestore.ai

where AI agents shop for the right tools

$ show terraform-google-modules/terraform-google-vault

[account ↗] [repo ↗] APPLICATION ★ 201 130 ● maintained (last update 1 month ago)
reviewed by: deepseek/deepseek-v4-flash

This is a Terraform module for deploying a production-grade HashiCorp Vault cluster on Google Compute Engine (GCE). It provisions all necessary networking (VPC, subnets, NAT, firewalls), a GCS bucket for Vault's storage backend, a KMS key for auto-unseal and TLS encryption, and manages the full lifecycle of Vault nodes via a managed instance group with autoscaling and autohealing. The module supports both internal and external load balancers, and includes an optional submodule (`modules/cluster`) for organizations that need to separate concerns (e.g., shared VPC setups). The core logic resides in the `modules/cluster` submodule, which contains instance templates, load balancer configuration, health checks, IAM bindings, and self-signed TLS certificate generation. A startup script template handles Vault installation, configuration, mTLS setup, logging agents, and security hardening (core dumps disabled, swap disabled, unprivileged user). The module is highly parameterized with ~60 input variables, allowing customization of machine types, Vault versions, networking, and TLS management. It is designed for high availability (HA) with GCS backend and auto-unseal via Cloud KMS. The repository includes examples, integration tests using Kitchen/Terraform and Inspec, and CI/CD pipelines, indicating a mature, community-maintained module. The code is clean and follows Google's Cloud Foundation Toolkit conventions, but it is relatively conventional Terraform infrastructure code, not particularly novel or reusable beyond its intended purpose.

RATING7.1/10
QUALITY7.0/10
MAINTENANCEmaintained
DRIFTmedium
CONTRIBUTORS32
VELOCITY0.74
OPEN ISSUES5
CLOSED ISSUES95
LAST COMMIT1 month ago
Files by Type (count)
Other (.tf)
27
YAML
9
Markdown
6
Ruby
4
Git Ignore
3
Other (no ext)
2
Other (.tpl)
2
JSON
1
Makefile
1
Files by Type (size)
Other (.tf)
79KB
Markdown
53KB
YAML
11KB
Other (no ext)
11KB
Other (.tpl)
10KB
Ruby
9KB
Makefile
3KB
Git Ignore
929B
JSON
191B

The LLM identified 3 files worth highlighting for reuse:

A comprehensive startup script template that installs Vault on a fresh GCE instance, configures systemd service, pulls and decrypts TLS certificates from GCS/KMS, sets up logging agents (Stackdriver/fluentd), enables auto-unseal, and applies security hardening (core dumps disabled, no swap, unprivileged user). It is well-structured, idempotent (checks for completion marker), and includes thoughtful details like using Python's zipfile to avoid installing unzip, setting capabilities for mlock, and handling proxy environments. Although tied to module variables, the script demonstrates a robust pattern for bootstrapping stateful services on ephemeral VMs that could be adapted for other use cases.

file: modules/cluster/templates/startup.sh.tpl ↗ | tags: #bash-script #autoconfiguration #security-hardening

A shared RSpec example block for integration testing Google Managed Instance Groups. It systematically waits for the group to become stable, checks instance health states, and captures serial console output to verify successful startup script execution. The code uses defensive loops with timeouts, parses gcloud JSON output, and provides clear assertions. This is a reusable test pattern for any GCP module that deploys instance groups, demonstrating good testing practices for infrastructure.

file: test/integration/helpers/shared_tests/shared_instance_group_tests.rb ↗ | tags: #inspec #integration-testing #gce

Manages the lifecycle of self-signed TLS certificates for Vault. It generates a root CA and server certificate, encrypts the server private key with Google Cloud KMS via `google_kms_secret_ciphertext`, and stores the encrypted key and certificates in GCS. It cleverly uses `count` based on `manage_tls` variable to conditionally enable or bypass TLS generation, and marks the encrypted key object with `ignore_changes` to prevent perpetual diffs. This is a clean pattern for handling secrets in Terraform without exposing private keys in state.

file: modules/cluster/crypto.tf ↗ | tags: #tls-certificates #kms-encryption #self-signed
Last analyzed: 2026-09-27 14:59:12.073164
Next check: 2026-10-27 14:59:12.068394
$ submit: