Skip to content

Run a plan across all workspaces to identify whether a template version will mess up things #8605

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

Closed
bpmct opened this issue Jul 19, 2023 · 2 comments

Comments

@bpmct
Copy link
Member

bpmct commented Jul 19, 2023

Background

Templates are fragile. While they can be bulletproofed, it is hard to tell what the impact of a template update is across all of the existing workspaces. This could show an aggregated response of what the impact is.

Research & vision

We should look at how other platforms like Spacelift or Terraform Enterprise do this. For example, are there tools that measure what impact an update to a module has on all of the underlying infrastructure? There may be better ways to do this.

We should also consider how this could be automated in Ci/Cd platforms and ran alongside other custom template tests a user might make (e.g. "does the project still build with this template update?". This probably means supporting JSON output and human-readable output

Also, perhaps this could be integrated with Infracost down the road to measure how a template update saves/resolves cloud cost across a fleet of workspaces.

How it would work

Here's my initial idea

$ coder templates pull my-template
$ vim main.tf 
# make changes (e.g. hardcode disk size to 45gb)
$ coder templates plan my-template
Running `terraform plan` against all 200 workspaces using this template 

For 150 started workspaces:
- Plan to modify `aws_instance: workspace`
- Plan to modify `ebs_volume: home`

For 48 stopped workspaces:
- Plan to modify `ebs_volume: home`

⚠️ Warning: Plan to destroy `ebs-volume: home` on 2 workspaces:
- bpmct/my_workspace
- spikecurtis/my-workspace

This would fix #7104 as the command currently does nothing

@cdr-bot cdr-bot bot added the feature label Jul 19, 2023
@johnstcn
Copy link
Member

Running a terraform plan across a number of workspace will be an expensive operation, so we may need to have some way of limiting how many provisioners a job like this can use.

@github-actions github-actions bot added the stale This issue is like stale bread. label Feb 14, 2024
@MrPeacockNLB
Copy link
Contributor

It sounds interessting to see if there were plans that fails if a template update occurs

@github-actions github-actions bot removed the stale This issue is like stale bread. label Feb 15, 2024
@sreya sreya closed this as not planned Won't fix, can't repro, duplicate, stale Apr 4, 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

No branches or pull requests

4 participants