1.8.0
cloudpossebot
released this
27 Apr 21:04
·
30 commits
to refs/heads/main
since this release
Add `utils_describe_stacks` data source. Update `atmos`. Add tests @aknysh (#281)
what
- Add
utils_describe_stacks
data source - Update
atmos
- Add tests
why
- The
utils_describe_stacks
data source has the same functionality as the Atmos CLI commandatmos describe stacks
, and accepts all the parameters that the CLI command accepts, see https://atmos.tools/cli/commands/describe/stacks - The
utils_describe_stacks
data source will be used in Terraform to get configurations for stacks and components in the stacks
Terraform examples
locals {
stack = "tenant1-ue2-dev"
namespace = ""
tenant = "tenant1"
environment = "ue2"
stage = "dev"
env = {
ENVIRONMENT = local.environment
STAGE = local.stage
ATMOS_CLI_CONFIG_PATH = "."
}
result1 = yamldecode(data.utils_describe_stacks.example1.output)
result2 = yamldecode(data.utils_describe_stacks.example2.output)
result3 = yamldecode(data.utils_describe_stacks.example3.output)
result4 = yamldecode(data.utils_describe_stacks.example4.output)
result5 = yamldecode(data.utils_describe_stacks.example5.output)
result6 = yamldecode(data.utils_describe_stacks.example6.output)
result7 = yamldecode(data.utils_describe_stacks.example7.output)
}
data "utils_describe_stacks" "example1" {
}
data "utils_describe_stacks" "example2" {
stack = local.stack
}
data "utils_describe_stacks" "example3" {
namespace = local.namespace
tenant = local.tenant
environment = local.environment
stage = local.stage
env = local.env
}
data "utils_describe_stacks" "example4" {
atmos_cli_config_path = "."
atmos_base_path = "../../complete"
component_types = ["terraform"]
sections = ["none"]
}
data "utils_describe_stacks" "example5" {
component_types = ["terraform"]
components = ["top-level-component1", "test/test-component-override-3"]
sections = ["none"]
}
data "utils_describe_stacks" "example6" {
tenant = local.tenant
environment = local.environment
stage = local.stage
component_types = ["terraform"]
components = ["test/test-component-override-3"]
sections = ["vars", "metadata", "env", "workspace"]
}
data "utils_describe_stacks" "example7" {
component_types = ["terraform"]
components = ["top-level-component1"]
sections = ["vars", "workspace"]
}