From 1368b5430095c1886e87ef8b0b5a13bcaa6a4c74 Mon Sep 17 00:00:00 2001 From: "Erik Osterman (CEO @ Cloud Posse)" Date: Fri, 15 Nov 2024 08:49:35 -0600 Subject: [PATCH 1/5] Update gettings started, add $schema directive at the top of files (#769) * Remove invalid references * Add yaml-language-server * validate YAML schemas * try to fix validation * document editor configuration * fix FAQ video * document workaround for complex types * document how to use JSON with atmos.Component * reformat as definition list * adjust css. improve filesystem layout docs * fix indent * remove duplicate text * fix tabs/spaces * reformat * clarify documentation relative to example --------- Co-authored-by: Andriy Knysh --- .github/workflows/test.yml | 32 +++ examples/README.md | 48 ++-- .../demo-context/stacks/catalog/demo.yaml | 2 + .../demo-context/stacks/deploy/_defaults.yaml | 2 + .../demo-context/stacks/deploy/dev/demo.yaml | 2 + .../demo-context/stacks/deploy/prod/demo.yaml | 2 + .../stacks/deploy/staging/demo.yaml | 2 + .../demo-helmfile/stacks/catalog/demo.yaml | 2 + .../demo-helmfile/stacks/deploy/dev/demo.yaml | 2 + .../stacks/deploy/prod/demo.yaml | 2 + .../stacks/deploy/staging/demo.yaml | 2 + examples/demo-helmfile/stacks/mixins/k3s.yaml | 2 + .../demo-localstack/stacks/catalog/demo.yaml | 2 + .../stacks/deploy/dev/demo.yaml | 3 + .../stacks/deploy/prod/demo.yaml | 2 + .../stacks/deploy/staging/demo.yaml | 2 + .../stacks/mixins/localstack.yaml | 2 + .../demo-stacks/stacks/catalog/myapp.yaml | 2 + examples/demo-stacks/stacks/deploy/dev.yaml | 2 + examples/demo-stacks/stacks/deploy/prod.yaml | 4 +- .../demo-stacks/stacks/deploy/staging.yaml | 4 +- .../demo-workflows/stacks/catalog/myapp.yaml | 1 + .../demo-workflows/stacks/deploy/dev.yaml | 1 + .../demo-workflows/stacks/deploy/prod.yaml | 1 + .../demo-workflows/stacks/deploy/staging.yaml | 1 + .../stacks/catalog/station.yaml | 2 + .../quick-start-simple/stacks/deploy/dev.yaml | 2 + .../stacks/deploy/prod.yaml | 2 + .../stacks/deploy/staging.yaml | 2 + .../stacks/catalog/helmfile/echo-server.yaml | 2 + .../helmfile/infra-server-override.yaml | 2 + .../stacks/catalog/helmfile/infra-server.yaml | 2 + .../invalid-import-1.yaml | 2 + .../invalid-import-2.yaml | 2 + .../invalid-import-3.yaml | 2 + .../invalid-import-4.yaml | 2 + .../invalid-import-5.yaml | 2 + .../invalid-import-6.yaml | 2 + .../invalid-import-7.yaml | 2 + .../invalid-import-8.yaml | 2 + .../invalid-import-9.yaml | 2 + .../invalid-schema-1.yaml | 2 + .../invalid-schema-10.yaml | 2 + .../invalid-schema-11.yaml | 2 + .../invalid-schema-12.yaml | 2 + .../invalid-schema-13.yaml | 2 + .../invalid-schema-14.yaml | 2 + .../invalid-schema-15.yaml | 2 + .../invalid-schema-2.yaml | 2 + .../invalid-schema-3.yaml | 2 + .../invalid-schema-4.yaml | 2 + .../invalid-schema-5.yaml | 2 + .../invalid-schema-6.yaml | 2 + .../invalid-schema-7.yaml | 2 + .../invalid-schema-8.yaml | 2 + .../invalid-schema-9.yaml | 2 + .../invalid-yaml-1.yaml | 2 + .../invalid-yaml-2.yaml | 2 + .../invalid-yaml-3.yaml | 2 + .../invalid-yaml-4.yaml | 2 + .../invalid-yaml-5.yaml | 2 + .../invalid-yaml-6.yaml | 2 + .../invalid-yaml-7.yaml | 2 + .../catalog/terraform/base-component-1.yaml | 2 + .../catalog/terraform/base-component-2.yaml | 2 + .../catalog/terraform/base-component-3.yaml | 2 + .../catalog/terraform/base-component-4.yaml | 2 + .../terraform/derived-component-1.yaml | 2 + .../terraform/derived-component-2.yaml | 2 + .../terraform/derived-component-3.yaml | 2 + .../terraform/derived-component-4.yaml | 2 + .../terraform/derived-component-5.yaml | 2 + .../catalog/terraform/eks_cluster_tmpl.yaml | 2 + .../eks_cluster_tmpl_hierarchical.yaml | 2 + .../catalog/terraform/mixins/test-1.yaml | 2 + .../catalog/terraform/mixins/test-2.yaml | 2 + .../terraform/service-iam-role/defaults.tmpl | 2 + .../webservices/defaults.tmpl | 4 +- .../webservices/prod.defaults.tmpl | 6 +- .../service-iam-role/webservices/prod.yaml | 2 + .../services/service-1-override-2.yaml | 2 + .../services/service-1-override.yaml | 2 + .../catalog/terraform/services/service-1.yaml | 2 + .../services/service-2-override-2.yaml | 2 + .../services/service-2-override.yaml | 2 + .../catalog/terraform/services/service-2.yaml | 2 + .../services/top-level-service-1.yaml | 2 + .../services/top-level-service-2.yaml | 2 + .../spacelift-and-backend-override-1.yaml | 2 + .../catalog/terraform/spacelift/defaults.yaml | 2 + .../spacelift/infrastructure-tenant1.yaml | 2 + .../spacelift/infrastructure-tenant2.yaml | 2 + .../template-functions-test/defaults.yaml | 2 + .../template-functions-test2/defaults.yaml | 2 + .../catalog/terraform/tenant1-ue2-dev.yaml | 2 + .../catalog/terraform/tenant2-ue2-dev.yaml | 2 + .../catalog/terraform/test-component-2.yaml | 2 + .../terraform/test-component-override-2.yaml | 2 + .../terraform/test-component-override-3.yaml | 2 + .../terraform/test-component-override.yaml | 2 + .../catalog/terraform/test-component.yaml | 2 + .../terraform/top-level-component1.yaml | 2 + .../terraform/top-level-component2.yaml | 2 + .../terraform/top-level-component3.yaml | 2 + .../tests/stacks/catalog/terraform/vpc.yaml | 2 + .../stacks/mixins/region/global-region.yaml | 2 + .../stacks/mixins/region/region_tmpl.yaml | 2 + .../tests/stacks/mixins/region/us-east-1.yaml | 2 + .../tests/stacks/mixins/region/us-east-2.yaml | 2 + .../tests/stacks/mixins/region/us-west-1.yaml | 2 + .../tests/stacks/mixins/region/us-west-2.yaml | 2 + examples/tests/stacks/mixins/stage/dev.yaml | 2 + examples/tests/stacks/mixins/stage/prod.yaml | 2 + .../tests/stacks/mixins/stage/staging.yaml | 2 + examples/tests/stacks/mixins/stage/test1.yaml | 2 + examples/tests/stacks/orgs/cp/_defaults.yaml | 2 + .../stacks/orgs/cp/tenant1/_defaults.yaml | 2 + .../stacks/orgs/cp/tenant1/dev/_defaults.yaml | 2 + .../orgs/cp/tenant1/dev/global-region.yaml | 2 + .../orgs/cp/tenant1/dev/us-east-2-extras.yaml | 2 + .../stacks/orgs/cp/tenant1/dev/us-east-2.yaml | 2 + .../stacks/orgs/cp/tenant1/dev/us-west-2.yaml | 2 + .../orgs/cp/tenant1/prod/_defaults.yaml | 2 + .../orgs/cp/tenant1/prod/global-region.yaml | 2 + .../orgs/cp/tenant1/prod/us-east-2.yaml | 2 + .../orgs/cp/tenant1/staging/_defaults.yaml | 2 + .../cp/tenant1/staging/global-region.yaml | 2 + .../orgs/cp/tenant1/staging/us-east-2.yaml | 2 + .../orgs/cp/tenant1/test1/_defaults.yaml | 2 + .../orgs/cp/tenant1/test1/global-region.yaml | 2 + .../orgs/cp/tenant1/test1/us-east-2.yaml | 2 + .../orgs/cp/tenant1/test1/us-west-1.yaml | 2 + .../orgs/cp/tenant1/test1/us-west-2.yaml | 2 + .../stacks/orgs/cp/tenant2/_defaults.yaml | 3 + .../stacks/orgs/cp/tenant2/dev/_defaults.yaml | 2 + .../orgs/cp/tenant2/dev/global-region.yaml | 2 + .../stacks/orgs/cp/tenant2/dev/us-east-2.yaml | 2 + .../orgs/cp/tenant2/prod/_defaults.yaml | 2 + .../orgs/cp/tenant2/prod/global-region.yaml | 2 + .../orgs/cp/tenant2/prod/us-east-2.yaml | 2 + examples/tests/stacks/teams/devops.yaml | 2 + examples/tests/stacks/teams/testing.yaml | 2 + website/docs/best-practices/stacks.mdx | 2 +- .../commands/describe/describe-dependents.mdx | 29 ++- .../components/terraform/brownfield.mdx | 2 +- .../projects/configuration/configuration.mdx | 4 +- .../docs/core-concepts/projects/layout.mdx | 91 +++++-- .../core-concepts/projects/setup-editor.mdx | 239 ++++++++++++++++++ .../core-concepts/share-data/share-data.mdx | 2 +- .../core-concepts/stacks/dependencies.mdx | 30 ++- .../templates/functions/atmos.Component.mdx | 57 ++++- .../stacks/templates/templates.mdx | 31 ++- website/docs/introduction/faq.mdx | 10 +- .../quick-start/advanced/configure-cli.mdx | 2 +- .../docs/quick-start/simple/configure-cli.mdx | 2 +- website/src/css/landing-page.css | 235 ++++++++--------- 156 files changed, 904 insertions(+), 200 deletions(-) create mode 100644 website/docs/core-concepts/projects/setup-editor.mdx diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d2a5b1c09..778478c38 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -329,3 +329,35 @@ jobs: --recursive --config=${{ github.workspace }}/examples/.tflint.hcl fail_on_error: true + + # run other demo tests + validate: + name: "[validate] ${{ matrix.demo-folder }}" + needs: build + runs-on: ubuntu-latest + strategy: + matrix: + demo-folder: + - demo-context + - demo-localstack + - demo-stacks + - demo-helmfile + - quick-start-advanced + - quick-start-simple + + timeout-minutes: 20 + steps: + - name: Check out code + uses: actions/checkout@v4 + + - name: Validate YAML Schema + uses: InoUno/yaml-ls-check@v1.4.0 + with: + root: "examples/${{ matrix.demo-folder }}/stacks" + schemaMapping: | + { + "https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json": [ + "examples/${{ matrix.demo-folder }}/stacks/**/*.yaml", + "examples/${{ matrix.demo-folder }}/stacks/**/*.yml" + ] + } diff --git a/examples/README.md b/examples/README.md index d11939411..39fc35b9b 100644 --- a/examples/README.md +++ b/examples/README.md @@ -1,35 +1,27 @@ # Examples > [!TIP] - > ### You can try `atmos` directly in your browser using GitHub Codespaces! - > - > [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new?hide_repo_select=true&ref=main&repo=cloudposse/atmos&skip_quickstart=true) - > - > Already start one? Find it [here](https://github.com/codespaces). - > +> ### You can try `atmos` directly in your browser using GitHub Codespaces! +> +> [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new?hide_repo_select=true&ref=main&repo=cloudposse/atmos&skip_quickstart=true) +> +> Already start one? Find it [here](https://github.com/codespaces). +> ## Try it Locally -To play with these demos locally, start by [installing `atmos`](https://atmos.tools/install). +To play with these demos locally, start by [installing `atmos`](https://atmos.tools/install). -Then run the following commands (Note, these commands requires that you have `curl` and `tar` installed on your system.) +Then, clone this repo and [try out the demos](https://github.com/cloudposse/atmos/tree/main/examples). ```shell -atmos demo download -``` +# Clone this repo +git clone git@github.com:cloudposse/atmos.git -For example, the following command will download the `demo-stacks` example. -```shell -atmos demo download demo-stacks +# Try the examples: https://github.com/cloudposse/atmos/tree/main/examples +cd examples/ ``` -> [!TIP] -> #### Fun Fact -> -> The `download` command is a [custom command](https://atmos.tools/core-concepts/custom-commands) added to the default `atmos.yaml`. -> - - ## Demos We designed the demos to be basic examples showcasing functionality. Expect some redundancies and overlap since we reuse examples to demonstrate specific behaviors. Each demo focuses on one area to reduce complexity and make it easier to grasp the concepts. @@ -37,12 +29,16 @@ We designed the demos to be basic examples showcasing functionality. Expect some Think of each demo folder as representing an example of a standalone repository. To make it easier, we put all the demos in one place. ```shell -1. ├── demo-stacks/ # Start your journey here -2. ├── demo-library/ # -3. ├── demo-validation/ # -4. ├── demo-vendoring/ # -5. ├── demo-custom-commands/ # -6. └── demo-workflows/ # +1. ├── demo-stacks/ # Kickstart your journey by exploring stack configurations and their structure. +2. ├── demo-library/ # Explore a reusable component library designed for seamless vendoring. +3. ├── demo-vendoring/ # Learn how to use vendoring to download and integrate remote dependencies from the `demo-library`. +4. ├── demo-validation/ # Validate your configurations to ensure correctness and compliance. +5. ├── demo-localstack/ # Leverage LocalStack to provision an S3 bucket using Atmos and Terraform. +6. ├── demo-helmfile/ # Deploy NGINX on a local lightweight Kubernetes cluster (k3s) using Helm. +7. ├── demo-custom-command/ # Learn how to extend Atmos with your own custom CLI commands. +8. ├── demo-component-versions/ # Discover how to manage and use multiple versions of components effectively. +9. ├── demo-context/ # Simplify resource naming and tagging with our Terraform context provider. +10. └── demo-workflows/ # Automate repetitive tasks with streamlined workflows. ``` ## Playground diff --git a/examples/demo-context/stacks/catalog/demo.yaml b/examples/demo-context/stacks/catalog/demo.yaml index e55af898a..1baf43b9a 100644 --- a/examples/demo-context/stacks/catalog/demo.yaml +++ b/examples/demo-context/stacks/catalog/demo.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + components: terraform: demo: diff --git a/examples/demo-context/stacks/deploy/_defaults.yaml b/examples/demo-context/stacks/deploy/_defaults.yaml index 5a4229d07..2081dc27f 100644 --- a/examples/demo-context/stacks/deploy/_defaults.yaml +++ b/examples/demo-context/stacks/deploy/_defaults.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + terraform: backend_type: local diff --git a/examples/demo-context/stacks/deploy/dev/demo.yaml b/examples/demo-context/stacks/deploy/dev/demo.yaml index cb1acecb4..4143e7826 100644 --- a/examples/demo-context/stacks/deploy/dev/demo.yaml +++ b/examples/demo-context/stacks/deploy/dev/demo.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: - deploy/_defaults - catalog/demo diff --git a/examples/demo-context/stacks/deploy/prod/demo.yaml b/examples/demo-context/stacks/deploy/prod/demo.yaml index e8893c6c9..69eed337c 100644 --- a/examples/demo-context/stacks/deploy/prod/demo.yaml +++ b/examples/demo-context/stacks/deploy/prod/demo.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: - deploy/_defaults - catalog/demo diff --git a/examples/demo-context/stacks/deploy/staging/demo.yaml b/examples/demo-context/stacks/deploy/staging/demo.yaml index e53c5586d..1a0d4f6a0 100644 --- a/examples/demo-context/stacks/deploy/staging/demo.yaml +++ b/examples/demo-context/stacks/deploy/staging/demo.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: - deploy/_defaults - catalog/demo diff --git a/examples/demo-helmfile/stacks/catalog/demo.yaml b/examples/demo-helmfile/stacks/catalog/demo.yaml index 5e6b8c03a..4dbecffe4 100644 --- a/examples/demo-helmfile/stacks/catalog/demo.yaml +++ b/examples/demo-helmfile/stacks/catalog/demo.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + components: helmfile: demo: diff --git a/examples/demo-helmfile/stacks/deploy/dev/demo.yaml b/examples/demo-helmfile/stacks/deploy/dev/demo.yaml index 7e185ee39..343f9ade9 100644 --- a/examples/demo-helmfile/stacks/deploy/dev/demo.yaml +++ b/examples/demo-helmfile/stacks/deploy/dev/demo.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: - mixins/k3s - catalog/demo diff --git a/examples/demo-helmfile/stacks/deploy/prod/demo.yaml b/examples/demo-helmfile/stacks/deploy/prod/demo.yaml index 3bff77241..be4da667a 100644 --- a/examples/demo-helmfile/stacks/deploy/prod/demo.yaml +++ b/examples/demo-helmfile/stacks/deploy/prod/demo.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: - mixins/k3s - catalog/demo diff --git a/examples/demo-helmfile/stacks/deploy/staging/demo.yaml b/examples/demo-helmfile/stacks/deploy/staging/demo.yaml index ea75d03a8..9329af114 100644 --- a/examples/demo-helmfile/stacks/deploy/staging/demo.yaml +++ b/examples/demo-helmfile/stacks/deploy/staging/demo.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: - mixins/k3s - catalog/demo diff --git a/examples/demo-helmfile/stacks/mixins/k3s.yaml b/examples/demo-helmfile/stacks/mixins/k3s.yaml index 9f508cfd7..e73da9740 100644 --- a/examples/demo-helmfile/stacks/mixins/k3s.yaml +++ b/examples/demo-helmfile/stacks/mixins/k3s.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + env: # Configure `kubectl` to use the `kubeconfig.yaml` file generated by the K3s server # This needs to be an absolute path, since `helmfile` is executed from the component's directory diff --git a/examples/demo-localstack/stacks/catalog/demo.yaml b/examples/demo-localstack/stacks/catalog/demo.yaml index b1517071b..f2717dd3c 100644 --- a/examples/demo-localstack/stacks/catalog/demo.yaml +++ b/examples/demo-localstack/stacks/catalog/demo.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + components: terraform: demo: diff --git a/examples/demo-localstack/stacks/deploy/dev/demo.yaml b/examples/demo-localstack/stacks/deploy/dev/demo.yaml index 4f370497e..2189e8367 100644 --- a/examples/demo-localstack/stacks/deploy/dev/demo.yaml +++ b/examples/demo-localstack/stacks/deploy/dev/demo.yaml @@ -1,3 +1,6 @@ + +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: - mixins/localstack - catalog/demo diff --git a/examples/demo-localstack/stacks/deploy/prod/demo.yaml b/examples/demo-localstack/stacks/deploy/prod/demo.yaml index ff1c9203a..cf997f8f1 100644 --- a/examples/demo-localstack/stacks/deploy/prod/demo.yaml +++ b/examples/demo-localstack/stacks/deploy/prod/demo.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: - mixins/localstack - catalog/demo diff --git a/examples/demo-localstack/stacks/deploy/staging/demo.yaml b/examples/demo-localstack/stacks/deploy/staging/demo.yaml index 306cf0b3e..56da15247 100644 --- a/examples/demo-localstack/stacks/deploy/staging/demo.yaml +++ b/examples/demo-localstack/stacks/deploy/staging/demo.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: - mixins/localstack - catalog/demo diff --git a/examples/demo-localstack/stacks/mixins/localstack.yaml b/examples/demo-localstack/stacks/mixins/localstack.yaml index cfc4d2f43..3713c5de7 100644 --- a/examples/demo-localstack/stacks/mixins/localstack.yaml +++ b/examples/demo-localstack/stacks/mixins/localstack.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + env: # We need to ensure no profile is set when using LocalStack, or the AWS SDK will try to use it AWS_PROFILE: "" diff --git a/examples/demo-stacks/stacks/catalog/myapp.yaml b/examples/demo-stacks/stacks/catalog/myapp.yaml index 9d4fe3f77..4fef54e38 100644 --- a/examples/demo-stacks/stacks/catalog/myapp.yaml +++ b/examples/demo-stacks/stacks/catalog/myapp.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + components: terraform: myapp: diff --git a/examples/demo-stacks/stacks/deploy/dev.yaml b/examples/demo-stacks/stacks/deploy/dev.yaml index 9df297c70..cf7bff682 100644 --- a/examples/demo-stacks/stacks/deploy/dev.yaml +++ b/examples/demo-stacks/stacks/deploy/dev.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + vars: stage: dev diff --git a/examples/demo-stacks/stacks/deploy/prod.yaml b/examples/demo-stacks/stacks/deploy/prod.yaml index 968a5dfdd..cb1be2d2a 100644 --- a/examples/demo-stacks/stacks/deploy/prod.yaml +++ b/examples/demo-stacks/stacks/deploy/prod.yaml @@ -1,6 +1,8 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + vars: stage: prod - + import: - catalog/myapp diff --git a/examples/demo-stacks/stacks/deploy/staging.yaml b/examples/demo-stacks/stacks/deploy/staging.yaml index 4c28c7470..76564823e 100644 --- a/examples/demo-stacks/stacks/deploy/staging.yaml +++ b/examples/demo-stacks/stacks/deploy/staging.yaml @@ -1,6 +1,8 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + vars: stage: staging - + import: - catalog/myapp diff --git a/examples/demo-workflows/stacks/catalog/myapp.yaml b/examples/demo-workflows/stacks/catalog/myapp.yaml index e69de29bb..7ba0f80f2 100644 --- a/examples/demo-workflows/stacks/catalog/myapp.yaml +++ b/examples/demo-workflows/stacks/catalog/myapp.yaml @@ -0,0 +1 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json diff --git a/examples/demo-workflows/stacks/deploy/dev.yaml b/examples/demo-workflows/stacks/deploy/dev.yaml index e69de29bb..7ba0f80f2 100644 --- a/examples/demo-workflows/stacks/deploy/dev.yaml +++ b/examples/demo-workflows/stacks/deploy/dev.yaml @@ -0,0 +1 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json diff --git a/examples/demo-workflows/stacks/deploy/prod.yaml b/examples/demo-workflows/stacks/deploy/prod.yaml index e69de29bb..7ba0f80f2 100644 --- a/examples/demo-workflows/stacks/deploy/prod.yaml +++ b/examples/demo-workflows/stacks/deploy/prod.yaml @@ -0,0 +1 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json diff --git a/examples/demo-workflows/stacks/deploy/staging.yaml b/examples/demo-workflows/stacks/deploy/staging.yaml index e69de29bb..7ba0f80f2 100644 --- a/examples/demo-workflows/stacks/deploy/staging.yaml +++ b/examples/demo-workflows/stacks/deploy/staging.yaml @@ -0,0 +1 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json diff --git a/examples/quick-start-simple/stacks/catalog/station.yaml b/examples/quick-start-simple/stacks/catalog/station.yaml index 842460e80..029338b5f 100644 --- a/examples/quick-start-simple/stacks/catalog/station.yaml +++ b/examples/quick-start-simple/stacks/catalog/station.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + components: terraform: station: diff --git a/examples/quick-start-simple/stacks/deploy/dev.yaml b/examples/quick-start-simple/stacks/deploy/dev.yaml index b47f7f5d2..564e1b31d 100644 --- a/examples/quick-start-simple/stacks/deploy/dev.yaml +++ b/examples/quick-start-simple/stacks/deploy/dev.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + vars: stage: dev diff --git a/examples/quick-start-simple/stacks/deploy/prod.yaml b/examples/quick-start-simple/stacks/deploy/prod.yaml index c5de58ba2..41dc8ab9e 100644 --- a/examples/quick-start-simple/stacks/deploy/prod.yaml +++ b/examples/quick-start-simple/stacks/deploy/prod.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + vars: stage: prod diff --git a/examples/quick-start-simple/stacks/deploy/staging.yaml b/examples/quick-start-simple/stacks/deploy/staging.yaml index 28b8659b4..433566867 100644 --- a/examples/quick-start-simple/stacks/deploy/staging.yaml +++ b/examples/quick-start-simple/stacks/deploy/staging.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + vars: stage: staging diff --git a/examples/tests/stacks/catalog/helmfile/echo-server.yaml b/examples/tests/stacks/catalog/helmfile/echo-server.yaml index 2686dc352..a20225c31 100644 --- a/examples/tests/stacks/catalog/helmfile/echo-server.yaml +++ b/examples/tests/stacks/catalog/helmfile/echo-server.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + components: helmfile: echo-server: diff --git a/examples/tests/stacks/catalog/helmfile/infra-server-override.yaml b/examples/tests/stacks/catalog/helmfile/infra-server-override.yaml index 35a4100f1..0dfbb3b8e 100644 --- a/examples/tests/stacks/catalog/helmfile/infra-server-override.yaml +++ b/examples/tests/stacks/catalog/helmfile/infra-server-override.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + components: helmfile: "infra/infra-server-override": diff --git a/examples/tests/stacks/catalog/helmfile/infra-server.yaml b/examples/tests/stacks/catalog/helmfile/infra-server.yaml index ca1cd3d37..b633b6a3d 100644 --- a/examples/tests/stacks/catalog/helmfile/infra-server.yaml +++ b/examples/tests/stacks/catalog/helmfile/infra-server.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + components: helmfile: "infra/infra-server": diff --git a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-import-1.yaml b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-import-1.yaml index 16497507c..3e6351811 100644 --- a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-import-1.yaml +++ b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-import-1.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: - globals/tenant1-globals-does-not-exist - catalog/terraform/test-component-does-not-exist diff --git a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-import-2.yaml b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-import-2.yaml index 9c6d023bc..4b963b61d 100644 --- a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-import-2.yaml +++ b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-import-2.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: # Test invalid import when the file imports itself - catalog/invalid-yaml-and-schema/invalid-import-2 diff --git a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-import-3.yaml b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-import-3.yaml index daf7f0647..3bede3ba4 100644 --- a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-import-3.yaml +++ b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-import-3.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: - [globals/tenant1-globals-invalid] diff --git a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-import-4.yaml b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-import-4.yaml index 87aa9a80d..551c4a5e0 100644 --- a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-import-4.yaml +++ b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-import-4.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: globals/tenant1-globals-invalid diff --git a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-import-5.yaml b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-import-5.yaml index af797e8a1..125226e3d 100644 --- a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-import-5.yaml +++ b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-import-5.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: a: globals/tenant1-globals diff --git a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-import-6.yaml b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-import-6.yaml index 78fdb5b17..75b8c9cd4 100644 --- a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-import-6.yaml +++ b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-import-6.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: globals/tenant1-globals vars: diff --git a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-import-7.yaml b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-import-7.yaml index 6c6450345..9b8bfd841 100644 --- a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-import-7.yaml +++ b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-import-7.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: - - globals/tenant1-globals diff --git a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-import-8.yaml b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-import-8.yaml index 0433f05d1..d6e318fb8 100644 --- a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-import-8.yaml +++ b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-import-8.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: vars: diff --git a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-import-9.yaml b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-import-9.yaml index 37201ac84..ab8ee7c33 100644 --- a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-import-9.yaml +++ b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-import-9.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: {} vars: diff --git a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-1.yaml b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-1.yaml index 6dc59806c..4d60b5323 100644 --- a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-1.yaml +++ b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-1.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + vars: terraform: diff --git a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-10.yaml b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-10.yaml index cf4e7ae56..9f88b2a0e 100644 --- a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-10.yaml +++ b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-10.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + vars: stage: invalid diff --git a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-11.yaml b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-11.yaml index 9aef6b4c3..04f2b1e04 100644 --- a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-11.yaml +++ b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-11.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + vars: stage: invalid diff --git a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-12.yaml b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-12.yaml index ba2fcd88d..729c8517d 100644 --- a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-12.yaml +++ b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-12.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + vars: stage: invalid diff --git a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-13.yaml b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-13.yaml index c1569f3a3..734b68df6 100644 --- a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-13.yaml +++ b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-13.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + vars: stage: invalid diff --git a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-14.yaml b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-14.yaml index 5561c4001..8b5b47f5a 100644 --- a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-14.yaml +++ b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-14.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + vars: stage: invalid diff --git a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-15.yaml b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-15.yaml index 45481dcfe..b4f9b6477 100644 --- a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-15.yaml +++ b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-15.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + vars: stage: invalid diff --git a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-2.yaml b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-2.yaml index 65ca8a7ab..ffd9e5e69 100644 --- a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-2.yaml +++ b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-2.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + vars: stage: invalid diff --git a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-3.yaml b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-3.yaml index 8e3cbdb2b..4c07d4bc5 100644 --- a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-3.yaml +++ b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-3.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + vars: stage: invalid diff --git a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-4.yaml b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-4.yaml index 0856b0e9b..e7d81626d 100644 --- a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-4.yaml +++ b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-4.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + vars: stage: invalid diff --git a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-5.yaml b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-5.yaml index 8b510aa87..6cc1a3c95 100644 --- a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-5.yaml +++ b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-5.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + vars: stage: invalid diff --git a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-6.yaml b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-6.yaml index d9ebd3893..b61e3e17f 100644 --- a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-6.yaml +++ b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-6.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + vars: stage: invalid diff --git a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-7.yaml b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-7.yaml index bbb9e75b4..16b99923c 100644 --- a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-7.yaml +++ b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-7.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + vars: stage: invalid diff --git a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-8.yaml b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-8.yaml index 51f2521be..6fdac096e 100644 --- a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-8.yaml +++ b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-8.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + vars: stage: invalid diff --git a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-9.yaml b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-9.yaml index 203f6a4b8..59a5b7264 100644 --- a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-9.yaml +++ b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-9.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + vars: stage: invalid diff --git a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-yaml-1.yaml b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-yaml-1.yaml index f25e0cef2..63fe4b350 100644 --- a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-yaml-1.yaml +++ b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-yaml-1.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: - globals/tenant1-globals - globals/ue2-globals diff --git a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-yaml-2.yaml b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-yaml-2.yaml index f7e391660..24f1a0904 100644 --- a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-yaml-2.yaml +++ b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-yaml-2.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: - globals/tenant1-globals - globals/ue2-globals diff --git a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-yaml-3.yaml b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-yaml-3.yaml index 398de310d..1ab57c46f 100644 --- a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-yaml-3.yaml +++ b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-yaml-3.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: - globals/tenant1-globals - globals/ue2-globals diff --git a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-yaml-4.yaml b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-yaml-4.yaml index 6a5afd88c..cb5d3e53a 100644 --- a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-yaml-4.yaml +++ b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-yaml-4.yaml @@ -1,2 +1,4 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + vars: - stage: invalid diff --git a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-yaml-5.yaml b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-yaml-5.yaml index 28989fb6b..1cfcc6526 100644 --- a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-yaml-5.yaml +++ b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-yaml-5.yaml @@ -1,2 +1,4 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + vars: : stage: invalid diff --git a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-yaml-6.yaml b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-yaml-6.yaml index 6fa1aa0a0..7de7e0002 100644 --- a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-yaml-6.yaml +++ b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-yaml-6.yaml @@ -1,2 +1,4 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + vars: stage: - invalid diff --git a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-yaml-7.yaml b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-yaml-7.yaml index e65a41191..a8cd33857 100644 --- a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-yaml-7.yaml +++ b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-yaml-7.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + vars: {} diff --git a/examples/tests/stacks/catalog/terraform/base-component-1.yaml b/examples/tests/stacks/catalog/terraform/base-component-1.yaml index 6546ddb6e..b2e787e37 100644 --- a/examples/tests/stacks/catalog/terraform/base-component-1.yaml +++ b/examples/tests/stacks/catalog/terraform/base-component-1.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + components: terraform: base-component-1: diff --git a/examples/tests/stacks/catalog/terraform/base-component-2.yaml b/examples/tests/stacks/catalog/terraform/base-component-2.yaml index 9f37783f2..7158fbf8e 100644 --- a/examples/tests/stacks/catalog/terraform/base-component-2.yaml +++ b/examples/tests/stacks/catalog/terraform/base-component-2.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + components: terraform: base-component-2: diff --git a/examples/tests/stacks/catalog/terraform/base-component-3.yaml b/examples/tests/stacks/catalog/terraform/base-component-3.yaml index de0003c18..26cbb63b8 100644 --- a/examples/tests/stacks/catalog/terraform/base-component-3.yaml +++ b/examples/tests/stacks/catalog/terraform/base-component-3.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: - catalog/terraform/base-component-1 diff --git a/examples/tests/stacks/catalog/terraform/base-component-4.yaml b/examples/tests/stacks/catalog/terraform/base-component-4.yaml index e1aff7e5f..80a801577 100644 --- a/examples/tests/stacks/catalog/terraform/base-component-4.yaml +++ b/examples/tests/stacks/catalog/terraform/base-component-4.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: - catalog/terraform/base-component-3 diff --git a/examples/tests/stacks/catalog/terraform/derived-component-1.yaml b/examples/tests/stacks/catalog/terraform/derived-component-1.yaml index ec2c5865b..9cf52b393 100644 --- a/examples/tests/stacks/catalog/terraform/derived-component-1.yaml +++ b/examples/tests/stacks/catalog/terraform/derived-component-1.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + components: terraform: derived-component-1: diff --git a/examples/tests/stacks/catalog/terraform/derived-component-2.yaml b/examples/tests/stacks/catalog/terraform/derived-component-2.yaml index d143f73d7..f9e34987c 100644 --- a/examples/tests/stacks/catalog/terraform/derived-component-2.yaml +++ b/examples/tests/stacks/catalog/terraform/derived-component-2.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + components: terraform: derived-component-2: diff --git a/examples/tests/stacks/catalog/terraform/derived-component-3.yaml b/examples/tests/stacks/catalog/terraform/derived-component-3.yaml index 476274366..b8a0f6a01 100644 --- a/examples/tests/stacks/catalog/terraform/derived-component-3.yaml +++ b/examples/tests/stacks/catalog/terraform/derived-component-3.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: - catalog/terraform/base-component-4 diff --git a/examples/tests/stacks/catalog/terraform/derived-component-4.yaml b/examples/tests/stacks/catalog/terraform/derived-component-4.yaml index 6bdf7938f..73452d868 100644 --- a/examples/tests/stacks/catalog/terraform/derived-component-4.yaml +++ b/examples/tests/stacks/catalog/terraform/derived-component-4.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: - catalog/terraform/base-component-4 diff --git a/examples/tests/stacks/catalog/terraform/derived-component-5.yaml b/examples/tests/stacks/catalog/terraform/derived-component-5.yaml index deeeb692f..e5581b129 100644 --- a/examples/tests/stacks/catalog/terraform/derived-component-5.yaml +++ b/examples/tests/stacks/catalog/terraform/derived-component-5.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: - catalog/terraform/base-component-3 diff --git a/examples/tests/stacks/catalog/terraform/eks_cluster_tmpl.yaml b/examples/tests/stacks/catalog/terraform/eks_cluster_tmpl.yaml index a0cbd3e15..57e73bba8 100644 --- a/examples/tests/stacks/catalog/terraform/eks_cluster_tmpl.yaml +++ b/examples/tests/stacks/catalog/terraform/eks_cluster_tmpl.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + components: terraform: # Parameterize Atmos component name diff --git a/examples/tests/stacks/catalog/terraform/eks_cluster_tmpl_hierarchical.yaml b/examples/tests/stacks/catalog/terraform/eks_cluster_tmpl_hierarchical.yaml index 473ad5056..92f753a11 100644 --- a/examples/tests/stacks/catalog/terraform/eks_cluster_tmpl_hierarchical.yaml +++ b/examples/tests/stacks/catalog/terraform/eks_cluster_tmpl_hierarchical.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: # Use `region_tmpl` `Go` template and provide `context` for it. # This can also be done by using `Go` templates in the import path itself. diff --git a/examples/tests/stacks/catalog/terraform/mixins/test-1.yaml b/examples/tests/stacks/catalog/terraform/mixins/test-1.yaml index eba614c33..aa5ba2709 100644 --- a/examples/tests/stacks/catalog/terraform/mixins/test-1.yaml +++ b/examples/tests/stacks/catalog/terraform/mixins/test-1.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + components: terraform: "mixin/test-1": diff --git a/examples/tests/stacks/catalog/terraform/mixins/test-2.yaml b/examples/tests/stacks/catalog/terraform/mixins/test-2.yaml index b92da1d87..71985a7ff 100644 --- a/examples/tests/stacks/catalog/terraform/mixins/test-2.yaml +++ b/examples/tests/stacks/catalog/terraform/mixins/test-2.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + components: terraform: "mixin/test-2": diff --git a/examples/tests/stacks/catalog/terraform/service-iam-role/defaults.tmpl b/examples/tests/stacks/catalog/terraform/service-iam-role/defaults.tmpl index 6a1494280..7d185090e 100644 --- a/examples/tests/stacks/catalog/terraform/service-iam-role/defaults.tmpl +++ b/examples/tests/stacks/catalog/terraform/service-iam-role/defaults.tmpl @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + components: terraform: service-iam-role/{{ .app_name }}/{{ .service_environment }}: diff --git a/examples/tests/stacks/catalog/terraform/service-iam-role/webservices/defaults.tmpl b/examples/tests/stacks/catalog/terraform/service-iam-role/webservices/defaults.tmpl index 0cf8aff77..f074e7281 100644 --- a/examples/tests/stacks/catalog/terraform/service-iam-role/webservices/defaults.tmpl +++ b/examples/tests/stacks/catalog/terraform/service-iam-role/webservices/defaults.tmpl @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: - path: catalog/terraform/service-iam-role/defaults.tmpl context: @@ -54,4 +56,4 @@ import: "Resource": "arn:aws:execute-api:us-east-2:xxxxxxxxxx:xxxxxxxxxx/v1/*/scheduledtask/*" } ] - }' + }' diff --git a/examples/tests/stacks/catalog/terraform/service-iam-role/webservices/prod.defaults.tmpl b/examples/tests/stacks/catalog/terraform/service-iam-role/webservices/prod.defaults.tmpl index d3f335caa..9a4d55d20 100644 --- a/examples/tests/stacks/catalog/terraform/service-iam-role/webservices/prod.defaults.tmpl +++ b/examples/tests/stacks/catalog/terraform/service-iam-role/webservices/prod.defaults.tmpl @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: - path: catalog/terraform/service-iam-role/webservices/defaults.tmpl context: @@ -25,7 +27,7 @@ import: } ] }' - - '{ + - '{ "Version": "2012-10-17", "Statement": [ { @@ -36,4 +38,4 @@ import: "Resource": "arn:aws:iam::xxxxxxxxxx:role/xxxxxxxxxx" } ] - }' + }' diff --git a/examples/tests/stacks/catalog/terraform/service-iam-role/webservices/prod.yaml b/examples/tests/stacks/catalog/terraform/service-iam-role/webservices/prod.yaml index 36b933ab3..16352c36d 100644 --- a/examples/tests/stacks/catalog/terraform/service-iam-role/webservices/prod.yaml +++ b/examples/tests/stacks/catalog/terraform/service-iam-role/webservices/prod.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: - path: catalog/terraform/service-iam-role/webservices/prod.defaults.tmpl context: diff --git a/examples/tests/stacks/catalog/terraform/services/service-1-override-2.yaml b/examples/tests/stacks/catalog/terraform/services/service-1-override-2.yaml index cf373dc5c..17f4c7441 100644 --- a/examples/tests/stacks/catalog/terraform/services/service-1-override-2.yaml +++ b/examples/tests/stacks/catalog/terraform/services/service-1-override-2.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + components: terraform: "test/test-component-override-2": diff --git a/examples/tests/stacks/catalog/terraform/services/service-1-override.yaml b/examples/tests/stacks/catalog/terraform/services/service-1-override.yaml index 1d020dada..7d0a44a79 100644 --- a/examples/tests/stacks/catalog/terraform/services/service-1-override.yaml +++ b/examples/tests/stacks/catalog/terraform/services/service-1-override.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + components: terraform: "test/test-component-override": diff --git a/examples/tests/stacks/catalog/terraform/services/service-1.yaml b/examples/tests/stacks/catalog/terraform/services/service-1.yaml index 673b5fb3e..2354f81c6 100644 --- a/examples/tests/stacks/catalog/terraform/services/service-1.yaml +++ b/examples/tests/stacks/catalog/terraform/services/service-1.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + components: terraform: "test/test-component": diff --git a/examples/tests/stacks/catalog/terraform/services/service-2-override-2.yaml b/examples/tests/stacks/catalog/terraform/services/service-2-override-2.yaml index b1c479a90..4a5b2b4e9 100644 --- a/examples/tests/stacks/catalog/terraform/services/service-2-override-2.yaml +++ b/examples/tests/stacks/catalog/terraform/services/service-2-override-2.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + components: terraform: "test/test-component-override-2": diff --git a/examples/tests/stacks/catalog/terraform/services/service-2-override.yaml b/examples/tests/stacks/catalog/terraform/services/service-2-override.yaml index aaa6deb25..dbd9e0277 100644 --- a/examples/tests/stacks/catalog/terraform/services/service-2-override.yaml +++ b/examples/tests/stacks/catalog/terraform/services/service-2-override.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + components: terraform: "test/test-component-override": diff --git a/examples/tests/stacks/catalog/terraform/services/service-2.yaml b/examples/tests/stacks/catalog/terraform/services/service-2.yaml index c8180fcb7..9d9954cdd 100644 --- a/examples/tests/stacks/catalog/terraform/services/service-2.yaml +++ b/examples/tests/stacks/catalog/terraform/services/service-2.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + components: terraform: "test/test-component": diff --git a/examples/tests/stacks/catalog/terraform/services/top-level-service-1.yaml b/examples/tests/stacks/catalog/terraform/services/top-level-service-1.yaml index f9556f807..0fe339b7e 100644 --- a/examples/tests/stacks/catalog/terraform/services/top-level-service-1.yaml +++ b/examples/tests/stacks/catalog/terraform/services/top-level-service-1.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + components: terraform: top-level-component1: diff --git a/examples/tests/stacks/catalog/terraform/services/top-level-service-2.yaml b/examples/tests/stacks/catalog/terraform/services/top-level-service-2.yaml index ec45728b3..b77d3fed6 100644 --- a/examples/tests/stacks/catalog/terraform/services/top-level-service-2.yaml +++ b/examples/tests/stacks/catalog/terraform/services/top-level-service-2.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + components: terraform: top-level-component1: diff --git a/examples/tests/stacks/catalog/terraform/spacelift-and-backend-override-1.yaml b/examples/tests/stacks/catalog/terraform/spacelift-and-backend-override-1.yaml index 34b56a350..71b405b09 100644 --- a/examples/tests/stacks/catalog/terraform/spacelift-and-backend-override-1.yaml +++ b/examples/tests/stacks/catalog/terraform/spacelift-and-backend-override-1.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + settings: spacelift: workspace_enabled: true diff --git a/examples/tests/stacks/catalog/terraform/spacelift/defaults.yaml b/examples/tests/stacks/catalog/terraform/spacelift/defaults.yaml index 96b97555c..a08694661 100644 --- a/examples/tests/stacks/catalog/terraform/spacelift/defaults.yaml +++ b/examples/tests/stacks/catalog/terraform/spacelift/defaults.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + components: terraform: spacelift-defaults: diff --git a/examples/tests/stacks/catalog/terraform/spacelift/infrastructure-tenant1.yaml b/examples/tests/stacks/catalog/terraform/spacelift/infrastructure-tenant1.yaml index 9c9d6630b..562ed855f 100644 --- a/examples/tests/stacks/catalog/terraform/spacelift/infrastructure-tenant1.yaml +++ b/examples/tests/stacks/catalog/terraform/spacelift/infrastructure-tenant1.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: - catalog/terraform/spacelift/defaults diff --git a/examples/tests/stacks/catalog/terraform/spacelift/infrastructure-tenant2.yaml b/examples/tests/stacks/catalog/terraform/spacelift/infrastructure-tenant2.yaml index b9f34cdb6..dcba37e24 100644 --- a/examples/tests/stacks/catalog/terraform/spacelift/infrastructure-tenant2.yaml +++ b/examples/tests/stacks/catalog/terraform/spacelift/infrastructure-tenant2.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: - catalog/terraform/spacelift/defaults 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 6a6d3b5f3..cd4b41cc5 100644 --- a/examples/tests/stacks/catalog/terraform/template-functions-test/defaults.yaml +++ b/examples/tests/stacks/catalog/terraform/template-functions-test/defaults.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + components: terraform: 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 218b2e587..42da9cd52 100644 --- a/examples/tests/stacks/catalog/terraform/template-functions-test2/defaults.yaml +++ b/examples/tests/stacks/catalog/terraform/template-functions-test2/defaults.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + components: terraform: template-functions-test2: diff --git a/examples/tests/stacks/catalog/terraform/tenant1-ue2-dev.yaml b/examples/tests/stacks/catalog/terraform/tenant1-ue2-dev.yaml index d4a8ac515..9a1eeb3fd 100644 --- a/examples/tests/stacks/catalog/terraform/tenant1-ue2-dev.yaml +++ b/examples/tests/stacks/catalog/terraform/tenant1-ue2-dev.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + components: terraform: "test/test-component-override": diff --git a/examples/tests/stacks/catalog/terraform/tenant2-ue2-dev.yaml b/examples/tests/stacks/catalog/terraform/tenant2-ue2-dev.yaml index d84901576..eaaac41ee 100644 --- a/examples/tests/stacks/catalog/terraform/tenant2-ue2-dev.yaml +++ b/examples/tests/stacks/catalog/terraform/tenant2-ue2-dev.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + components: terraform: "test/test-component-override": diff --git a/examples/tests/stacks/catalog/terraform/test-component-2.yaml b/examples/tests/stacks/catalog/terraform/test-component-2.yaml index 4b15fae19..83383a7cb 100644 --- a/examples/tests/stacks/catalog/terraform/test-component-2.yaml +++ b/examples/tests/stacks/catalog/terraform/test-component-2.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + components: terraform: "test/test2/test-component-2": diff --git a/examples/tests/stacks/catalog/terraform/test-component-override-2.yaml b/examples/tests/stacks/catalog/terraform/test-component-override-2.yaml index ab7f062e9..fb34c277f 100644 --- a/examples/tests/stacks/catalog/terraform/test-component-override-2.yaml +++ b/examples/tests/stacks/catalog/terraform/test-component-override-2.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + # `import` supports POSIX-style Globs for file names/paths (double-star `**` is supported) # https://en.wikipedia.org/wiki/Glob_(programming) # https://pkg.go.dev/gopkg.in/godo.v2/glob diff --git a/examples/tests/stacks/catalog/terraform/test-component-override-3.yaml b/examples/tests/stacks/catalog/terraform/test-component-override-3.yaml index 22bb4c9b1..329f2984e 100644 --- a/examples/tests/stacks/catalog/terraform/test-component-override-3.yaml +++ b/examples/tests/stacks/catalog/terraform/test-component-override-3.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + # `import` supports POSIX-style Globs for file names/paths (double-star `**` is supported) # https://en.wikipedia.org/wiki/Glob_(programming) # https://pkg.go.dev/gopkg.in/godo.v2/glob diff --git a/examples/tests/stacks/catalog/terraform/test-component-override.yaml b/examples/tests/stacks/catalog/terraform/test-component-override.yaml index ef54db4cb..2feceb0d2 100644 --- a/examples/tests/stacks/catalog/terraform/test-component-override.yaml +++ b/examples/tests/stacks/catalog/terraform/test-component-override.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + # `import` supports POSIX-style Globs for file names/paths (double-star `**` is supported) # https://en.wikipedia.org/wiki/Glob_(programming) # https://pkg.go.dev/gopkg.in/godo.v2/glob diff --git a/examples/tests/stacks/catalog/terraform/test-component.yaml b/examples/tests/stacks/catalog/terraform/test-component.yaml index 7a8a50584..530b1b110 100644 --- a/examples/tests/stacks/catalog/terraform/test-component.yaml +++ b/examples/tests/stacks/catalog/terraform/test-component.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + # `import` supports POSIX-style Globs for file names/paths (double-star `**` is supported) # https://en.wikipedia.org/wiki/Glob_(programming) # https://pkg.go.dev/gopkg.in/godo.v2/glob diff --git a/examples/tests/stacks/catalog/terraform/top-level-component1.yaml b/examples/tests/stacks/catalog/terraform/top-level-component1.yaml index 1cd1bde89..0ec355210 100644 --- a/examples/tests/stacks/catalog/terraform/top-level-component1.yaml +++ b/examples/tests/stacks/catalog/terraform/top-level-component1.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + # `import` supports POSIX-style Globs for file names/paths (double-star `**` is supported) # https://en.wikipedia.org/wiki/Glob_(programming) # https://pkg.go.dev/gopkg.in/godo.v2/glob diff --git a/examples/tests/stacks/catalog/terraform/top-level-component2.yaml b/examples/tests/stacks/catalog/terraform/top-level-component2.yaml index 37843a45e..6128a7db7 100644 --- a/examples/tests/stacks/catalog/terraform/top-level-component2.yaml +++ b/examples/tests/stacks/catalog/terraform/top-level-component2.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: - catalog/terraform/services/top-level-service-?.* diff --git a/examples/tests/stacks/catalog/terraform/top-level-component3.yaml b/examples/tests/stacks/catalog/terraform/top-level-component3.yaml index 24fa6e629..60cf8a7b0 100644 --- a/examples/tests/stacks/catalog/terraform/top-level-component3.yaml +++ b/examples/tests/stacks/catalog/terraform/top-level-component3.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: - catalog/terraform/services/top-level-service-?.* diff --git a/examples/tests/stacks/catalog/terraform/vpc.yaml b/examples/tests/stacks/catalog/terraform/vpc.yaml index 42a42a03a..41625ca67 100644 --- a/examples/tests/stacks/catalog/terraform/vpc.yaml +++ b/examples/tests/stacks/catalog/terraform/vpc.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + components: terraform: infra/vpc: diff --git a/examples/tests/stacks/mixins/region/global-region.yaml b/examples/tests/stacks/mixins/region/global-region.yaml index 384b4c06b..6bfbdb911 100644 --- a/examples/tests/stacks/mixins/region/global-region.yaml +++ b/examples/tests/stacks/mixins/region/global-region.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + vars: region: us-east-2 environment: gbl diff --git a/examples/tests/stacks/mixins/region/region_tmpl.yaml b/examples/tests/stacks/mixins/region/region_tmpl.yaml index b2977d798..a83568518 100644 --- a/examples/tests/stacks/mixins/region/region_tmpl.yaml +++ b/examples/tests/stacks/mixins/region/region_tmpl.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + vars: region: "{{ .region }}" environment: "{{ .environment }}" diff --git a/examples/tests/stacks/mixins/region/us-east-1.yaml b/examples/tests/stacks/mixins/region/us-east-1.yaml index 0676d2e24..125008c3a 100644 --- a/examples/tests/stacks/mixins/region/us-east-1.yaml +++ b/examples/tests/stacks/mixins/region/us-east-1.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + vars: region: us-east-1 environment: ue1 diff --git a/examples/tests/stacks/mixins/region/us-east-2.yaml b/examples/tests/stacks/mixins/region/us-east-2.yaml index b073d02b5..7a2d4941c 100644 --- a/examples/tests/stacks/mixins/region/us-east-2.yaml +++ b/examples/tests/stacks/mixins/region/us-east-2.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + vars: region: us-east-2 environment: ue2 diff --git a/examples/tests/stacks/mixins/region/us-west-1.yaml b/examples/tests/stacks/mixins/region/us-west-1.yaml index 8f2c156c9..7990c1335 100644 --- a/examples/tests/stacks/mixins/region/us-west-1.yaml +++ b/examples/tests/stacks/mixins/region/us-west-1.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + vars: region: us-west-1 environment: uw1 diff --git a/examples/tests/stacks/mixins/region/us-west-2.yaml b/examples/tests/stacks/mixins/region/us-west-2.yaml index c8fa64019..349ca4964 100644 --- a/examples/tests/stacks/mixins/region/us-west-2.yaml +++ b/examples/tests/stacks/mixins/region/us-west-2.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + vars: region: us-west-2 environment: uw2 diff --git a/examples/tests/stacks/mixins/stage/dev.yaml b/examples/tests/stacks/mixins/stage/dev.yaml index 2b0a1fb5a..3c6b84880 100644 --- a/examples/tests/stacks/mixins/stage/dev.yaml +++ b/examples/tests/stacks/mixins/stage/dev.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + vars: stage: dev diff --git a/examples/tests/stacks/mixins/stage/prod.yaml b/examples/tests/stacks/mixins/stage/prod.yaml index 9739ed2a0..8f7619eba 100644 --- a/examples/tests/stacks/mixins/stage/prod.yaml +++ b/examples/tests/stacks/mixins/stage/prod.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + vars: stage: prod diff --git a/examples/tests/stacks/mixins/stage/staging.yaml b/examples/tests/stacks/mixins/stage/staging.yaml index 1927d27f1..fbe18e65d 100644 --- a/examples/tests/stacks/mixins/stage/staging.yaml +++ b/examples/tests/stacks/mixins/stage/staging.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + vars: stage: staging diff --git a/examples/tests/stacks/mixins/stage/test1.yaml b/examples/tests/stacks/mixins/stage/test1.yaml index d2b212059..65d4fd68f 100644 --- a/examples/tests/stacks/mixins/stage/test1.yaml +++ b/examples/tests/stacks/mixins/stage/test1.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + vars: stage: test-1 diff --git a/examples/tests/stacks/orgs/cp/_defaults.yaml b/examples/tests/stacks/orgs/cp/_defaults.yaml index b0bf86e55..e432023a0 100644 --- a/examples/tests/stacks/orgs/cp/_defaults.yaml +++ b/examples/tests/stacks/orgs/cp/_defaults.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + vars: namespace: cp diff --git a/examples/tests/stacks/orgs/cp/tenant1/_defaults.yaml b/examples/tests/stacks/orgs/cp/tenant1/_defaults.yaml index 756d40e6a..da5453cb9 100644 --- a/examples/tests/stacks/orgs/cp/tenant1/_defaults.yaml +++ b/examples/tests/stacks/orgs/cp/tenant1/_defaults.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: - orgs/cp/_defaults diff --git a/examples/tests/stacks/orgs/cp/tenant1/dev/_defaults.yaml b/examples/tests/stacks/orgs/cp/tenant1/dev/_defaults.yaml index 96b267f24..1903a27ba 100644 --- a/examples/tests/stacks/orgs/cp/tenant1/dev/_defaults.yaml +++ b/examples/tests/stacks/orgs/cp/tenant1/dev/_defaults.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: - mixins/stage/dev - orgs/cp/tenant1/_defaults diff --git a/examples/tests/stacks/orgs/cp/tenant1/dev/global-region.yaml b/examples/tests/stacks/orgs/cp/tenant1/dev/global-region.yaml index 7fd2df736..fdc2968f9 100644 --- a/examples/tests/stacks/orgs/cp/tenant1/dev/global-region.yaml +++ b/examples/tests/stacks/orgs/cp/tenant1/dev/global-region.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: - mixins/region/global-region - orgs/cp/tenant1/dev/_defaults diff --git a/examples/tests/stacks/orgs/cp/tenant1/dev/us-east-2-extras.yaml b/examples/tests/stacks/orgs/cp/tenant1/dev/us-east-2-extras.yaml index d08205f75..5879f77b4 100644 --- a/examples/tests/stacks/orgs/cp/tenant1/dev/us-east-2-extras.yaml +++ b/examples/tests/stacks/orgs/cp/tenant1/dev/us-east-2-extras.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: - mixins/region/us-east-2 - orgs/cp/tenant1/dev/_defaults diff --git a/examples/tests/stacks/orgs/cp/tenant1/dev/us-east-2.yaml b/examples/tests/stacks/orgs/cp/tenant1/dev/us-east-2.yaml index fca915c6c..994613066 100644 --- a/examples/tests/stacks/orgs/cp/tenant1/dev/us-east-2.yaml +++ b/examples/tests/stacks/orgs/cp/tenant1/dev/us-east-2.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: - mixins/region/us-east-2 - orgs/cp/tenant1/dev/_defaults diff --git a/examples/tests/stacks/orgs/cp/tenant1/dev/us-west-2.yaml b/examples/tests/stacks/orgs/cp/tenant1/dev/us-west-2.yaml index 75172d190..c53b02028 100644 --- a/examples/tests/stacks/orgs/cp/tenant1/dev/us-west-2.yaml +++ b/examples/tests/stacks/orgs/cp/tenant1/dev/us-west-2.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: - mixins/region/us-west-2 - orgs/cp/tenant1/dev/_defaults diff --git a/examples/tests/stacks/orgs/cp/tenant1/prod/_defaults.yaml b/examples/tests/stacks/orgs/cp/tenant1/prod/_defaults.yaml index bce5bf6e0..4857ed498 100644 --- a/examples/tests/stacks/orgs/cp/tenant1/prod/_defaults.yaml +++ b/examples/tests/stacks/orgs/cp/tenant1/prod/_defaults.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: - mixins/stage/prod - orgs/cp/tenant1/_defaults diff --git a/examples/tests/stacks/orgs/cp/tenant1/prod/global-region.yaml b/examples/tests/stacks/orgs/cp/tenant1/prod/global-region.yaml index 06df10f06..deabf21fe 100644 --- a/examples/tests/stacks/orgs/cp/tenant1/prod/global-region.yaml +++ b/examples/tests/stacks/orgs/cp/tenant1/prod/global-region.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: - mixins/region/global-region - orgs/cp/tenant1/prod/_defaults 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 69952601b..bc33175c1 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 @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: - mixins/region/us-east-2 - orgs/cp/tenant1/prod/_defaults diff --git a/examples/tests/stacks/orgs/cp/tenant1/staging/_defaults.yaml b/examples/tests/stacks/orgs/cp/tenant1/staging/_defaults.yaml index e738cbe90..4b744927a 100644 --- a/examples/tests/stacks/orgs/cp/tenant1/staging/_defaults.yaml +++ b/examples/tests/stacks/orgs/cp/tenant1/staging/_defaults.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: - mixins/stage/staging - orgs/cp/tenant1/_defaults diff --git a/examples/tests/stacks/orgs/cp/tenant1/staging/global-region.yaml b/examples/tests/stacks/orgs/cp/tenant1/staging/global-region.yaml index bfed7637a..11bf6a1f3 100644 --- a/examples/tests/stacks/orgs/cp/tenant1/staging/global-region.yaml +++ b/examples/tests/stacks/orgs/cp/tenant1/staging/global-region.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: - mixins/region/global-region - orgs/cp/tenant1/staging/_defaults diff --git a/examples/tests/stacks/orgs/cp/tenant1/staging/us-east-2.yaml b/examples/tests/stacks/orgs/cp/tenant1/staging/us-east-2.yaml index d5478bb84..fc5acab24 100644 --- a/examples/tests/stacks/orgs/cp/tenant1/staging/us-east-2.yaml +++ b/examples/tests/stacks/orgs/cp/tenant1/staging/us-east-2.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: - mixins/region/us-east-2 - orgs/cp/tenant1/staging/_defaults diff --git a/examples/tests/stacks/orgs/cp/tenant1/test1/_defaults.yaml b/examples/tests/stacks/orgs/cp/tenant1/test1/_defaults.yaml index d23bdb614..a4e679c76 100644 --- a/examples/tests/stacks/orgs/cp/tenant1/test1/_defaults.yaml +++ b/examples/tests/stacks/orgs/cp/tenant1/test1/_defaults.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: - mixins/stage/test1 - orgs/cp/tenant1/_defaults diff --git a/examples/tests/stacks/orgs/cp/tenant1/test1/global-region.yaml b/examples/tests/stacks/orgs/cp/tenant1/test1/global-region.yaml index ebb306c0c..1883a59e9 100644 --- a/examples/tests/stacks/orgs/cp/tenant1/test1/global-region.yaml +++ b/examples/tests/stacks/orgs/cp/tenant1/test1/global-region.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: - mixins/region/global-region - orgs/cp/tenant1/test1/_defaults diff --git a/examples/tests/stacks/orgs/cp/tenant1/test1/us-east-2.yaml b/examples/tests/stacks/orgs/cp/tenant1/test1/us-east-2.yaml index 1c3285f77..3a6daf428 100644 --- a/examples/tests/stacks/orgs/cp/tenant1/test1/us-east-2.yaml +++ b/examples/tests/stacks/orgs/cp/tenant1/test1/us-east-2.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: - mixins/region/us-east-2 - orgs/cp/tenant1/test1/_defaults diff --git a/examples/tests/stacks/orgs/cp/tenant1/test1/us-west-1.yaml b/examples/tests/stacks/orgs/cp/tenant1/test1/us-west-1.yaml index 922bce37a..97239cc1f 100644 --- a/examples/tests/stacks/orgs/cp/tenant1/test1/us-west-1.yaml +++ b/examples/tests/stacks/orgs/cp/tenant1/test1/us-west-1.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: - path: mixins/region/us-west-1 - path: orgs/cp/tenant1/test1/_defaults diff --git a/examples/tests/stacks/orgs/cp/tenant1/test1/us-west-2.yaml b/examples/tests/stacks/orgs/cp/tenant1/test1/us-west-2.yaml index 1326f084b..ea8bf1198 100644 --- a/examples/tests/stacks/orgs/cp/tenant1/test1/us-west-2.yaml +++ b/examples/tests/stacks/orgs/cp/tenant1/test1/us-west-2.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: - path: mixins/region/us-west-2 - path: orgs/cp/tenant1/test1/_defaults diff --git a/examples/tests/stacks/orgs/cp/tenant2/_defaults.yaml b/examples/tests/stacks/orgs/cp/tenant2/_defaults.yaml index d6120a08a..4276af589 100644 --- a/examples/tests/stacks/orgs/cp/tenant2/_defaults.yaml +++ b/examples/tests/stacks/orgs/cp/tenant2/_defaults.yaml @@ -1,3 +1,6 @@ + +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: - orgs/cp/_defaults diff --git a/examples/tests/stacks/orgs/cp/tenant2/dev/_defaults.yaml b/examples/tests/stacks/orgs/cp/tenant2/dev/_defaults.yaml index df9960f7a..8d9638808 100644 --- a/examples/tests/stacks/orgs/cp/tenant2/dev/_defaults.yaml +++ b/examples/tests/stacks/orgs/cp/tenant2/dev/_defaults.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: - mixins/stage/dev - orgs/cp/tenant2/_defaults diff --git a/examples/tests/stacks/orgs/cp/tenant2/dev/global-region.yaml b/examples/tests/stacks/orgs/cp/tenant2/dev/global-region.yaml index c8178b1df..1db8ef256 100644 --- a/examples/tests/stacks/orgs/cp/tenant2/dev/global-region.yaml +++ b/examples/tests/stacks/orgs/cp/tenant2/dev/global-region.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: - mixins/region/global-region - orgs/cp/tenant2/dev/_defaults diff --git a/examples/tests/stacks/orgs/cp/tenant2/dev/us-east-2.yaml b/examples/tests/stacks/orgs/cp/tenant2/dev/us-east-2.yaml index 99275b911..b2c3b7556 100644 --- a/examples/tests/stacks/orgs/cp/tenant2/dev/us-east-2.yaml +++ b/examples/tests/stacks/orgs/cp/tenant2/dev/us-east-2.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: - mixins/region/us-east-2 - orgs/cp/tenant2/dev/_defaults diff --git a/examples/tests/stacks/orgs/cp/tenant2/prod/_defaults.yaml b/examples/tests/stacks/orgs/cp/tenant2/prod/_defaults.yaml index 6cc5141b3..2952f2c2d 100644 --- a/examples/tests/stacks/orgs/cp/tenant2/prod/_defaults.yaml +++ b/examples/tests/stacks/orgs/cp/tenant2/prod/_defaults.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: - mixins/stage/prod - orgs/cp/tenant2/_defaults diff --git a/examples/tests/stacks/orgs/cp/tenant2/prod/global-region.yaml b/examples/tests/stacks/orgs/cp/tenant2/prod/global-region.yaml index e66e9249e..c3fd655f4 100644 --- a/examples/tests/stacks/orgs/cp/tenant2/prod/global-region.yaml +++ b/examples/tests/stacks/orgs/cp/tenant2/prod/global-region.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: - mixins/region/global-region - orgs/cp/tenant2/prod/_defaults diff --git a/examples/tests/stacks/orgs/cp/tenant2/prod/us-east-2.yaml b/examples/tests/stacks/orgs/cp/tenant2/prod/us-east-2.yaml index 24c8ccd6d..57acd98f7 100644 --- a/examples/tests/stacks/orgs/cp/tenant2/prod/us-east-2.yaml +++ b/examples/tests/stacks/orgs/cp/tenant2/prod/us-east-2.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: - mixins/region/us-east-2 - orgs/cp/tenant2/prod/_defaults diff --git a/examples/tests/stacks/teams/devops.yaml b/examples/tests/stacks/teams/devops.yaml index 67ed84d45..be0fb90f1 100644 --- a/examples/tests/stacks/teams/devops.yaml +++ b/examples/tests/stacks/teams/devops.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: # The `devops` Team manages all the components defined in the following stack manifests: - catalog/terraform/top-level-component1 diff --git a/examples/tests/stacks/teams/testing.yaml b/examples/tests/stacks/teams/testing.yaml index f70739fb4..5a9b47228 100644 --- a/examples/tests/stacks/teams/testing.yaml +++ b/examples/tests/stacks/teams/testing.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json + import: # The `testing` Team manages all the components defined in the following stack manifests: - catalog/terraform/test-component diff --git a/website/docs/best-practices/stacks.mdx b/website/docs/best-practices/stacks.mdx index 9234385bf..507f37c95 100644 --- a/website/docs/best-practices/stacks.mdx +++ b/website/docs/best-practices/stacks.mdx @@ -63,7 +63,7 @@ Here’s why: to grasp the complete picture. 2. **Plan for Future Divergence:** When initially similar configurations are likely diverge over time, keeping them separate will make future changes easier. -3. **Premature Optimization:** Over-optimizing for DRYness may be a form of premature optimization. It’s important to recognize +3. **Premature Optimization:** Over-optimizing for DRYness may be a form of premature optimization. It’s important to recognize when to prioritize flexibility and clarity over minimal repetition. ## Reserve Code Generation for Stack Configuration diff --git a/website/docs/cli/commands/describe/describe-dependents.mdx b/website/docs/cli/commands/describe/describe-dependents.mdx index 15ce456ee..2255b0da4 100644 --- a/website/docs/cli/commands/describe/describe-dependents.mdx +++ b/website/docs/cli/commands/describe/describe-dependents.mdx @@ -24,13 +24,28 @@ Provide meaningful descriptions so that people can understand what the dependenc Each object in the `settings.depends_on` section has the following schema: -- `file` (optional) - a file on the local filesystem that the current component depends on -- `folder` (optional) - a folder on the local filesystem that the current component depends on -- `component` (required if `file` or `folder` is not specified) - an Atmos component that the current component depends on -- `namespace` (optional) - the `namespace` where the `component` is provisioned -- `tenant` (optional) - the `tenant` where the `component` is provisioned -- `environment` (optional) - the `environment` where the `component` is provisioned -- `stage` (optional) - the `stage` where the `component` is provisioned +
+
file (optional)
+
A file on the local filesystem that the current component depends on
+ +
folder (optional)
+
A folder on the local filesystem that the current component depends on
+ +
component (required if `file` or `folder` is not specified)
+
an Atmos component that the current component depends on
+ +
namespace (optional)
+
The `namespace` where the `component` is provisioned
+ +
tenant (optional)
+
The `tenant` where the `component` is provisioned
+ +
environment (optional)
+
The `environment` where the `component` is provisioned
+ +
stage (optional)
+
The `stage` where the `component` is provisioned
+
One of `component`, `file` or `folder` is required. diff --git a/website/docs/core-concepts/components/terraform/brownfield.mdx b/website/docs/core-concepts/components/terraform/brownfield.mdx index c953f1efa..a2f87091c 100644 --- a/website/docs/core-concepts/components/terraform/brownfield.mdx +++ b/website/docs/core-concepts/components/terraform/brownfield.mdx @@ -14,7 +14,7 @@ The term "brownfield" comes from urban planning and refers to the redevelopment Atmos is not just a tool; it is a framework that provides a set of opinionated conventions, methodologies, design patterns, and best practices to ensure teams succeed with Terraform from the start. It can be hard to shoehorn existing systems that are not designed according to the [Atmos mindset](/quick-start/mindset). -- **Decomposition**: Not only do you have challenges around how to decompose your architecture, but also the difficulty of making changes to live systems. +- **Decomposition**: Not only do you have challenges around how to decompose your architecture, but also the difficulty of making changes to live systems. - **Technical Debt:** You may have significant technical debt that needs to be addressed - **Knowledge Gaps**: There may be gaps in knowledge within the team regarding Atmos conventions and methodologies. diff --git a/website/docs/core-concepts/projects/configuration/configuration.mdx b/website/docs/core-concepts/projects/configuration/configuration.mdx index d74aa7c3b..386ecac67 100644 --- a/website/docs/core-concepts/projects/configuration/configuration.mdx +++ b/website/docs/core-concepts/projects/configuration/configuration.mdx @@ -1,6 +1,6 @@ --- title: Configure Atmos CLI -sidebar_position: 2 +sidebar_position: 3 sidebar_label: Configure Atmos description: CLI configuration for Atmos to find your Terraform components and Atmos stacks id: configuration @@ -167,7 +167,7 @@ Well-known paths are how Atmos knows how to find all your stack configurations,
`base_path`
-
The base path for components, stacks, and workflows configurations. We set it to an empty string because we've decided to use the ENV var `ATMOS_BASE_PATH` to point to the absolute path of the root of the repo
+
The base path for components, stacks, and workflows configurations. We set it to `./` so it will use the current working directory. Alternatively, we can override this behavior by setting the ENV var `ATMOS_BASE_PATH` to point to another directory location.
`components.terraform.base_path`
The base path to the Terraform components (Terraform root modules). As described in [Configure Repository](/quick-start/advanced/configure-repository), we've decided to put the Terraform components into the `components/terraform` directory, and this setting tells Atmos where to find them. Atmos will join the base path (set in the `ATMOS_BASE_PATH` ENV var) with `components.terraform.base_path` to calculate the final path to the Terraform components
diff --git a/website/docs/core-concepts/projects/layout.mdx b/website/docs/core-concepts/projects/layout.mdx index 15b266d05..027cc02ee 100644 --- a/website/docs/core-concepts/projects/layout.mdx +++ b/website/docs/core-concepts/projects/layout.mdx @@ -3,7 +3,7 @@ title: Folder Structure sidebar_position: 1 sidebar_label: Folder Structure description: Recommended way to organize your Atmos stacks and components -id: layout +id: layout --- import KeyPoints from '@site/src/components/KeyPoints' import Intro from '@site/src/components/Intro' @@ -18,7 +18,66 @@ At the root of your project, you’ll typically find an `atmos.yaml` configurati - Different ways to organize your project -You can find some demos of how we organize projects in the Atmos GitHub repository under the [`examples/`](https://github.com/cloudposse/atmos/tree/main/examples) folder. +## Recommended Filesystem Layout + +Atmos is fully configurable, and you can organize your project in any way that makes sense for your team by adusting the paths in [`atmos.yaml`](/core-concepts/projects/configuration). We also provide detailed guidance on organizing your folder structure, whether it’s for a simple project or enterprise-scale architecture in our [Design Patterns](/design-patterns) section. Choose the model that best fits the stage you plan to reach when you complete the project. + +Here's a simple layout, if you just have 3 deployments for things like dev, staging, and prod: +```plaintext +├── components/ # Folder containing all your components, usually organized by toolchain +│ └── terraform/ # Folder for all Terraform "root modules" +└── stacks/ + ├── deploy/ # Folder for deployable stacks + │ ├── dev/ # Folder for development environment configurations + │ ├── staging/ # Folder for staging environment configurations + │ └── prod/ # Folder for production environment configurations + ├── catalog/ # Folder for the service catalog + ├── schemas/ # Folder for the schema validations + └── workflows/ # Folder for workflows that operate on top of stacks +``` + +Alternatively, here’s a more complex layout for a larger project broken into multiple organizations, organizational units, and environments: + +```plaintext +├── components/ # Folder containing all your components, usually organized by toolchain +│ └── terraform/ # Folder for all Terraform "root modules" +└── stacks/ + ├── orgs/ # Folder for deployable stacks + │ └── acme/ # Folder for the Acme organization + │ ├── core/ # OU for core services + │ │ ├── security/ # Folder for security-related configurations + │ │ ├── audit/ # Folder for audit-related configurations + │ │ ├── identity/ # Folder for identity management configurations + │ │ └── network/ # Folder for networking-related configurations + │ └── plat/ # OU for platform environments + │ ├── dev/ # Folder for development environment configurations + │ ├── staging/ # Folder for staging environment configurations + │ └── prod/ # Folder for production environment configurations + ├── catalog/ # Folder for the service catalog + ├── schemas/ # Folder for the schema validations + └── workflows/ # Folder for workflows that operate on top of stacks +``` + +Note, that these are just a couple of examples. + +
+
`components/`
+
folder containing all your components, usually organized by your toolchain
+ +
`components/terraform`
+
folder for all Terraform "root modules"
+ +
`stacks/orgs/`
+
folder for deployable stacks
+ +
`stacks/catalog/`
+
folder for the service catalog
+ +
`stacks/workflows/`
+
folder for workflows that operate on top of stacks.
+
+ +You can find some demos of how we organize projects in the Atmos GitHub repository under the [`examples/`](https://github.com/cloudposse/atmos/tree/main/examples) folder. Or check out our [Reference Architecture for AWS](https://docs.cloudposse.com/learn) for a more detailed look at how we organize our projects. To effectively organize an Atmos project, we want to ensure you have specific locations for Atmos to find your stack configurations and components. At a minimum, we recommend the following folder structure in your project: @@ -32,7 +91,10 @@ Next, you’ll have your stacks configurations, which are organized into multipl ### Schema Validations +This folder contains the [JSON or OPA schemas used to validate the stack configurations](/core-concepts/validate). + ### Catalogs + This should be a separate top-level folder containing your stack configurations. Stack configurations are divided into several parts: - **Schemas Folder**: This folder contains the schemas used to validate the stack configurations. - **Catalog Folder**: This includes all reusable imports, which can be organized into subfolders based on logical groupings. @@ -40,30 +102,11 @@ This should be a separate top-level folder containing your stack configurations. We follow a few conventions in our reference architecture: -### Deployable Stacks +### Deployments + +We usually organize our stacks by organization, organizational unit, and environment. For example: - **Orgs Folder**: Represents the AWS organizations to which you deploy. You might use a folder called deploy if you have a few simple stacks. - **Multi-Cloud Projects**: If your project involves multiple clouds, consider additional organizational strategies. -## Recommended Filesystem Layout -
-
`components/`
-
folder containing all your components, usually organized by your toolchain
- -
`components/terraform`
-
folder for all Terraform "root modules"
- -
`stacks/orgs/`
-
folder for deployable stacks
- -
`stacks/catalog/`
-
folder for the service catalog
- -
`stacks/workflows/`
-
folder for workflows that operate on top of stacks.
-
- -We provide detailed guidance on organizing your folder structure, whether it’s for a simple project or enterprise-scale architecture. - -Remember, you can’t optimize for everything at once, so choose the model that best fits the stage you plan to reach when you complete the project. diff --git a/website/docs/core-concepts/projects/setup-editor.mdx b/website/docs/core-concepts/projects/setup-editor.mdx new file mode 100644 index 000000000..24fbcb15a --- /dev/null +++ b/website/docs/core-concepts/projects/setup-editor.mdx @@ -0,0 +1,239 @@ +--- +title: Configure Your Editor for Atmos +sidebar_position: 2 +sidebar_label: Setup Editor +--- + +import TabItem from "@theme/TabItem"; +import Tabs from "@theme/Tabs"; +import Intro from "@site/src/components/Intro"; +import KeyPoints from "@site/src/components/KeyPoints"; + + + A properly configured editor can make working with Atmos configurations more + intuitive and efficient. The right setup can improve readability, speed up + your workflow, and even help you catch configuration errors as you go! Whether + you’re setting up your editor for the first time or refining your current + environment, we have some recommendations to get you started. + + + + - How to configure your VS Code editor to boost productivity + - Ensure your YAML files are validated against the Atmos schema to catch issues early and maintain compliance with best practices + - How to format your code + automatically + + +To work effectively with Atmos, we recommend configuring your VS Code editor for the best developer experience. Alternatively, you can use a **DevContainer configuration**. + + + + + ## Configure Visual Studio Code + + You can manually configure your VS Code environment with the following settings. + + ### Recommended Visual Studio Code Extensions + + Install these extensions for enhanced productivity: + - [Docker](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-docker) + - [GitHub Markdown Preview](https://marketplace.visualstudio.com/items?itemName=bierner.github-markdown-preview) + - [Markdown Admonitions](https://marketplace.visualstudio.com/items?itemName=tomasdahlqvist.markdown-admonitions) + - [Terraform](https://marketplace.visualstudio.com/items?itemName=HashiCorp.terraform) + - [YAML](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml) + - [Go Template](https://marketplace.visualstudio.com/items?itemName=casualjim.gotemplate) + - [EditorConfig](https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig) + + ### Visual Studio Code Settings + + Update your VS Code settings to optimize the experience for working with Atmos. With these configurations, your VS Code editor will be fully optimized for working with Atmos. + + Add the following to your `settings.json` for your infrastructure repository (e.g. `infra/.vscode/settings.json`) + + ```json + { + "git.openRepositoryInParentFolders": "always", + "git.autofetch": true, + "git.showProgress": true, + "workbench.startupEditor": "readme", + "workbench.editor.autoLockGroups": { + "readme": "/welcome.md" + }, + "workbench.editorAssociations": { + "*.md": "vscode.markdown.preview.editor" + }, + "terminal.integrated.tabs.title": "Atmos (${process})", + "terminal.integrated.tabs.description": "${task}${separator}${local}${separator}${cwdFolder}", + "terminal.integrated.shell.linux": "/bin/zsh", + "terminal.integrated.allowWorkspaceConfiguration": true, + "yaml.schemaStore.enable": true, + "yaml.schemas": { + "https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json": [ + "**/stacks/**/*.yaml", + "!**/stacks/workflows/**/*.yaml", + "!**/stacks/schemas/**/*.yaml" + ] + } + } + ``` + + ### Terminal Configuration + + Set your terminal to use Zsh for an improved command-line experience: + + ```json + "terminal.integrated.shell.linux": "/bin/zsh" + ``` + + ### YAML Schema Validation + + Ensure your YAML files are validated against the Atmos schema: + + ```json + "yaml.schemas": { + "https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json": [ + "**/stacks/**/*.yaml", + "!**/stacks/workflows/**/*.yaml", + "!**/stacks/schemas/**/*.yaml" + ] + } + ``` + + + + + + ## Use DevContainers with Atmos + + When managing your infrastructure with Atmos, you can enhance your development experience by configuring your **infrastructure repository** with a [dev containers](https://containers.dev/). This ensures a consistent, isolated development environment tailored for working with Atmos and Terraform, integrated natively with your IDE. + + ## Why Use a DevContainers? + + - **Consistent Environment:** Ensures every developer uses the same tools and configurations. + - **Pre-installed Tools:** Includes Atmos, Terraform, and any additional utilities. + - **Simplified Setup:** Developers don’t need to manually install dependencies. + + By adding this configuration to your infrastructure repository, you'll streamline collaboration and maintain consistency across your team. + + ## Setting Up a DevContainer for Your Infrastructure Repository + + Follow these steps to configure a **DevContainer** in your repository: + + ### 1. Create a `.devcontainer` Directory + + In the root of your infrastructure repository, create a `.devcontainer` directory to store the configuration files: + + ```bash + mkdir .devcontainer + ``` + + ### 2. Add a `devcontainer.json` File + + Inside the `.devcontainer` directory, create a `devcontainer.json` file with the following content: + + ```json + { + "name": "Atmos DevContainer", + "forwardPorts": [80, 443], + "portsAttributes": { + "80": { "label": "Ingress" }, + "443": { "label": "Ingress (TLS)" } + }, + "security.workspace.trust.emptyWindow": true, + "security.workspace.trust.untrustedFiles": "prompt", + "security.workspace.trust.domain": { + "*.github.com": true, + "*.app.github.dev": true, + "localhost": true + }, + "build": { + "dockerfile": "Dockerfile", + "context": "." + }, + "hostRequirements": { + "cpus": 4, + "memory": "8gb", + "storage": "16gb" + }, + "runArgs": ["-v", "/var/run/docker.sock:/var/run/docker.sock"], + "postCreateCommand": "/workspace/.devcontainer/post-create.sh", + "features": { + "ghcr.io/devcontainers/features/docker-outside-of-docker": {} + }, + "workspaceFolder": "/workspace", + "workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind", + "customizations": { + "vscode": { + "extensions": [ + "ms-azuretools.vscode-docker", + "bierner.github-markdown-preview", + "tomasdahlqvist.markdown-admonitions", + "HashiCorp.terraform", + "redhat.vscode-yaml", + "casualjim.gotemplate", + "EditorConfig.EditorConfig" + ], + "settings": { + "git.openRepositoryInParentFolders": "always", + "git.autofetch": true, + "workbench.startupEditor": "readme", + "yaml.schemas": { + "https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json": [ + "**/stacks/**/*.yaml", + "!**/stacks/workflows/**/*.yaml", + "!**/stacks/schemas/**/*.yaml" + ] + } + } + } + } + } + ``` + + ### 3. Add a `Dockerfile` + + In the `.devcontainer` directory, create a `Dockerfile` to define the environment. For Atmos and Terraform, use the following: + + ```Dockerfile + FROM mcr.microsoft.com/devcontainers/base:ubuntu + + # Install dependencies + RUN apt-get update && \ + apt-get install -y curl unzip git zsh && \ + curl -Lo /tmp/terraform.zip https://releases.hashicorp.com/terraform/1.5.6/terraform_1.5.6_linux_amd64.zip && \ + unzip /tmp/terraform.zip -d /usr/local/bin/ && \ + rm /tmp/terraform.zip && \ + curl -Lo /usr/local/bin/atmos https://github.com/cloudposse/atmos/releases/latest/download/atmos-linux-amd64 && \ + chmod +x /usr/local/bin/atmos + + # Install Zsh and set as default shell + RUN chsh -s /bin/zsh + ``` + + ### 4. (Optional) Add a Post-Create Script + + If you need to run additional setup commands after creating the container, add a `post-create.sh` script: + + ```bash + #!/bin/bash + + # Example: Install custom tools or set up environment variables + echo "Post-create script running..." + ``` + + Make it executable: + + ```bash + chmod +x .devcontainer/post-create.sh + ``` + + ### 5. Open Your Repository in the DevContainer + + 1. Install the **Dev Containers** extension in VS Code: + - [Dev Containers Extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) + 2. Open the infrastructure repository in VS Code. + 3. Click on the  >< icon in the bottom-left corner and a menu appears. + 4. Select **Reopen in Container**. + + + diff --git a/website/docs/core-concepts/share-data/share-data.mdx b/website/docs/core-concepts/share-data/share-data.mdx index 2a02c8c72..50ad3d9dc 100644 --- a/website/docs/core-concepts/share-data/share-data.mdx +++ b/website/docs/core-concepts/share-data/share-data.mdx @@ -127,7 +127,7 @@ terraform: Learn More -## Using Remote State +## Using Terraform Remote State Atmos provides a [`remote-state`](https://github.com/cloudposse/terraform-yaml-stack-config/tree/main/modules/remote-state) Terraform module that makes it easier to look up the remote state of other components in the stack. This module can be used to share data between components provisioned in the same stack or across different stacks, using native HCL. diff --git a/website/docs/core-concepts/stacks/dependencies.mdx b/website/docs/core-concepts/stacks/dependencies.mdx index ff0ec8ef7..bb52e448c 100644 --- a/website/docs/core-concepts/stacks/dependencies.mdx +++ b/website/docs/core-concepts/stacks/dependencies.mdx @@ -29,14 +29,32 @@ The `settings.depends_on` section is a map of objects. The map keys are just the We originally implemented `settings.depends_on` as a list. However, since it’s not clear how lists should be deep-merged, so we decided to convert it to a map instead. In this map, the keys are lexicographically ordered, and based on that order, the dependencies are managed. - Each object in the `settings.depends_on` section has the following schema: -- `component` (required) - an Atmos component that the current component depends on -- `namespace` (optional) - the `namespace` where the Atmos component is provisioned -- `tenant` (optional) - the `tenant` where the Atmos component is provisioned -- `environment` (optional) - the `environment` where the Atmos component is provisioned -- `stage` (optional) - the `stage` where the Atmos component is provisioned +
+
file (optional)
+
A file on the local filesystem that the current component depends on
+ +
folder (optional)
+
A folder on the local filesystem that the current component depends on
+ +
component (required if `file` or `folder` is not specified)
+
an Atmos component that the current component depends on
+ +
namespace (optional)
+
The `namespace` where the `component` is provisioned
+ +
tenant (optional)
+
The `tenant` where the `component` is provisioned
+ +
environment (optional)
+
The `environment` where the `component` is provisioned
+ +
stage (optional)
+
The `stage` where the `component` is provisioned
+
+ +One of `component`, `file` or `folder` is required. The `component` attribute is required. The rest are the context variables and are used to define Atmos stacks other than the current stack. For example, you can specify: diff --git a/website/docs/core-concepts/stacks/templates/functions/atmos.Component.mdx b/website/docs/core-concepts/stacks/templates/functions/atmos.Component.mdx index 9f3985bd5..2e327710d 100644 --- a/website/docs/core-concepts/stacks/templates/functions/atmos.Component.mdx +++ b/website/docs/core-concepts/stacks/templates/functions/atmos.Component.mdx @@ -118,6 +118,61 @@ tenant `net` (instead of `plat`): sections in [`atmos.yaml` CLI config file](/cli/configuration/#stacks) ::: +## Handling Outputs Containing Maps or Lists + +You can use the `atmos.Component` function to read complex outputs (remote state) from Terraform/OpenTofu components, and use those in your stack manifests. It's important to keep in mind that template functions are evaluated during the **text processing phase—before the file is interpreted as YAML**. (This is similar to the behavior of how Helm chart templates are evaluated.) + +To effectively use `atmos.Component` outputs in stack configurations, it’s important to understand the relationship between YAML and JSON. YAML is a superset of JSON, meaning you can embed JSON directly inside YAML, but the reverse is not true. + +This means: + 1. The output of a template function must be valid YAML (including the relative whitespace based on it's current position) or JSON to be parsed correctly. + 2. Simple types like strings are straightforward—they can be returned as-is. + 3. Complex types like lists or maps must be serialized into JSON to ensure compatibility. + +### Atmos Configuration + +First, we need to adjust the delimiters in `atmos.yaml`, to avoid issues with YAML parsing: + +```yaml title="atmos.yaml" +templates: + settings: + # Note the deliberate use of single quotes around the braces to avoid YAML parsing issues + delimiters: ["'{{", "}}'"] +``` + +
+Detailed Explanation + +In YAML, the default `{{` and `}}` delimiters used for templating can conflict with YAML’s syntax rules, leading to parsing errors. For example, YAML interprets unquoted braces as JSON maps, which can cause YAML parsing to fail. + +1. YAML Parsing Phase First, the file is parsed as YAML to extract its structure, such as imports. At this stage, the file must be valid YAML for Atmos to proceed. If the template expressions inside `{{ ... }}` are not properly handled, they can break the YAML syntax, leading to parsing errors. + +2. Go Template Processing Phase: After successfully parsing the YAML structure, Atmos treats the file as a Go template and processes the content. Here’s what happens: + - Everything between the delimiters (`{{ ... }}`) is replaced by the result of the template function or expression. + - The output of this replacement must also be valid YAML so the file can remain usable for the next steps (e.g., Terraform processing). +3. How Adjusted Delimiters Work: By configuring delimiters as `["'{{", "}}'"]` in `atmos.yaml`, you ensure that: + - During the YAML Parsing Phase, the single quotes (`'`) around the template expressions make them valid YAML strings, allowing the file to pass YAML validation. + - During the Go Template Processing Phase, Atmos processes the content within '`{{` and `}}`' and replaces it with the evaluated result. + +
+ + +### Using `toRawJson` Function + +Then we can use the `toRawJson` function to serialize complex types into JSON: + +```yaml + components: + terraform: + my_lambda_component: + vars: + vpc_config: + security_group_ids: ['{{ (atmos.Component "security-group/lambda" .stack).outputs.id }}'] + subnet_ids: '{{ toRawJson ((atmos.Component "vpc" .stack).outputs.private_subnets) }}' +``` + +The results of the `toRawJson` function are serialized into JSON, which can be safely embedded in the YAML stack configuration. The single quotes around the braces in the `delimiters` setting ensure that the JSON is not parsed as YAML, but then processed as a template function which removes the single quotes and replaces it with the JSON string. + ## Examples The following configurations show different ways of using the `atmos.Component` template function to read values from @@ -171,7 +226,7 @@ components: Atmos caches (in memory) the results of `atmos.Component` template function execution. If you call the function for the same component in a stack more than once, the first call will produce the result -and cache it, and all the consecutive calls will just use the cached data. This is useful when you use the +and cache it, and all the consecutive calls will just use the cached data. This is useful when you use the `atmos.Component` function for the same component in a stack in multiple places in Atmos stack manifests. It will speed up the function execution and stack processing. diff --git a/website/docs/core-concepts/stacks/templates/templates.mdx b/website/docs/core-concepts/stacks/templates/templates.mdx index 0493e2ac9..ea2a423f5 100644 --- a/website/docs/core-concepts/stacks/templates/templates.mdx +++ b/website/docs/core-concepts/stacks/templates/templates.mdx @@ -348,6 +348,32 @@ vars: ``` +## Performance Implications + +There are some performance implications of using Go Templates with Atmos Stack configurations. + +Using Go templates and template functions in Atmos stack configurations is generally safe and provides powerful flexibility. However, caution is required when leveraging functions like `atmos.Component` or others that depend on remote resources or network configurations. These functions can have significant performance implications and potential impacts on availability. + +:::warning Why the Caution? + +Atmos processes stack configuration files in multiple stages: first as Go templates, and then as YAML. During the Go template stage, every template function must be evaluated and resolved before Atmos can load the file. This introduces a critical dependency: Atmos cannot proceed unless all referenced resources are available and accessible. +::: + +1. **Performance**: Functions like [`Atmos.Component`](/core-concepts/stacks/templates/functions/atmos.Component) may require Atmos to retrieve extensive information about other components or outputs that depend on Terraform remote state. This adds latency, especially if used extensively across your stack configurations. In the case of retrieving Terraform outputs, Atmos must initialize the Terraform component which involves downloading all Terraform providers, which is slow. Commands like [`atmos describe stacks`](/cli/commands/describe/stacks) or [`atmos describe affected`](/cli/commands/describe/affected), which rely on evaluating all templates, can become noticeably slower as the number of remote calls increases. +2. **Availability Risks:** Templated references to remote resources introduce fragility. If a referenced resource becomes unavailable—whether due to downtime, decommissioning, or network issues—Atmos commands that depend on those templates will fail. This can severely impact high availability (HA) scenarios and your ability to reliably deploy or manage infrastructure. + +### Template Function Best Practices + +Careful management of template dependencies is essential for optimizing the performance of Atmos while ensuring a robust and reliable infrastructure configuration process. + +To avoid potential pitfalls and maximize efficiency, follow these best practices: + +1. **Minimize Dependency on Remote Sources**: Avoid referencing resources in your templates that are not highly available or are prone to downtime. Where possible, use static or locally resolvable values. +2. **Use `Atmos.Component` Sparingly**: While Atmos.Component is powerful, its overuse can significantly degrade performance. Limit its use to scenarios where it is truly necessary, and consider precomputing or caching values to reduce the frequency of evaluations. +3. **Use Terraform Remote State Directly**: Instead of relying on template functions to retrieve remote state, [use Terraform's native ability to retrieve the remote state](/core-concepts/share-data/#using-terraform-remote-state) of other components. +4. **Test for Resilience**: Simulate scenarios where a remote resource becomes unavailable and observe how Atmos behaves. Design your configurations to handle failures gracefully or provide fallbacks where feasible. + + ## Template Evaluations Atmos supports many different ways of configuring and using `Go` templates: @@ -358,7 +384,8 @@ Atmos supports many different ways of configuring and using `Go` templates: - In [Imports](/core-concepts/stacks/imports) - In [Stack Manifests](/core-concepts/stacks) -### Phases + +### Phases of Template Evaluation These templates are processed in different phases and use different context: @@ -543,7 +570,7 @@ chart_values: message: '{{ printf "Application {{ .app.metadata.name }} is now running new version." }}' ``` -## Excluding Templates in Imports from Processing by Atmos +## Excluding Templates in Imports If you are using [`Go` Templates in Imports](/core-concepts/stacks/imports#go-templates-in-imports) and `Go` templates in stack manifests in the same Atmos manifest, take into account that in this case Atmos will do `Go` diff --git a/website/docs/introduction/faq.mdx b/website/docs/introduction/faq.mdx index 14a0b7d4d..dc5ec1060 100644 --- a/website/docs/introduction/faq.mdx +++ b/website/docs/introduction/faq.mdx @@ -8,19 +8,15 @@ import ReactPlayer from 'react-player' ### Why is the tool called Atmos? -*Once upon a time*, in the vast expanse of cloud computing, there was a need for a tool that could orchestrate and manage the complex layers of -infrastructure with ease and precision. This tool would need to rise above the rest, be completely automated, providing oversight and control -much like a protective layer enveloping the Earth. Thus, the idea of "atmos" was born, drawing inspiration from the visionary science fiction -of the 1986 "Aliens" movie, where [atmospheric terraformers](https://avp.fandom.com/wiki/Atmosphere_Processing_Plant) transform alien worlds -into hospitable realms. +*Once upon a time*, in the vast expanse of cloud computing, there was a need for a tool that could orchestrate and manage the complex layers of infrastructure with ease and precision. This tool would need to rise above the rest, be completely automated, providing oversight and control much like a protective layer enveloping the Earth. Thus, the idea of "atmos" was born, drawing inspiration from the visionary science fiction of the 1986 "Aliens" movie, where [atmospheric terraformers](https://avp.fandom.com/wiki/Atmosphere_Processing_Plant) transform alien worlds into hospitable realms. -But there's more to the story. As the [Cloud Posse](https://cloudposse.com) delved deeper into crafting this tool, they discovered a wonderful +But there's more to the story. As the [Cloud Posse](https://cloudposse.com) delved deeper into crafting this tool, they discovered a wonderful coincidence. "Atmos" could stand for **"Automated Terraform Management & Orchestration Software"** perfectly encapsulating its purpose and capabilities. This serendipitous acronym was a delightful surprise, further cementing the name's destiny. ### Are there any reference architectures for Atmos? -Yes and no. Cloud Posse sells [reference architectures for AWS](https://cloudposse.com/services/) based on Atmos and Terraform. Funded Startups and Enterprises are the targets of these architectures. +Yes and no. Cloud Posse sells [reference architectures for AWS](https://cloudposse.com/services/) based on Atmos and Terraform, that are ideal for Funded Startups and Enterprises. We plan to release some free reference architectures soon but cannot commit to a specific date. diff --git a/website/docs/quick-start/advanced/configure-cli.mdx b/website/docs/quick-start/advanced/configure-cli.mdx index f8a0e99f5..04a4c2078 100644 --- a/website/docs/quick-start/advanced/configure-cli.mdx +++ b/website/docs/quick-start/advanced/configure-cli.mdx @@ -121,7 +121,7 @@ to [CLI Configuration](/cli/configuration).
`base_path`
-
The base path for components, stacks and workflows configurations. We set it to an empty string because we've decided to use the ENV var `ATMOS_BASE_PATH` to point to the absolute path of the root of the repo.
+
The base path for components, stacks and workflows configurations. We set it to `./` so it will use the current working directory. Alternatively, we can override this behavior by setting the ENV var `ATMOS_BASE_PATH` to point to another directory location.
`components.terraform.base_path`
The base path to the Terraform components (Terraform root modules). As described in [Configure Repository](/quick-start/advanced/configure-repository), we've decided to put the Terraform components into the `components/terraform` directory, and this setting tells Atmos where to find them. Atmos will join the base path (set in the `ATMOS_BASE_PATH` ENN var) with `components.terraform.base_path` to calculate the final path to the Terraform components.
diff --git a/website/docs/quick-start/simple/configure-cli.mdx b/website/docs/quick-start/simple/configure-cli.mdx index 0c3412ece..aa7a9c8d3 100644 --- a/website/docs/quick-start/simple/configure-cli.mdx +++ b/website/docs/quick-start/simple/configure-cli.mdx @@ -88,7 +88,7 @@ Well-known paths are how Atmos finds all your stack configurations, components,
`base_path`
-
The base path for components, stacks, and workflow configurations. We set it to an empty string because we've decided to use the ENV var `ATMOS_BASE_PATH` to point to the absolute path of the root of the repo
+
The base path for components, stacks, and workflow configurations. We set it to `./` so it will use the current working directory. Alternatively, we can override this behavior by setting the ENV var `ATMOS_BASE_PATH` to point to another directory location.
`components.terraform.base_path`
The base path to the Terraform components (Terraform root modules). As described in [Configure Repository](/quick-start/advanced/configure-repository), we've decided to put the Terraform components into the `components/terraform` directory, and this setting tells Atmos where to find them. Atmos will join the base path (set in the `ATMOS_BASE_PATH` ENV var) with `components.terraform.base_path` to calculate the final path to the Terraform components
diff --git a/website/src/css/landing-page.css b/website/src/css/landing-page.css index 87f389008..a93d51e78 100644 --- a/website/src/css/landing-page.css +++ b/website/src/css/landing-page.css @@ -1,47 +1,46 @@ -html[data-theme='dark'] .landing-page footer { - background: rgb(0 0 0 / 21%); +html[data-theme="dark"] .landing-page footer { + background: rgb(0 0 0 / 21%); } .landing-page main h2 strong { - color: #fff; + color: #fff; } - - /* Homepage */ -html.plugin-pages body, html[data-theme='dark'].plugin-pages body{ - background-image: none; +html.plugin-pages body, +html[data-theme="dark"].plugin-pages body { + background-image: none; } .landing-page .section__description { - font-size: 1em; - margin-left: 1.5em; - margin-right: 1.5em; - display: flex; - flex-direction: column; + font-size: 1em; + margin-left: 1.5em; + margin-right: 1.5em; + display: flex; + flex-direction: column; } .landing-page .section__description > p { - font-size: 1.5em; + font-size: 1.5em; } -html[data-theme='dark'] .landing-page .section__description > p { - color: #ccc; +html[data-theme="dark"] .landing-page .section__description > p { + color: #ccc; } .landing-page .section__description > h2 { - font-size: 2.5rem; - margin-bottom: 0.5em; + font-size: 2.5rem; + margin-bottom: 0.5em; } -html[data-theme='dark'] .landing-page .section__description > h2 { - color: #fff; +html[data-theme="dark"] .landing-page .section__description > h2 { + color: #fff; } .landing-page .section__description .button { - margin-left: auto; - margin-right: auto; + margin-left: auto; + margin-right: auto; } .landing-page main section { @@ -50,21 +49,23 @@ html[data-theme='dark'] .landing-page .section__description > h2 { } .landing-page main { - display: flex; - flex-direction: column; - align-items: center; + display: flex; + flex-direction: column; + align-items: center; } .landing-page .main-wrapper { - align-items: center; + align-items: center; + margin-left: 3em; + margin-right: 3em; } .landing-page img.screenshot { - max-width: 50%; - height: auto; - box-shadow: 0 0 20px 3px rgb(8 115 115 / 29%); - border-radius: 10px; - align-self: center; + max-width: 50%; + height: auto; + box-shadow: 0 0 20px 3px rgb(8 115 115 / 29%); + border-radius: 10px; + align-self: center; } .landing-page .intro { @@ -102,14 +103,15 @@ html[data-theme='dark'] .landing-page .section__description > h2 { font-size: 1.5em; } -.landing-page header h1, .landing-page header h3 { +.landing-page header h1, +.landing-page header h3 { text-align: center; } .landing-page .hero img { - min-width: 50%; - width: 100%; - height: auto; + min-width: 50%; + width: 100%; + height: auto; } .hero--full-height { @@ -124,58 +126,62 @@ html[data-theme='dark'] .landing-page .section__description > h2 { gap: 1rem; justify-content: center; display: flex; - } .landing-page main h2 { - text-align: center; - font-size: 2.5em; - margin-bottom: 2em; - color: #ccc; + text-align: center; + font-size: 2.5em; + margin-bottom: 2em; + color: #ccc; } .landing-page main h2.section { - background: #030711; - min-height: 4em; - justify-content: center; - flex-direction: column; - display: flex; - flex-grow: 1; - flex-basis: 100%; - width: 100vw; - vertical-align: middle; - align-items: center; - + background: #030711; + min-height: 4em; + justify-content: center; + flex-direction: column; + display: flex; + flex-grow: 1; + flex-basis: 100%; + width: 100vw; + vertical-align: middle; + align-items: center; } -html[data-theme='dark'] .landing-page main h2.section { - background: rgb(0 0 0 / 21%); +html[data-theme="dark"] .landing-page main h2.section { + background: rgb(0 0 0 / 21%); } -html[data-theme='dark'] .hero h1, html[data-theme='dark'] .section__description h2 { - color: unset; - background: linear-gradient(to right bottom, rgb(255, 255, 255) 30%, rgba(255, 255, 255, 0.50)) text; - -webkit-background-clip: text; - -webkit-text-fill-color: transparent; +html[data-theme="dark"] .hero h1, +html[data-theme="dark"] .section__description h2 { + color: unset; + background: linear-gradient( + to right bottom, + rgb(255, 255, 255) 30%, + rgba(255, 255, 255, 0.5) + ) + text; + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; } .landing-page main h3 { - text-align: center; + text-align: center; } .landing-page footer h2 { - color: #ccc; + color: #ccc; } .landing-page footer h3 { - font-size: 2em; - line-height: 1.7em; - color: #7c7b7b; - text-align: center; + font-size: 2em; + line-height: 1.7em; + color: #7c7b7b; + text-align: center; } .landing-page footer { - background: #0a1922; - min-width: 100vw; - padding: 3em; - text-align: center; + background: #0a1922; + min-width: 100vw; + margin: 3em; + text-align: center; } strong.underline { @@ -205,60 +211,59 @@ strong.underline::after { } .alternate-section { - display: flex; - gap: 2rem; - margin-bottom: 10rem; - flex-wrap: nowrap; - padding: 2rem; + display: flex; + gap: 2rem; + margin-bottom: 10rem; + flex-wrap: nowrap; + padding: 2rem; } .landing-page .alternate-section .terminal { - max-width: 50vw; + max-width: 50vw; } .landing-page .terminal pre.screengrab { - /* for the atmos logo, it's best to have 0.95em, but no logos on this page */ - line-height: 1.1em; -} - -@media screen and (max-width: 996px) -{ - .landing-page header { - justify-content: flex-start; - max-width: 100vw; - overflow: hidden;; - } - - .hero__cta { - gap: 1rem; - display: flex; - max-width: 100vw; - flex-wrap: wrap; - } - - .alternate-section { - flex-wrap: wrap; - } - .landing-page main { - max-width: 100vw; - overflow: hidden; - } - .landing-page img.screenshot { - max-width: 98%; - } - - .landing-page .alternate-section .terminal { - max-width: 98vw; - } - - .landing-page .alternate-section { - margin-bottom: 0; - } - - .landing-page footer h2 { - display: flex; - flex-direction: column; - } + /* for the atmos logo, it's best to have 0.95em, but no logos on this page */ + line-height: 1.1em; +} + +@media screen and (max-width: 996px) { + .landing-page header { + justify-content: flex-start; + max-width: 100vw; + overflow: hidden; + } + + .hero__cta { + gap: 1rem; + display: flex; + max-width: 100vw; + flex-wrap: wrap; + } + + .alternate-section { + flex-wrap: wrap; + } + .landing-page main { + max-width: 100vw; + overflow: hidden; + } + .landing-page img.screenshot { + max-width: 98%; + } + + .landing-page .alternate-section .terminal { + max-width: 98vw; + } + + .landing-page .alternate-section { + margin-bottom: 0; + } + + .landing-page footer h2 { + display: flex; + flex-direction: column; + } } .section--image-left { From 81f6db2d6071951e12255ae00d3c062dd466d064 Mon Sep 17 00:00:00 2001 From: RoseSecurity <72598486+RoseSecurity@users.noreply.github.com> Date: Fri, 15 Nov 2024 14:04:43 -0500 Subject: [PATCH 2/5] feat: enhance `WriteToFileAsJSON` with pretty-printing support (#783) * feat: indent json files for pretty printing * feat: use ConvertToJSON function --- pkg/utils/json_utils.go | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/pkg/utils/json_utils.go b/pkg/utils/json_utils.go index f509a4e62..aeb8ad4b6 100644 --- a/pkg/utils/json_utils.go +++ b/pkg/utils/json_utils.go @@ -44,7 +44,14 @@ func WriteToFileAsJSON(filePath string, data any, fileMode os.FileMode) error { if err != nil { return err } - err = os.WriteFile(filePath, []byte(j), fileMode) + + // Convert data to indented JSON + indentedJSON, err := json.MarshalIndent(json.RawMessage(j), "", " ") + if err != nil { + return err + } + + err = os.WriteFile(filePath, indentedJSON, fileMode) if err != nil { return err } @@ -53,7 +60,7 @@ func WriteToFileAsJSON(filePath string, data any, fileMode os.FileMode) error { // ConvertToJSON converts the provided value to a JSON-encoded string func ConvertToJSON(data any) (string, error) { - var jc = jsoniter.Config{ + jc := jsoniter.Config{ EscapeHTML: true, ObjectFieldMustBeSimpleString: false, SortMapKeys: true, @@ -69,7 +76,7 @@ func ConvertToJSON(data any) (string, error) { // ConvertToJSONFast converts the provided value to a JSON-encoded string using 'ConfigFastest' config and json.Marshal without indents func ConvertToJSONFast(data any) (string, error) { - var jc = jsoniter.Config{ + jc := jsoniter.Config{ EscapeHTML: false, MarshalFloatWith6Digits: true, ObjectFieldMustBeSimpleString: true, @@ -86,7 +93,7 @@ func ConvertToJSONFast(data any) (string, error) { // ConvertFromJSON converts the provided JSON-encoded string to Go data types func ConvertFromJSON(jsonString string) (any, error) { - var jc = jsoniter.Config{ + jc := jsoniter.Config{ EscapeHTML: false, MarshalFloatWith6Digits: true, ObjectFieldMustBeSimpleString: true, From f909493f8818bc9216c3544a889c4a0fb73dc8d4 Mon Sep 17 00:00:00 2001 From: Pulak Kanti Bhowmick Date: Sun, 17 Nov 2024 02:37:06 +0600 Subject: [PATCH 3/5] add support for disabling custom terraform shell prompt (#786) * add cli config Signed-off-by: Pulak Kanti Bhowmick * pass shell prompt based on cli config Signed-off-by: Pulak Kanti Bhowmick * fix Signed-off-by: Pulak Kanti Bhowmick * add templating support and add login shell when prompt is not there Signed-off-by: Pulak Kanti Bhowmick * add login shell correctly Signed-off-by: Pulak Kanti Bhowmick --------- Signed-off-by: Pulak Kanti Bhowmick --- internal/exec/shell_utils.go | 31 +++++++++++++++++++++++++++++-- pkg/schema/schema.go | 19 ++++++++++++------- 2 files changed, 41 insertions(+), 9 deletions(-) diff --git a/internal/exec/shell_utils.go b/internal/exec/shell_utils.go index c142c75cd..e585e6a08 100644 --- a/internal/exec/shell_utils.go +++ b/internal/exec/shell_utils.go @@ -10,6 +10,7 @@ import ( "path/filepath" "runtime" "strings" + "text/template" "mvdan.cc/sh/v3/expand" "mvdan.cc/sh/v3/interp" @@ -155,7 +156,28 @@ func execTerraformShellCommand( componentEnvList = append(componentEnvList, fmt.Sprintf("TF_CLI_ARGS_import=-var-file=%s", varFile)) componentEnvList = append(componentEnvList, fmt.Sprintf("TF_CLI_ARGS_destroy=-var-file=%s", varFile)) componentEnvList = append(componentEnvList, fmt.Sprintf("TF_CLI_ARGS_console=-var-file=%s", varFile)) - componentEnvList = append(componentEnvList, fmt.Sprintf("PS1=atmos:%s/%s> ", stack, component)) + + hasCustomShellPrompt := cliConfig.Components.Terraform.Shell.Prompt != "" + if hasCustomShellPrompt { + // Template for the custom shell prompt + tmpl := cliConfig.Components.Terraform.Shell.Prompt + + // Data for the template + data := struct { + Component string + Stack string + }{ + Component: component, + Stack: stack, + } + + // Parse and execute the template + var result bytes.Buffer + t := template.Must(template.New("shellPrompt").Parse(tmpl)) + if err := t.Execute(&result, data); err == nil { + componentEnvList = append(componentEnvList, fmt.Sprintf("PS1=%s", result.String())) + } + } u.LogDebug(cliConfig, "\nStarting a new interactive shell where you can execute all native Terraform commands (type 'exit' to go back)") u.LogDebug(cliConfig, fmt.Sprintf("Component: %s\n", component)) @@ -197,7 +219,12 @@ func execTerraformShellCommand( } shellName := filepath.Base(shellCommand) - if shellName == "zsh" { + + if !hasCustomShellPrompt { + shellCommand = shellCommand + " -l" + } + + if shellName == "zsh" && hasCustomShellPrompt { shellCommand = shellCommand + " -d -f -i" } } diff --git a/pkg/schema/schema.go b/pkg/schema/schema.go index 7c09d2894..7eacc76ff 100644 --- a/pkg/schema/schema.go +++ b/pkg/schema/schema.go @@ -66,13 +66,18 @@ type TemplatesSettingsGomplate struct { } type Terraform struct { - BasePath string `yaml:"base_path" json:"base_path" mapstructure:"base_path"` - ApplyAutoApprove bool `yaml:"apply_auto_approve" json:"apply_auto_approve" mapstructure:"apply_auto_approve"` - AppendUserAgent string `yaml:"append_user_agent" json:"append_user_agent" mapstructure:"append_user_agent"` - DeployRunInit bool `yaml:"deploy_run_init" json:"deploy_run_init" mapstructure:"deploy_run_init"` - InitRunReconfigure bool `yaml:"init_run_reconfigure" json:"init_run_reconfigure" mapstructure:"init_run_reconfigure"` - AutoGenerateBackendFile bool `yaml:"auto_generate_backend_file" json:"auto_generate_backend_file" mapstructure:"auto_generate_backend_file"` - Command string `yaml:"command" json:"command" mapstructure:"command"` + BasePath string `yaml:"base_path" json:"base_path" mapstructure:"base_path"` + ApplyAutoApprove bool `yaml:"apply_auto_approve" json:"apply_auto_approve" mapstructure:"apply_auto_approve"` + AppendUserAgent string `yaml:"append_user_agent" json:"append_user_agent" mapstructure:"append_user_agent"` + DeployRunInit bool `yaml:"deploy_run_init" json:"deploy_run_init" mapstructure:"deploy_run_init"` + InitRunReconfigure bool `yaml:"init_run_reconfigure" json:"init_run_reconfigure" mapstructure:"init_run_reconfigure"` + AutoGenerateBackendFile bool `yaml:"auto_generate_backend_file" json:"auto_generate_backend_file" mapstructure:"auto_generate_backend_file"` + Command string `yaml:"command" json:"command" mapstructure:"command"` + Shell ShellConfig `yaml:"shell" json:"shell" mapstructure:"shell"` +} + +type ShellConfig struct { + Prompt string `yaml:"prompt" json:"prompt" mapstructure:"prompt"` } type Helmfile struct { From 1020645af6726c096c7250378f591e137036bf14 Mon Sep 17 00:00:00 2001 From: Haitham Rageh Date: Tue, 19 Nov 2024 07:11:54 +0200 Subject: [PATCH 4/5] handle empty stack yaml file configuration (#791) * fix: handle empty stack YAML configuration and adjust file content retrieval * fix: return existing content from GetFileContent instead of an empty string * fix: remove unnecessary blank lines in ProcessYAMLConfigFile and GetFileContent functions --- examples/demo-localstack/stacks/deploy/footbar.yaml | 0 internal/exec/stack_processor_utils.go | 3 +++ 2 files changed, 3 insertions(+) create mode 100644 examples/demo-localstack/stacks/deploy/footbar.yaml diff --git a/examples/demo-localstack/stacks/deploy/footbar.yaml b/examples/demo-localstack/stacks/deploy/footbar.yaml new file mode 100644 index 000000000..e69de29bb diff --git a/internal/exec/stack_processor_utils.go b/internal/exec/stack_processor_utils.go index b6c6f4d0e..b616e2348 100644 --- a/internal/exec/stack_processor_utils.go +++ b/internal/exec/stack_processor_utils.go @@ -199,6 +199,9 @@ func ProcessYAMLConfigFile( return nil, nil, nil, err } } + if stackYamlConfig == "" { + return map[string]any{}, map[string]map[string]any{}, map[string]any{}, nil + } stackManifestTemplatesProcessed := stackYamlConfig stackManifestTemplatesErrorMessage := "" From 39cf094629fc4eedbb4a7780f88dcb1fbb31c908 Mon Sep 17 00:00:00 2001 From: Haitham Rageh Date: Tue, 19 Nov 2024 16:04:14 +0200 Subject: [PATCH 5/5] Set Default Schema to Remote Schema (#777) * feat: set default Atmos manifest URL if not specified in configuration * feat: log trace message when using default Atmos JSON Schema file * fix: improve error message for missing Atmos JSON Schema file * Update internal/exec/validate_stacks.go * fix: change log level from trace to info for default Atmos JSON Schema message * fix: change log level from info to trace for default Atmos JSON Schema message --------- Co-authored-by: Erik Osterman (CEO @ Cloud Posse) Co-authored-by: Andriy Knysh --- internal/exec/validate_stacks.go | 43 ++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/internal/exec/validate_stacks.go b/internal/exec/validate_stacks.go index 29c50bd15..13830b1a0 100644 --- a/internal/exec/validate_stacks.go +++ b/internal/exec/validate_stacks.go @@ -19,6 +19,8 @@ import ( u "github.com/cloudposse/atmos/pkg/utils" ) +const atmosManifestDefault = "https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json" + // ExecuteValidateStacksCmd executes `validate stacks` command func ExecuteValidateStacksCmd(cmd *cobra.Command, args []string) error { info, err := processCommandLineArgs("", cmd, args, nil) @@ -84,27 +86,30 @@ func ValidateStacks(cliConfig schema.CliConfiguration) error { // The path to the Atmos manifest JSON Schema can be absolute path or a path relative to the `base_path` setting in `atmos.yaml` var atmosManifestJsonSchemaFilePath string - if cliConfig.Schemas.Atmos.Manifest != "" { - atmosManifestJsonSchemaFileAbsPath := path.Join(cliConfig.BasePath, cliConfig.Schemas.Atmos.Manifest) - - if u.FileExists(cliConfig.Schemas.Atmos.Manifest) { - atmosManifestJsonSchemaFilePath = cliConfig.Schemas.Atmos.Manifest - } else if u.FileExists(atmosManifestJsonSchemaFileAbsPath) { - atmosManifestJsonSchemaFilePath = atmosManifestJsonSchemaFileAbsPath - } else if u.IsURL(cliConfig.Schemas.Atmos.Manifest) { - atmosManifestJsonSchemaFilePath, err = downloadSchemaFromURL(cliConfig.Schemas.Atmos.Manifest) - if err != nil { - return err - } - } else { - return fmt.Errorf("the Atmos JSON Schema file '%s' does not exist.\n"+ - "It can be configured in the 'schemas.atmos.manifest' section in 'atmos.yaml', or provided using the 'ATMOS_SCHEMAS_ATMOS_MANIFEST' "+ - "ENV variable or '--schemas-atmos-manifest' command line argument.\n"+ - "The path to the schema file should be an absolute path or a path relative to the 'base_path' setting in 'atmos.yaml'. \n"+ - "Alternatively, you can specify a schema file using a URL that will be downloaded automatically.", - cliConfig.Schemas.Atmos.Manifest) + if cliConfig.Schemas.Atmos.Manifest == "" { + cliConfig.Schemas.Atmos.Manifest = atmosManifestDefault + u.LogTrace(cliConfig, fmt.Sprintf("The Atmos JSON Schema file is not configured. Using the default schema '%s'", atmosManifestDefault)) + } + atmosManifestJsonSchemaFileAbsPath := path.Join(cliConfig.BasePath, cliConfig.Schemas.Atmos.Manifest) + + if u.FileExists(cliConfig.Schemas.Atmos.Manifest) { + atmosManifestJsonSchemaFilePath = cliConfig.Schemas.Atmos.Manifest + } else if u.FileExists(atmosManifestJsonSchemaFileAbsPath) { + atmosManifestJsonSchemaFilePath = atmosManifestJsonSchemaFileAbsPath + } else if u.IsURL(cliConfig.Schemas.Atmos.Manifest) { + atmosManifestJsonSchemaFilePath, err = downloadSchemaFromURL(cliConfig.Schemas.Atmos.Manifest) + if err != nil { + return err } + } else { + return fmt.Errorf("Schema file '%s' not found. Configure via:\n"+ + "1. 'schemas.atmos.manifest' in atmos.yaml\n"+ + "2. ATMOS_SCHEMAS_ATMOS_MANIFEST env var\n"+ + "3. --schemas-atmos-manifest flag\n\n"+ + "Accepts: absolute path, paths relative to base_path, or URL", + cliConfig.Schemas.Atmos.Manifest) } + // Include (process and validate) all YAML files in the `stacks` folder in all subfolders includedPaths := []string{"**/*"} // Don't exclude any YAML files for validation