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,Terraform stack,as well Resource Group.
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.
- Batch Start,Stop and Tag toggleable resources in a resource group.
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>]
Start stopped resources in Resrouce Group
startresourcegroup --groupname <Resource_Group_Name>
Stop stoppable running resources in Resource Group
startresourcegroup --groupname <Resource_Group_Name>
Tag stoppable running resources in Resource Group
tagresourcegroup --tags "Key1=Value1,Key2=Value2" --groupname <Resource_Group_Name>
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file stackoperator-0.2.0.tar.gz.
File metadata
- Download URL: stackoperator-0.2.0.tar.gz
- Upload date:
- Size: 6.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ffd51a46b947263cff10b50561d750720013f8cb37c344d8e32ccaab3babc134
|
|
| MD5 |
beef49f47e324839f4fb29db3d415274
|
|
| BLAKE2b-256 |
49e69e396e8d67b3168560c0665b823126b3c4af6eba4d9314f0de0578a38799
|
File details
Details for the file stackoperator-0.2.0-py3-none-any.whl.
File metadata
- Download URL: stackoperator-0.2.0-py3-none-any.whl
- Upload date:
- Size: 8.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
728b6c8c5b53231d48890a9ef575ecd9d576655c3a0fd611deaf783f8bae9e77
|
|
| MD5 |
4611d59fc4fca953581cf548a76ae328
|
|
| BLAKE2b-256 |
0041dcedfd0c785b52964fe206b1160b9a9484f44bc2043492d4ee30022205e4
|