{"id":17064996,"url":"https://github.com/turbot/flowpipe-mod-aws-thrifty","last_synced_at":"2025-04-22T13:41:46.804Z","repository":{"id":239619290,"uuid":"785402267","full_name":"turbot/flowpipe-mod-aws-thrifty","owner":"turbot","description":"Run pipelines to detect and correct AWS resources that are unused and underutilized to optimize costs. ","archived":false,"fork":false,"pushed_at":"2024-11-28T07:26:22.000Z","size":658,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-17T03:05:58.520Z","etag":null,"topics":["aws","cost","cost-optimization","flowpipe","flowpipe-mod","hacktoberfest","hcl","low-code","thrifty"],"latest_commit_sha":null,"homepage":"https://hub.flowpipe.io/mods/turbot/aws_thrifty","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/turbot.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-11T20:24:26.000Z","updated_at":"2024-11-28T07:25:58.000Z","dependencies_parsed_at":"2024-09-13T06:04:05.893Z","dependency_job_id":"bd329bd6-6118-47fb-a830-8eef6e716bbc","html_url":"https://github.com/turbot/flowpipe-mod-aws-thrifty","commit_stats":null,"previous_names":["turbot/flowpipe-mod-aws-thrifty"],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/turbot%2Fflowpipe-mod-aws-thrifty","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/turbot%2Fflowpipe-mod-aws-thrifty/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/turbot%2Fflowpipe-mod-aws-thrifty/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/turbot%2Fflowpipe-mod-aws-thrifty/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/turbot","download_url":"https://codeload.github.com/turbot/flowpipe-mod-aws-thrifty/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250250496,"owners_count":21399650,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","cost","cost-optimization","flowpipe","flowpipe-mod","hacktoberfest","hcl","low-code","thrifty"],"created_at":"2024-10-14T11:00:57.576Z","updated_at":"2025-04-22T13:41:46.795Z","avatar_url":"https://github.com/turbot.png","language":"HCL","funding_links":[],"categories":["HCL"],"sub_categories":[],"readme":"# AWS Thrifty Mod for Flowpipe\n\nPipelines to detect and correct misconfigurations leading to AWS savings opportunities.\n\n## Documentation\n\n- **[Pipelines →](https://hub.flowpipe.io/mods/turbot/aws_thrifty/pipelines)**\n\n## Getting Started\n\n### Requirements\n\nDocker daemon must be installed and running. Please see [Install Docker Engine](https://docs.docker.com/engine/install/) for more information.\n\n### Installation\n\nDownload and install Flowpipe (https://flowpipe.io/downloads) and Steampipe (https://steampipe.io/downloads). Or use Brew:\n\n```sh\nbrew install turbot/tap/flowpipe\nbrew install turbot/tap/steampipe\n```\n\nInstall the AWS plugin with [Steampipe](https://steampipe.io):\n\n```sh\nsteampipe plugin install aws\n```\n\nSteampipe will automatically use your default AWS credentials. Optionally, you can [setup multiple accounts](https://hub.steampipe.io/plugins/turbot/aws#multi-account-connections) or [customize AWS credentials](https://hub.steampipe.io/plugins/turbot/aws#configuring-aws-credentials).\n\nCreate a `connection_import` resource to import your Steampipe AWS connections:\n\n```sh\nvi ~/.flowpipe/config/aws.fpc\n```\n\n```hcl\nconnection_import \"aws\" {\n  source      = \"~/.steampipe/config/aws.spc\"\n  connections = [\"*\"]\n}\n```\n\nFor more information on importing connections, please see [Connection Import](https://flowpipe.io/docs/reference/config-files/connection_import).\n\nFor more information on connections in Flowpipe, please see [Managing Connections](https://flowpipe.io/docs/run/connections).\n\nInstall the mod:\n\n```sh\nmkdir aws-thrifty\ncd aws-thrifty\nflowpipe mod install github.com/turbot/flowpipe-mod-aws-thrifty\n```\n\n### Configure Variables\n\nSeveral pipelines have [input variables](https://flowpipe.io/docs/build/mod-variables#input-variables) that can be configured to better match your environment and requirements.\n\nEach variable has a default defined in its source file, e.g, `s3/s3_buckets_without_lifecycle_policy.fp` (or `variables.fp` for more generic variables), but these can be overwritten in several ways:\n\nThe easiest approach is to setup your vars file, starting with the sample:\n\n```sh\ncp flowpipe.fpvars.example flowpipe.fpvars\nvi flowpipe.fpvars\n\nflowpipe pipeline run aws_thrifty.pipeline.detect_and_correct_ebs_snapshots_exceeding_max_age --var-file=flowpipe.fpvars\n```\n\nAlternatively, you can pass variables on the command line:\n\n```sh\nflowpipe pipeline run aws_thrifty.pipeline.detect_and_correct_ebs_snapshots_exceeding_max_age --var=ebs_snapshot_age_max_days=10\n```\n\nOr through environment variables:\n\n```sh\nexport FP_VAR_ebs_snapshot_age_max_days=10\nflowpipe pipeline run aws_thrifty.pipeline.detect_and_correct_ebs_snapshots_exceeding_max_age\n```\n\nFor more information, please see [Passing Input Variables](https://flowpipe.io/docs/build/mod-variables#passing-input-variables)\n\n### Running Detect and Correct Pipelines\n\nTo run your first detection, you'll need to ensure your Steampipe server is up and running:\n\n```sh\nsteampipe service start\n```\n\nTo find your desired detection, you can filter the `pipeline list` output:\n\n```sh\nflowpipe pipeline list | grep \"detect_and_correct\"\n```\n\nThen run your chosen pipeline:\n\n```sh\nflowpipe pipeline run aws_thrifty.pipeline.detect_and_correct_ebs_snapshots_exceeding_max_age\n```\n\nThis will then run the pipeline and depending on your configured running mode; perform the relevant action(s), there are 3 running modes:\n- Wizard\n- Notify\n- Automatic\n\n#### Wizard\n\nThis is the `default` running mode, allowing for a hands-on approach to approving changes to resources by prompting for [input](https://flowpipe.io/docs/build/input) for each detected resource.\n\nWhilst the out of the box default is to run the workflow directly in the terminal. You can use Flowpipe [server](https://flowpipe.io/docs/run/server) and [external integrations](https://flowpipe.io/docs/build/input#create-an-integration) to prompt in `http`, `slack`, `teams`, etc.\n\n#### Notify\n\nThis mode as the name implies is used purely to report detections via notifications either directly to your terminal when running in client mode or via another configured [notifier](https://flowpipe.io/docs/reference/config-files/notifier) when running in server mode for each detected resource.\n\nTo run in `notify` mode, you will need to set the `approvers` variable to an empty list `[]` and ensure the resource-specific `default_action` variable is set to `notify`, either in your fpvars file\n\n```hcl\n# example.fpvars\napprovers = []\nebs_snapshots_exceeding_max_age_default_action = \"notify\"\n```\n\nor pass the `approvers` and `default_action` arguments on the command-line.\n\n```sh\nflowpipe pipeline run aws_thrifty.pipeline.detect_and_correct_ebs_snapshots_exceeding_max_age --arg='default_action=notify' --arg='approvers=[]'\n```\n\n#### Automatic\n\nThis behavior allows for a hands-off approach to remediating resources.\n\nTo run in `automatic` mode, you will need to set the `approvers` variable to an empty list `[]` and the the resource-specific `default_action` variable to one of the available options.\n\n```hcl\n# example.fpvars\napprovers = []\nebs_snapshots_exceeding_max_age_default_action = \"delete_snapshot\"\n```\n\nor pass the `approvers` and `default_action` argument on the command-line.\n\n```sh\nflowpipe pipeline run aws_thrifty.pipeline.detect_and_correct_ebs_snapshots_exceeding_max_age --arg='approvers=[] --arg='default_action=delete_snapshot'\n```\n\nTo further enhance this approach, you can enable the pipelines corresponding [query trigger](#running-query-triggers) to run completely hands-off.\n\n### Running Query Triggers\n\n\u003e Note: Query triggers require Flowpipe running in [server](https://flowpipe.io/docs/run/server) mode.\n\nEach `detect_and_correct` pipeline comes with a corresponding [Query Trigger](https://flowpipe.io/docs/flowpipe-hcl/trigger/query), these are _disabled_ by default allowing for you to _enable_ and _schedule_ them as desired.\n\nLet's begin by looking at how to set-up a Query Trigger to automatically resolve our EBS snapshots that have exceeded their useful lifespan.\n\nFirsty, we need to update our `example.fpvars` file to add or update the following variables - if we want to run our remediation `hourly` and automatically `apply` the corrections:\n\n```hcl\n# example.fpvars\nebs_snapshots_exceeding_max_age_trigger_enabled  = true\nebs_snapshots_exceeding_max_age_trigger_schedule = \"1h\"\nebs_snapshots_exceeding_max_age_default_action   = \"delete_snapshot\"\n```\n\nNow we'll need to start up our Flowpipe server:\n\n```sh\nflowpipe server --var-file=example.fpvars\n```\n\nThis will activate every hour and detect EBS Snapshots exceeding maximum age and apply the corrections without further interaction!\n\n## Open Source \u0026 Contributing\n\nThis repository is published under the [Apache 2.0 license](https://www.apache.org/licenses/LICENSE-2.0). Please see our [code of conduct](https://github.com/turbot/.github/blob/main/CODE_OF_CONDUCT.md). We look forward to collaborating with you!\n\n[Flowpipe](https://flowpipe.io) and [Steampipe](https://steampipe.io) are products produced from this open source software, exclusively by [Turbot HQ, Inc](https://turbot.com). They are distributed under our commercial terms. Others are allowed to make their own distribution of the software, but cannot use any of the Turbot trademarks, cloud services, etc. You can learn more in our [Open Source FAQ](https://turbot.com/open-source).\n\n## Get Involved\n\n**[Join #flowpipe on Slack →](https://turbot.com/community/join)**\n\nWant to help but don't know where to start? Pick up one of the `help wanted` issues:\n\n- [Flowpipe](https://github.com/turbot/flowpipe/labels/help%20wanted)\n- [AWS Thrifty Mod](https://github.com/turbot/flowpipe-mod-aws-thrifty/labels/help%20wanted)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fturbot%2Fflowpipe-mod-aws-thrifty","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fturbot%2Fflowpipe-mod-aws-thrifty","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fturbot%2Fflowpipe-mod-aws-thrifty/lists"}