Skip to content

Dynamically autoplanning with uncommitted files #6297

@nitrocode

Description

@nitrocode

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.

Describe the user story

I have implemented the atmos documentation to setup autoplanning but it only autoplans all components when a component terraform file is modified. It doesn't take into account stack yaml. When the stack yaml is modified, it changes the uncommitted tfvars file. perhaps only one instance is updated instead of all 100 instances of a component. We'd only want a single instance to autoplan in that case instead of all 100.

Describe the solution you'd like

Id like atlantis to come up with a clever solution, either with the existing feature set, or something native to dynamically trigger only modified component-stacks that were affected by stack yaml changes.

One solution could be to generate tfvars from the base branch, then generate tfvars from the pr branch, diff them, if there are differences, trigger a plan for those. Perhaps we can run some kind of hook that can run a custom script and its output can be the projects it triggers.

workarounds

  • Create a custom file that matches the full component-stack slug, in each project autoplan in atmos.yaml. then run atmos describe affected stacks in a GitHub action and commit a modified file matching that slug within the component directory e.g. s3-test-bucket-ue1-dev.txt
  • Commit the tfvars file per component-stack

Metadata

Metadata

Labels

featureNew functionality/enhancement

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions