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

[question] How best to support a subfolder of templates? #2222

Closed
red8888 opened this issue Apr 25, 2022 · 1 comment
Closed

[question] How best to support a subfolder of templates? #2222

red8888 opened this issue Apr 25, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@red8888
Copy link

red8888 commented Apr 25, 2022

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request. Searching for pre-existing feature requests helps us consolidate datapoints for identical requirements into a single place, thank you!
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Overview of the Issue

I have a big repo with lots of terraform folders (multiple states). I also use terraform templates. For readability I like to put my templates in a subfolder so the structure looks like this:

  • stateA

    • someConfig.tf
    • someOtherConfig.tf
    • templates
      • templateA.html
  • stateB

    • anotherConfig.tf
    • moreConfig.tf
    • templates
      • templateB.SQL

When a change is made to templateA.html I want Atlantis to run plan for stateA. How is this possible?

Looking at this question: #1085
Is this still the case?

"If you have an atlantis.yaml file you can specify each directory that should be tracked. You can then not set the root directory."

Having to specify every folder would be super cumbersome for me because I have lots. If thats the case I'd rather throw everything in the same folder, but then of course it's messy.

Is there currently a feature to support subfolders like this? What I would want is to be able to specify a list of "subfolder" strings and have atlantis stop recursing if it hits a folder named "templates" and treat that subfolder as part of the state of its parent.

@red8888 red8888 added the bug Something isn't working label Apr 25, 2022
@alexoliveira88
Copy link

It doesn't have a Feature that supports subfolder. Using pre-workflow-hooks you can create a script that generates atlantis.yaml automatically.

- name : stateA
  dir: dir-stateA
  autoplan:
    when_modified: ["*.tf", "templates"]
    enabled: true

- name : stateB
  dir: dir-stateB
  autoplan:
    when_modified: ["*.tf", "templates"]
    enabled: true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants