terragrunt.hcl 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. locals {
  2. # If you want to use any of the variables in _this_ file, you have to load them here.
  3. # However, they will all be available as inputs to the module loaded in terraform.source
  4. # below.
  5. environment_vars = read_terragrunt_config(find_in_parent_folders("env.hcl"))
  6. partition_vars = read_terragrunt_config(find_in_parent_folders("partition.hcl"))
  7. region_vars = read_terragrunt_config(find_in_parent_folders("region.hcl"))
  8. account_vars = read_terragrunt_config(find_in_parent_folders("account.hcl"))
  9. global_vars = read_terragrunt_config(find_in_parent_folders("globals.hcl"))
  10. }
  11. # Terragrunt will copy the Terraform configurations specified by the source parameter, along with any files in the
  12. # working directory, into a temporary folder, and execute your Terraform commands in that folder.
  13. terraform {
  14. # Double slash is intentional and required to show root of modules
  15. source = "git@github.xdr.accenturefederalcyber.com:mdr-engineering/xdr-terraform-modules.git//base/codebuild_ecr_customer_portal?ref=v1.10.10"
  16. }
  17. dependency "codebuild-ecr-base" {
  18. config_path = "../075-codebuild-ecr-base"
  19. }
  20. #Github specific provider
  21. generate "required_providers" {
  22. path = "required_provider.tf"
  23. if_exists = "overwrite_terragrunt"
  24. contents = <<EOF
  25. terraform {
  26. required_providers {
  27. aws = {
  28. source = "hashicorp/aws"
  29. version = "= 3.37.0" # 2021-04-29: upgrade from 2.66
  30. }
  31. template = {
  32. source = "hashicorp/template"
  33. version = "= 2.2.0" # 2021-04-29: ugprade from 2.1.0
  34. }
  35. vault = {
  36. source = "hashicorp/vault"
  37. version = "= 2.19.1" # 2021-04-29: upgrade from 2.18.0
  38. }
  39. sensu = {
  40. source = "jtopjian/sensu"
  41. version = "= 0.10.5"
  42. }
  43. github = {
  44. source = "integrations/github"
  45. version = "4.2.0"
  46. }
  47. }
  48. }
  49. EOF
  50. }
  51. generate "github-provider" {
  52. path = "github-provider.tf"
  53. if_exists = "overwrite_terragrunt"
  54. contents = <<EOF
  55. #Provider block for Github engineering.
  56. #provider "github" {
  57. # organization = "mdr-engineering"
  58. # base_url = "https://github.xdr.accenturefederalcyber.com/"
  59. #}
  60. #Provider block for Github MDR Content.
  61. provider "github" {
  62. organization = "MDR-Content"
  63. base_url = "https://github.xdr.accenturefederalcyber.com/"
  64. }
  65. EOF
  66. }
  67. # Include all settings from the root terragrunt.hcl file
  68. include {
  69. path = find_in_parent_folders()
  70. }
  71. # These are the variables we have to pass in to use the module specified in the terragrunt source above
  72. inputs = {
  73. # All of the inputs from the inherited hcl files are available automatically
  74. # (via the `inputs` section of the root `terragrunt.hcl`). However, modules
  75. # will be more flexible if you specify particular input values.
  76. tags = {
  77. Purpose = "Build Docker Container with Codebuild"
  78. Terraform = "aws/${basename(get_parent_terragrunt_dir())}/${path_relative_to_include()}/"
  79. }
  80. name = "customer_portal"
  81. service_role = dependency.codebuild-ecr-base.outputs.service_role
  82. kms_key = dependency.codebuild-ecr-base.outputs.kms_key
  83. codebuild_image = "aws/codebuild/amazonlinux2-x86_64-standard:3.0"
  84. #codebuild_image = dependency.codebuild-ecr-base.outputs.codebuild_image_centos7
  85. #codebuild_image = dependency.codebuild-ecr-base.outputs.codebuild_image_rhel7
  86. artifact_s3_bucket = ""
  87. #artifact_s3_bucket = dependency.codebuild-ecr-base.outputs.artifact_s3_bucket
  88. webhook_branch_filter = "release/.*"
  89. }
  90. terraform_version_constraint = "= 0.15.1"
  91. terragrunt_version_constraint = ">= 0.29, < 0.30"