nixos-config/terraform/terranix.org/targets/namecheap/terragrunt.hcl
2024-01-07 00:35:22 +01:00

34 lines
736 B
HCL

include {
path = find_in_parent_folders()
}
inputs = {
namecheap_user = run_cmd("--terragrunt-quiet", "pass", "show", "development/namecheap.com/username")
namecheap_api_key = run_cmd("--terragrunt-quiet", "pass", "show", "development/namecheap.com/api-key")
}
generate "provider" {
path = "__provider.tf"
if_exists = "overwrite_terragrunt"
contents = <<EOF
terraform {
required_providers {
namecheap = {
source = "namecheap/namecheap"
version = ">= 2.0.0"
}
}
}
# Namecheap API credentials
provider "namecheap" {
user_name = var.namecheap_user
api_user = var.namecheap_user
api_key = var.namecheap_api_key
}
variable "namecheap_user" {}
variable "namecheap_api_key" {}
EOF
}