#
#  Author: Hari Sekhon
#  Date: 2025-03-11 04:10:45 +0800 (Tue, 11 Mar 2025)
#
#  vim:ts=4:sts=4:sw=4:et
#
#  https///github.com/HariSekhon/DevOps-Bash-tools
#
#  License: see accompanying Hari Sekhon LICENSE file
#
#  If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback
#
#  https://www.linkedin.com/in/HariSekhon
#

# ============================================================================ #
#                        T e r r a f o r m   C o n f i g
# ============================================================================ #

# https://developer.hashicorp.com/terraform/cli/config/config-file

# PLUGIN CACHING:
#
#   https://developer.hashicorp.com/terraform/cli/config/config-file#provider-plugin-cache
#
# Necessary to stop Terragrunt wasting tonnes of space
#
# You must create this cache dir manually otherwise Terraform will error out:
#
#    mkdir -p -v ~/.terraform.d/plugin-cache
#
# Otherwise Terraform / Terragrunt runs will error out like this...
#
#
#   There are some problems with the CLI configuration:
#   ╷
#   │ Error: The specified plugin cache dir /Users/hari/.terraform.d/plugin-cache cannot be opened: stat /Users/hari/.terraform.d/plugin-cache: no such file or directory
#   │
#   ╵
#
#   As a result of the above problems, Terraform may not behave as intended.
#
#
plugin_cache_dir   = "$HOME/.terraform.d/plugin-cache"
#
# Otherwise you could also waste space in these multiples...
#
# eg. terraform_provider_count_sizes.sh
#
#   30  597M  hashicorp/aws/5.80.0/darwin_arm64/terraform-provider-aws_v5.80.0_x5
#   7   637M  hashicorp/aws/5.90.1/darwin_arm64/terraform-provider-aws_v5.90.1_x5
#   4   637M  hashicorp/aws/5.90.0/darwin_arm64/terraform-provider-aws_v5.90.0_x5
#   3   599M  hashicorp/aws/5.81.0/darwin_arm64/terraform-provider-aws_v5.81.0_x5
#   2   593M  hashicorp/aws/5.79.0/darwin_arm64/terraform-provider-aws_v5.79.0_x5
#   1   609M  hashicorp/aws/5.82.2/darwin_arm64/terraform-provider-aws_v5.82.2_x5
#   1   605M  hashicorp/aws/5.83.1/darwin_arm64/terraform-provider-aws_v5.83.1_x5
#   1   606M  hashicorp/aws/5.84.0/darwin_arm64/terraform-provider-aws_v5.84.0_x5
#   1   624M  hashicorp/aws/5.86.0/darwin_arm64/terraform-provider-aws_v5.86.0_x5
#   1   14M   hashicorp/external/2.3.4/darwin_arm64/terraform-provider-external_v2.3.4_x5
#   1   14M   hashicorp/local/2.5.2/darwin_arm64/terraform-provider-local_v2.5.2_x5
#   1   14M   hashicorp/null/3.2.3/darwin_arm64/terraform-provider-null_v3.2.3_x5
#
# Output on an Atlantis server pod after deleting all data cache to fix out of space errors and
# then a single PR run:
#
#   14  654M  hashicorp/aws/5.90.1/linux_amd64/terraform-provider-aws_v5.90.1_x5
#   13  14M   hashicorp/external/2.3.4/linux_amd64/terraform-provider-external_v2.3.4_x5
#   13  14M   hashicorp/local/2.5.2/linux_amd64/terraform-provider-local_v2.5.2_x5
#   13  14M   hashicorp/null/3.2.3/linux_amd64/terraform-provider-null_v3.2.3_x5
#   3   346M  hashicorp/aws/4.67.0/linux_amd64/terraform-provider-aws_v4.67.0_x5
#   3   621M  hashicorp/aws/5.80.0/linux_amd64/terraform-provider-aws_v5.80.0_x5
#   3   653M  hashicorp/aws/5.90.0/linux_amd64/terraform-provider-aws_v5.90.0_x5
#   3   14M   hashicorp/random/3.6.3/linux_amd64/terraform-provider-random_v3.6.3_x5
#   1   627M  hashicorp/aws/5.82.2/linux_amd64/terraform-provider-aws_v5.82.2_x5
#   1   630M  hashicorp/aws/5.84.0/linux_amd64/terraform-provider-aws_v5.84.0_x5
