A small utility to help do start, stop and tag actions in an IaC stack for cost optimization purpose.
Project description
A small utility to help do start, stop and tag actions in an IaC stack for cost optimization purpose.
Stackoperator now support CloudFormation and Terraform stack.
It's a great idea to use stackoperator with Instance Scheduler on AWS solution by tagging stoppable resources created by IaC stack.
Use cases:
- During the POC testing process of solutions deployed using CloudFormation or Terraform, toggle related resources with one click to save testing costs.
- For solutions deployed using CloudFormation or Terraform, save operation costs by tagging toggleable resources and controlling their runtime using the Instance Scheduler on AWS solution.
Prerequisites:
Before using stackoperator script, please make sure correct AWS credential in envs, using aws-vault to store and switch AWS credentials is recommend.
Install
pip install stackoperator
Upgrade
pip install --upgrade stackoperator
Usage
Start stopped resources in a given CloudFormation Stack
startcfnstack --stackname <CloudFormation_Stack_Name>
Stop stoppable running resources in a given CloudFormation Stack
stopcfnstack --stackname <CloudFormation_Stack_Name>
Tag stoppable running resources in a given CloudFormation Stack
tagcfnstack --tags "Key1=Value1,Key2=Value2" --stackname <CloudFormation_Stack_Name>
Start stopped resources in Terraform Stack (at current path)
starttfstack [--statefile <Terraform_Stack_StateFile>]
Stop stoppable running resources in Terraform Stack (at current path)
stoptfstack [--statefile <Terraform_Stack_StateFile>]
Tag stoppable running resources in Terraform Stack (at current path)
tagtfstack --tags "Key1=Value1,Key2=Value2" [--statefile <Terraform_Stack_StateFile>]
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
stackoperator-0.1.1.tar.gz
(6.2 kB
view hashes)
Built Distribution
Close
Hashes for stackoperator-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 576f7f5de8b0b69b891992242c7bfd750dbe9203134230626fd430a68cc4bb96 |
|
MD5 | 563d871a59cd673f4916556879c6e6a5 |
|
BLAKE2b-256 | 20cab5a911a139316e1e25afa78c5e68ec6a71f904d2d7a9a4277ac382f61da2 |