Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Improve atmos validate stacks and atmos describe affected commands #608

Merged
merged 12 commits into from
May 25, 2024

Conversation

aknysh
Copy link
Member

@aknysh aknysh commented May 25, 2024

what

why

  • atmos validate stacks now detects if the same component in the same stack are defined in more than one Atmos stack manifest files. If such a misconfiguration is detected, the following error is shown:

    the Atmos component 'vpc' in the stack 'plat-ue2-dev' is defined in more than one top-level 
    stack manifest files: orgs/acme/plat/dev/us-east-2, orgs/acme/plat/dev/us-east-2-extras.
    Atmos can't decide which stack manifest to use to get configuration for the component in the stack.
    This is a stack misconfiguration.
  • atmos describe affected now has better error messages and also executes atmos validate stacks before detecting the affected components and stacks. This prevents the issue when the same component in the same stack is defined in more than one stack manifest file, and the command used one file from the current local branch and the other file from the target branch, resulting in drift in affected components and stacks. Since this is a stack misconfiguration and is not permitted, atmos describe affected will display the error and exit

  • alias: Multiple Provider Configuration in Atmos Manifests

    Atmos allows you to define multiple configurations for the same provider using a list of provider blocks and the alias meta-argument.

    The generated providers_override.tf.json file will have a list of provider configurations, and Terraform will use and override the providers as long as the aliased providers are defined in the Terraform component.

    For example:

    components: 
      terraform:
        vpc:
          providers:
            aws:
              - region: us-west-2
                assume_role:
                  role_arn: "role-1"
              - region: us-west-2
                alias: "account-2"
                assume_role:
                  role_arn: "role-2"

@aknysh aknysh added the minor New features that do not break anything label May 25, 2024
@aknysh aknysh requested a review from osterman May 25, 2024 05:35
@aknysh aknysh self-assigned this May 25, 2024
@aknysh aknysh requested review from a team as code owners May 25, 2024 05:36
…ected-3

# Conflicts:
#	website/docs/core-concepts/components/terraform-providers.mdx
@aknysh aknysh merged commit d00aa78 into master May 25, 2024
13 checks passed
@aknysh aknysh deleted the update-describe-affected-3 branch May 25, 2024 15:11
goruha added a commit that referenced this pull request Jun 3, 2024
* master:
  Update `atmos validate stacks` command (#611)
  Add Atmos manifest lists merge strategies (#609)
  Improve `atmos validate stacks` and `atmos describe affected` commands (#608)
  Use Darker Theme, Add File Component (#607)
  Update Atmos logs. Update docs (#605)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor New features that do not break anything
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants