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

feat: support passing workspaces to include in the config #219

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mmalecki
Copy link
Contributor

@mmalecki mmalecki commented Apr 5, 2022

Pull Request

Related Github Issues

  • [none]

Description

This allows us to generate Atlantis configurations including hard-coded
workspaces, as passed in by the user.

We use workspaces (as opposed to Terragrunt's recommended way of
directories) to separate our environments. This allows us to generate a
Atlantis configuration containing "blessed" environments we want to
operate via Atlantis.

Apologies for the awkward Golang. I don't write it daily, so I'm sure there's a neater way to solve this. I'd appreciate any guidance here.

Security Implications

  • [none]

System Availability

  • [none]

@dennislapchenko
Copy link
Collaborator

Have a similar request, to be able to say:

locals {
  atlantis_workspace = "my_workspace"
}

alongside a general --create-workspaces.

This would allow joining some modules into one workspace for various reasons. I suspect it would be another feature?

@mmalecki
Copy link
Contributor Author

@dennislapchenko yeah, I think so. Just taking a look at the surrounding code in createProject, since we appear to have the locals handy, you could just set project.Workspace = locals.Workspace.

I rebased this off master and added some tests for preserving and updating projects with workspaces set, since I added some complexity there.

This allows us to generate Atlantis configurations including hard-coded
workspaces, as passed in by the user.

We use workspaces (as opposed to Terragrunt's recommended way of
directories) to separate our environments. This allows us to generate a
Atlantis configuration containing "blessed" environments we want to
operate via Atlantis.
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.

None yet

2 participants