include {
  path = find_in_parent_folders()
}

# ---------------------------------------------------------------------------------------------------------------------
# Generate a required providers block
# This module needs to override the root to add okta
# ---------------------------------------------------------------------------------------------------------------------
generate "required_providers" {
  path      = "required_provider.tf"
  if_exists = "overwrite_terragrunt"
  contents  = <<EOF
terraform {
  required_providers {
    aws = {
      source = "hashicorp/aws"
      version = "= 3.37.0" # 2021-04-29: upgrade from 2.66
    }
    template = {
      source = "hashicorp/template"
      version = "= 2.2.0" # 2021-04-29: ugprade from 2.1.0
    }
    vault = {
      source = "hashicorp/vault"
      version = "= 2.19.1" # 2021-04-29: upgrade from 2.18.0
    }
    sensu = {
      source = "jtopjian/sensu"
      version = "= 0.10.5"
    }
    okta = {
      source  = "oktadeveloper/okta"
    }
  }
}
EOF
}
terraform_version_constraint = "= 0.15.1"
terragrunt_version_constraint = ">= 0.29, < 0.30"
