Skip to content

Add Terraform VM start/stop actions for cost management during challenges #55

@codycodes

Description

@codycodes

I'd like to add Azure (and potentially AWS & GCP) VM start/stop actions using Terraform 1.14's new actions feature to help with cost management. This would give users an additional mechanism to pause VMs without losing progress while avoiding ongoing compute costs. Would this type of enhancement align with the project goals?

Use case: I'm working through challenges in my free time and often need to pause between sessions to avoid ongoing VM costs. Currently this requires switching between Terraform and using the Azure portal or figuring out parameters to use with the az CLI, adding friction to the workflow. Having VM lifecycle management within the same Terraform toolchain would streamline the experience and teach real-world cost optimization patterns.

I've already implemented this locally for Azure and would be happy to contribute if there's interest.

For reference, here's what the terraform command could look like:

terraform apply -invoke=action.azurerm_virtual_machine_power.ctf_power_off -var-file=main.tfvars -auto-approve

Thanks for your consideration & appreciate the ctfs: I'm about halfway through and having lots of fun learning more Linux 🐧

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions