mirror of
https://gitlab.sarex.io/infra/terraform-contour-mirror.git
synced 2026-10-07 22:01:35 +03:00
45 lines
1.6 KiB
HCL
45 lines
1.6 KiB
HCL
include "root" {
|
|
path = find_in_parent_folders()
|
|
}
|
|
|
|
# Юнит-валидатор контракта: ноль ресурсов, планируется первым (по алфавиту
|
|
# contracts < database < ... в scripts/run_all_stacks.sh). Для окружений без
|
|
# environments/<env>/environment.yaml на входе пустота, все правила проходят,
|
|
# ресурсов нет.
|
|
|
|
locals {
|
|
repo_root = try(get_repo_root(), "${get_terragrunt_dir()}/../..")
|
|
shared = read_terragrunt_config("${local.repo_root}/live/_shared/config.hcl")
|
|
}
|
|
|
|
remote_state {
|
|
backend = "s3"
|
|
generate = {
|
|
path = "backend.tf"
|
|
if_exists = "overwrite_terragrunt"
|
|
}
|
|
config = {
|
|
endpoint = get_env("TF_STATE_S3_ENDPOINT", "")
|
|
bucket = get_env("TF_STATE_S3_BUCKET", "")
|
|
key = "${local.shared.locals.env_name}/contracts/terraform.tfstate"
|
|
region = get_env("TF_STATE_S3_REGION", "ru-central1")
|
|
access_key = get_env("S3_ACCESS_KEY", get_env("AWS_ACCESS_KEY_ID", ""))
|
|
secret_key = get_env("S3_SECRET_KEY", get_env("AWS_SECRET_ACCESS_KEY", ""))
|
|
skip_region_validation = true
|
|
skip_credentials_validation = true
|
|
skip_metadata_api_check = true
|
|
skip_bucket_root_access = true
|
|
force_path_style = true
|
|
}
|
|
}
|
|
|
|
terraform {
|
|
source = "${get_terragrunt_dir()}/../../modules//contracts"
|
|
}
|
|
|
|
inputs = {
|
|
environment = local.shared.locals.environment
|
|
namespaces = local.shared.locals.namespaces
|
|
services = local.shared.locals.services
|
|
}
|