runatlantis / atlantis

Terraform Pull Request Automation
https://www.runatlantis.io
Other
7.83k stars 1.06k forks source link

Accept list of workspaces to iterate through for a directory #1124

Open kneemaa opened 4 years ago

kneemaa commented 4 years ago

Problem

Currently when you want to add a workspace for an already managed directory to your atlantis.yml you have to define the project as a new block with identical values except for the workspace differing. This isn't a noticeable hurdle for one or two additional workspaces but as you towards 5+ the .yml begins to become redundant.

Example. In order to add workspace networking-stage-us-west-2 I have to duplicate the entire block.

- name: networking-prod-us-west-2
  dir: terraform/networking
  workspace: networking-prod-us-west-2
  workflow: workspace_toggle
  terraform_version: v0.12.24
  apply_requirements: [approved]
- name: networking-stage-us-west-2
  dir: terraform/networking
  workspace: networking-stage-us-west-2
  workflow: workspace_toggle
  terraform_version: v0.12.24
  apply_requirements: [approved]

Suggested Solution

Allow for a list of workspaces to be iterated through. If the project name must still be unique, potentially having the workspace name be the project name would simplify that as well. Example

- name: networking
  dir: terraform/networking
  workspace: [networking-prod-us-west-2, networking-stage-us-west-2, networking-qa-us-east-1 ]
  workflow: workspace_toggle
  terraform_version: v0.12.24
  apply_requirements: [approved]
vitaly-dt commented 1 year ago

Hello, is there any news regarding this feature?