mirror of
https://github.com/immich-app/yucca-o11y.git
synced 2026-09-30 13:23:23 +08:00
44 lines
1.2 KiB
HCL
44 lines
1.2 KiB
HCL
terraform {
|
|
source = "."
|
|
|
|
extra_arguments custom_vars {
|
|
commands = get_terraform_commands_that_need_vars()
|
|
|
|
# The onepassword provider treats OP_SERVICE_ACCOUNT_TOKEN as a configured
|
|
# credential alongside the explicit Connect creds and errors on the conflict.
|
|
# CI sets it for `op run` itself; blank it for the tofu child process only.
|
|
env_vars = {
|
|
OP_SERVICE_ACCOUNT_TOKEN = ""
|
|
}
|
|
}
|
|
}
|
|
|
|
locals {
|
|
env = get_env("TF_VAR_env")
|
|
stage = get_env("TF_VAR_stage")
|
|
}
|
|
|
|
generate "backend" {
|
|
path = "backend.tf"
|
|
if_exists = "overwrite_terragrunt"
|
|
contents = <<EOF
|
|
terraform {
|
|
backend "s3" {
|
|
bucket = "${get_env("TF_VAR_tf_state_s3_bucket")}"
|
|
key = "yucca/o11y/v3/grafana/cluster/${local.env}${local.stage != "" ? "/${local.stage}" : ""}"
|
|
region = "${get_env("TF_VAR_tf_state_s3_region")}"
|
|
access_key = "${get_env("TF_VAR_tf_state_s3_access_key")}"
|
|
secret_key = "${get_env("TF_VAR_tf_state_s3_secret_key")}"
|
|
|
|
endpoints = {
|
|
s3 = "${get_env("TF_VAR_tf_state_s3_endpoint")}"
|
|
}
|
|
|
|
skip_credentials_validation = true
|
|
skip_metadata_api_check = true
|
|
skip_region_validation = true
|
|
}
|
|
}
|
|
EOF
|
|
}
|