# --------------------------------------------------------------------------------------------------------------------- # Global Variables and Terragrunt Configuration # --------------------------------------------------------------------------------------------------------------------- # This file takes care of the global variables. These are settings that should apply to ALL environments: prod, test, # *AND* common, across both partitions (govcloud and commercial) # # It also takes care of setting up: # The provider file # * A default provider for the account you're in # * A 'commercial' provider alias for the common services account in commercial # * A 'govcloud' provider alias for the common services account in govcloud # The backend file # * # --------------------------------------------------------------------------------------------------------------------- # Variables # --------------------------------------------------------------------------------------------------------------------- locals { # Globally ignore the checks for tfsec ignored_tfsec = [ "aws-iam-no-policy-wildcards", # We use wildcards in policies "aws-lambda-enable-tracing", # We do not enable X-Ray Tracing for Lambda "aws-s3-enable-bucket-logging", # TODO: We do not currently log s3 access. We should. MSOCI- ] # Automatically load account-level variables account_vars = read_terragrunt_config(find_in_parent_folders("account.hcl")) # Automatically load region-level variables region_vars = read_terragrunt_config(find_in_parent_folders("region.hcl")) # Automatically load partitiot-level variables partition_vars = read_terragrunt_config(find_in_parent_folders("partition.hcl")) # Automatically load environment-level variables environment_vars = read_terragrunt_config(find_in_parent_folders("env.hcl")) # Automatically load global-level variables global_vars = read_terragrunt_config(find_in_parent_folders("globals.hcl")) # Extract the variables we need for easy access account_name = local.account_vars.locals.account_name account_id = local.account_vars.locals.aws_account_id aws_region = local.region_vars.locals.aws_region aws_partition = local.partition_vars.locals.aws_partition common_services_account = local.partition_vars.locals.common_services_account legacy_account = local.environment_vars.locals.legacy_account tfstate_region = local.partition_vars.locals.tfstate_region common_profile = local.partition_vars.locals.common_profile # variables created here are available to *.hcl files in this hierarchy, but are not # automatically sent via inputs to the modules. Put global variables in global.hcl # # (Conversely, inputs are not automatically available to the hcl files) } # --------------------------------------------------------------------------------------------------------------------- # Apply Static Code Analysis # - 2022-04-23 - MSOCI-2143 - Comment out until ready # --------------------------------------------------------------------------------------------------------------------- # OS X Users, run: # brew install lint # brew install tfsec # brew install checkov # This can remain uncommented. The file won't hurt anything. generate "tflint_configuration" { path = "tflint.hcl" if_exists = "overwrite_terragrunt" contents = <