Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Golang to 1.18. Update atmos to 1.4.22. Add ENV vars to data sources #174

Merged
merged 5 commits into from
Jun 30, 2022

Conversation

aknysh
Copy link
Member

@aknysh aknysh commented Jun 30, 2022

what

  • Update Golang to 1.18
  • Update atmos to 1.4.22
  • Add ENV vars to data sources

why

  • Use the latest Golang version, it offers many new features (including the any alias instead of interface{})
  • Update to the latest version of atmos to use the latest features and improvements
  • Add ENV vars to data sources - this will allow controlling the execution of atmos, utils provider and terraform using externally set ENV vars
locals {
  component   = "test/test-component-override"
  stack       = "tenant1-ue2-dev"
  tenant      = "tenant1"
  environment = "ue2"
  stage       = "dev"

  env = {
    ENVIRONMENT           = local.environment
    STAGE                 = local.stage
    ATMOS_CLI_CONFIG_PATH = "."
  }
}

data "utils_component_config" "example1" {
  component     = local.component
  stack         = local.stack
  ignore_errors = false
  env           = local.env
}
  • In particular, the latest atmos version supports ATMOS_CLI_CONFIG_PATH ENV var to set the path to atmos.yaml CLI config file. This ENV var will allow using the monorepo pattern by loading a remote repo and pointing to its atmos.yaml using ATMOS_CLI_CONFIG_PATH ENV var
module "monorepo" {
  source = "git::ssh://[email protected]/ACME/infrastructure.git?ref=v0.0.1"
}

locals {
  monorepo_local_path  = "${path.module}/.terraform/modules/monorepo"
}

module "iam_roles" {
  source  = "git::ssh://[email protected]/ACME/infrastructure.git//components/terraform/account-map/modules/iam-roles?ref=v0.0.1"
  
  env = {
     ATMOS_CLI_CONFIG_PATH = "${path.module}/.terraform/modules/monorepo/rootfs/usr/local/etc/atmos"
  } 
  
  depends_on = [module.monorepo]
}

references

@aknysh aknysh added the patch A minor, backward compatible change label Jun 30, 2022
@aknysh aknysh requested review from osterman, goruha, Nuru and nitrocode June 30, 2022 02:50
@aknysh aknysh requested review from a team as code owners June 30, 2022 02:50
@aknysh aknysh self-assigned this Jun 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch A minor, backward compatible change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants