Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Update spacelift component. Add settings.spacelift.space_name_pattern attribute #980

Merged
merged 4 commits into from
Feb 12, 2024

Conversation

aknysh
Copy link
Member

@aknysh aknysh commented Feb 12, 2024

what

  • Update spacelift component
  • Add settings.spacelift.space_name_pattern attribute

why

  • We had settings.spacelift.space_name attribute to specify a Spacelift stack for a component. It works for the cases where it can be placed into some default Atmos manifest for the Org, tenant, region or stage. But if we have multiple Organizations with many tenants, and we deploy the same components into them, and we want to add a specific component into a dedicated Spacelift space, the entire configuration becomes not DRY (we need to add settings.spacelift.space_name into each top-level stack in each Org/tenant/account for ALL components, which would be hundreds or thousands of lines of non-DRY code for some infras).

  • Using settings.spacelift.space_name_pattern attribute will allow adding the space_name_pattern attribute in the components' catalogs using the context tokens. For example

components:
   terraform:
      vpc:
         settings:
            spacelift: 
               space_name_pattern: "{namespace}-{tenant}-{stage}-plat"

The above configuration will allow placing the vpc component into different Spacelift spaces depending on the context tokens.

Another example:

components:
   terraform:
      eks/apps/web:
         settings:
            spacelift: 
               space_name_pattern: "{namespace}-apps-web"
  • Make the Spacelift spaces config DRY (and work for any infra configs)

@aknysh aknysh self-assigned this Feb 12, 2024
@aknysh aknysh requested review from a team as code owners February 12, 2024 21:35
@aknysh aknysh merged commit 51ec634 into main Feb 12, 2024
4 checks passed
@aknysh aknysh deleted the update-spacelift-components-2 branch February 12, 2024 21:56
goruha pushed a commit to cloudposse-terraform-components/aws-spacelift-admin-stack that referenced this pull request Nov 27, 2024
goruha pushed a commit to cloudposse-terraform-components/aws-spacelift-spaces that referenced this pull request Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants