diff --git a/examples/data-sources/utils_spacelift_stack_config/atmos.yaml b/examples/data-sources/utils_spacelift_stack_config/atmos.yaml index 2d5952d..3907410 100644 --- a/examples/data-sources/utils_spacelift_stack_config/atmos.yaml +++ b/examples/data-sources/utils_spacelift_stack_config/atmos.yaml @@ -63,8 +63,12 @@ workflows: base_path: "stacks/workflows" logs: - file: "/dev/stdout" + # Can also be set using 'ATMOS_LOGS_FILE' ENV var, or '--logs-file' command-line argument + # File or standard file descriptor to write logs to + # Logs can be written to any file or any standard file descriptor, including `/dev/stdout`, `/dev/stderr` and `/dev/null` + file: "/dev/stderr" # Supported log levels: Trace, Debug, Info, Warning, Off + # Can also be set using 'ATMOS_LOGS_LEVEL' ENV var, or '--logs-level' command-line argument level: Info # Custom CLI commands diff --git a/examples/tests/stacks/catalog/terraform/template-functions-test/defaults.yaml b/examples/tests/stacks/catalog/terraform/template-functions-test/defaults.yaml index cc9b5e6..cb2f841 100644 --- a/examples/tests/stacks/catalog/terraform/template-functions-test/defaults.yaml +++ b/examples/tests/stacks/catalog/terraform/template-functions-test/defaults.yaml @@ -3,7 +3,7 @@ components: terraform: template-functions-test: - command: tofu + # command: tofu metadata: # Point to the Terraform component component: "test/template-functions-test" diff --git a/examples/tests/stacks/catalog/terraform/template-functions-test2/defaults.yaml b/examples/tests/stacks/catalog/terraform/template-functions-test2/defaults.yaml index 0042836..cd2ce46 100644 --- a/examples/tests/stacks/catalog/terraform/template-functions-test2/defaults.yaml +++ b/examples/tests/stacks/catalog/terraform/template-functions-test2/defaults.yaml @@ -31,3 +31,17 @@ components: test_30: !exec atmos terraform output template-functions-test -s {{ .stack }} --skip-init -- -json test_label_id test_31: !exec atmos terraform output template-functions-test -s {{ .stack }} --skip-init -- -json test_map test_32: !exec atmos terraform output template-functions-test -s {{ .stack }} --skip-init -- -json test_list + # Call the `!terraform.output` function with two parameters + test_40: !terraform.output template-functions-test test_label_id + test_41: !terraform.output template-functions-test test_list + test_42: !terraform.output template-functions-test test_map + # Component `template-functions-test3` is configured with the remote state backend of type `static` + test_50: !terraform.output template-functions-test3 val1 + test_51: !terraform.output template-functions-test3 {{ .stack }} val1 + test_52: !terraform.output template-functions-test3 val2 + test_53: !terraform.output template-functions-test3 val3 + test_54: !terraform.output template-functions-test3 val4 + test_55: !terraform.output template-functions-test3 val5 + test_56: !terraform.output template-functions-test3 val6 + # test_57: !terraform.output does_not_exist val6 + # test_57: !terraform.output template-functions-test3 invalid-val diff --git a/examples/tests/stacks/catalog/terraform/template-functions-test3/defaults.yaml b/examples/tests/stacks/catalog/terraform/template-functions-test3/defaults.yaml new file mode 100644 index 0000000..b0ce720 --- /dev/null +++ b/examples/tests/stacks/catalog/terraform/template-functions-test3/defaults.yaml @@ -0,0 +1,20 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + +components: + terraform: + template-functions-test3: + remote_state_backend_type: static + remote_state_backend: + static: + val1: true + val2: "2" + val3: 3 + val4: null + val5: + - item1 + - item2 + - item3 + val6: + i1: 1 + i2: 2 + i3: 3 diff --git a/examples/tests/stacks/orgs/cp/tenant1/prod/us-east-2.yaml b/examples/tests/stacks/orgs/cp/tenant1/prod/us-east-2.yaml index bc33175..d972320 100644 --- a/examples/tests/stacks/orgs/cp/tenant1/prod/us-east-2.yaml +++ b/examples/tests/stacks/orgs/cp/tenant1/prod/us-east-2.yaml @@ -15,8 +15,9 @@ import: - catalog/terraform/spacelift/infrastructure-tenant1 # Configurations to test `atmos.Component` template function - # - catalog/terraform/template-functions-test/defaults - # - catalog/terraform/template-functions-test2/defaults + # - catalog/terraform/template-functions-test/defaults + # - catalog/terraform/template-functions-test2/defaults + # - catalog/terraform/template-functions-test3/defaults components: terraform: diff --git a/examples/tests/stacks/teams/testing-overrides.yaml b/examples/tests/stacks/teams/testing-overrides.yaml index c2b2a55..71b7c36 100644 --- a/examples/tests/stacks/teams/testing-overrides.yaml +++ b/examples/tests/stacks/teams/testing-overrides.yaml @@ -27,7 +27,7 @@ terraform: # The `testing` Team uses `tofu` instead of `terraform` # https://opentofu.org # The commands `atmos terraform ...` will execute the `tofu` binary - command: tofu + # command: tofu # Helmfile overrides # Override the variables, env, command and settings ONLY in the Helmfile components managed by the `testing` Team. diff --git a/go.mod b/go.mod index f0ac919..19cbb1a 100644 --- a/go.mod +++ b/go.mod @@ -3,8 +3,8 @@ module github.com/cloudposse/terraform-provider-utils go 1.23 require ( - github.com/cloudposse/atmos v1.122.0 - github.com/gruntwork-io/terratest v0.48.0 + github.com/cloudposse/atmos v1.130.0 + github.com/gruntwork-io/terratest v0.48.1 github.com/hashicorp/terraform-plugin-docs v0.20.1 github.com/hashicorp/terraform-plugin-sdk/v2 v2.35.0 github.com/json-iterator/go v1.1.12 @@ -79,6 +79,7 @@ require ( github.com/chainguard-dev/git-urls v1.0.2 // indirect github.com/charmbracelet/bubbles v0.20.0 // indirect github.com/charmbracelet/bubbletea v1.2.4 // indirect + github.com/charmbracelet/harmonica v0.2.0 // indirect github.com/charmbracelet/huh v0.6.0 // indirect github.com/charmbracelet/lipgloss v1.0.0 // indirect github.com/charmbracelet/x/ansi v0.4.5 // indirect @@ -115,6 +116,7 @@ require ( github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/gobwas/glob v0.2.3 // indirect + github.com/gofrs/flock v0.12.1 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/golang/snappy v0.0.4 // indirect diff --git a/go.sum b/go.sum index c281435..a7c1210 100644 --- a/go.sum +++ b/go.sum @@ -351,6 +351,8 @@ github.com/charmbracelet/bubbles v0.20.0 h1:jSZu6qD8cRQ6k9OMfR1WlM+ruM8fkPWkHvQW github.com/charmbracelet/bubbles v0.20.0/go.mod h1:39slydyswPy+uVOHZ5x/GjwVAFkCsV8IIVy+4MhzwwU= github.com/charmbracelet/bubbletea v1.2.4 h1:KN8aCViA0eps9SCOThb2/XPIlea3ANJLUkv3KnQRNCE= github.com/charmbracelet/bubbletea v1.2.4/go.mod h1:Qr6fVQw+wX7JkWWkVyXYk/ZUQ92a6XNekLXa3rR18MM= +github.com/charmbracelet/harmonica v0.2.0 h1:8NxJWRWg/bzKqqEaaeFNipOu77YR5t8aSwG4pgaUBiQ= +github.com/charmbracelet/harmonica v0.2.0/go.mod h1:KSri/1RMQOZLbw7AHqgcBycp8pgJnQMYYT8QZRqZ1Ao= github.com/charmbracelet/huh v0.6.0 h1:mZM8VvZGuE0hoDXq6XLxRtgfWyTI3b2jZNKh0xWmax8= github.com/charmbracelet/huh v0.6.0/go.mod h1:GGNKeWCeNzKpEOh/OJD8WBwTQjV3prFAtQPpLv+AVwU= github.com/charmbracelet/lipgloss v1.0.0 h1:O7VkGDvqEdGi93X+DeqsQ7PKHDgtQfF8j8/O2qFMQNg= @@ -370,8 +372,8 @@ github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= -github.com/cloudposse/atmos v1.122.0 h1:pkxzSi2piVAOn9ZfD/k7kgtf0uwvemFbEL0HZ39OiMo= -github.com/cloudposse/atmos v1.122.0/go.mod h1:D6RhKD/jWRc+LHqUicpg/MOAV/cFoSZL8DZ0hK7q+6Y= +github.com/cloudposse/atmos v1.130.0 h1:sGyVV2EL8vEahxKX/YrjKtr7HBFWuaM06BlGOdBsmOU= +github.com/cloudposse/atmos v1.130.0/go.mod h1:rP9bST7SkafQNFVVCf6cI4YKGJbBvjiAtmigbinC+CI= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= @@ -509,6 +511,8 @@ github.com/go-test/deep v1.0.7/go.mod h1:QV8Hv/iy04NyLBxAdO9njL0iVPN1S4d/A3NVv1V github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/gofrs/flock v0.12.1 h1:MTLVXXHf8ekldpJk3AKicLij9MdwOWkZ+a/jHHZby9E= +github.com/gofrs/flock v0.12.1/go.mod h1:9zxTsyu5xtJ9DK+1tFZyibEV7y3uwDxPPfbxeeHCoD0= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= @@ -646,8 +650,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4 github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 h1:bkypFPDjIYGfCYD5mRBvpqxfYX1YCS1PXdKYWi8FsN0= github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0/go.mod h1:P+Lt/0by1T8bfcF3z737NnSbmxQAppXMRziHUxPOC8k= -github.com/gruntwork-io/terratest v0.48.0 h1:OoqJYAnBxejInn7TPizFGJNMCFvPHbiWNS3hGFKdHhA= -github.com/gruntwork-io/terratest v0.48.0/go.mod h1:U2EQW4Odlz75XJUH16Kqkr9c93p+ZZtkpVez7GkZFa4= +github.com/gruntwork-io/terratest v0.48.1 h1:pnydDjkWbZCUYXvQkr24y21fBo8PfJC5hRGdwbl1eXM= +github.com/gruntwork-io/terratest v0.48.1/go.mod h1:U2EQW4Odlz75XJUH16Kqkr9c93p+ZZtkpVez7GkZFa4= github.com/hairyhenderson/go-fsimpl v0.0.0-20220529183339-9deae3e35047 h1:nSSfN9G8O8XXDqB3aDEHJ8K+0llYYToNlTcWOe1Pti8= github.com/hairyhenderson/go-fsimpl v0.0.0-20220529183339-9deae3e35047/go.mod h1:30RY4Ey+bg+BGKBufZE2IEmxk7hok9U9mjdgZYomwN4= github.com/hairyhenderson/gomplate/v3 v3.11.8 h1:T63wLRk+Y9C601ChYa/+FZ30XT/UEWydMDZhOOJM3K0=