{"id":42214302,"url":"https://github.com/cloudputation/iterator","last_synced_at":"2026-01-27T01:09:23.043Z","repository":{"id":215717502,"uuid":"735392000","full_name":"cloudputation/iterator","owner":"cloudputation","description":"Automate infrastructure management with observability","archived":false,"fork":false,"pushed_at":"2024-02-19T21:02:15.000Z","size":239,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2024-06-21T06:28:45.312Z","etag":null,"topics":["automation","devops","golang","infrastructure-as-code","sre"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cloudputation.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}},"created_at":"2023-12-24T18:47:35.000Z","updated_at":"2024-01-26T18:53:51.000Z","dependencies_parsed_at":"2024-02-19T22:23:58.519Z","dependency_job_id":"146f4ca8-dcfb-4723-ac68-8967ba41f3ed","html_url":"https://github.com/cloudputation/iterator","commit_stats":null,"previous_names":["cloudputation/iterator"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/cloudputation/iterator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudputation%2Fiterator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudputation%2Fiterator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudputation%2Fiterator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudputation%2Fiterator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloudputation","download_url":"https://codeload.github.com/cloudputation/iterator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudputation%2Fiterator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28794787,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T01:07:07.743Z","status":"ssl_error","status_checked_at":"2026-01-27T01:07:06.974Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["automation","devops","golang","infrastructure-as-code","sre"],"created_at":"2026-01-27T01:09:22.159Z","updated_at":"2026-01-27T01:09:23.031Z","avatar_url":"https://github.com/cloudputation.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Iterator (Alertmanager-Terraform-Sync)\n\n## Description\nIterator is an event listener that automates infrastructure management by bridging monitoring (Alertmanager) and infrastructure as code (Terraform) into one tool. Allowing teams to plan ahead and design responses based on observability, from infrastructure logs to application usage analytics, to virtually any definable alert. A simple trigger/action engine that enables highly iterable lifecycles by reducing the manual involvement in the planning phase as well as infrastructure operability.\n\n## High level workflow\n![High level workflow](.release/docs/assets/iterator-alert-terraform-workflow.jpg)\nIterator allows to turn metrics and events into actionable data and to take action on that data.\n\n## Uses cases\n### Event driven development to step up from automation to autonomy\nLeverage modern and robust monitoring tools that can send alerts to Alertmanager to design infrastructure reactivity to predicted events to ensure continuous operability within your organization.\n### High velocity disaster recovery and security action\nAutomate immediate actions on incidents whether they are small or disastrous and revoke or destroy resources upon suspicious activity.\n### Design an infrastructure that evolves with your company\nAlign capacity planning and different architectures that are relevant to your organization's context like a minimalistic cloud deployment when in early stages to a full blown infrastructure in later phases.\n### Design an infrastructure that evolves with your product\nOrchestrate your infrastructure based on your application's usage data by using Iterator as part of your backend logic, making it natural to extend it to other infrastructure technologies and service providers.\n### Start building towards Highly Iterable lifecycles\nIntegrate deeply your infrastructure lifecycle with your application's roadmap by codifying business decisions like the expansion of your application. Use Iterator to deploy your infrastructure to a new region to follow your users geographically by sensing your application's popularity across the globe.\n\n## OS support\nIterator is only available for Linux.\n\n## Usage\n### Installation\n```bash\nwget https://github.com/cloudputation/iterator/releases/download/${VERSION}/iterator -O ./iterator\nchmod +x ./iterator\nmv ./iterator /usr/local/bin/\n```\n### Run service with an alternative config file location\n```bash\niterator -f config file\n```\n### Run as a docker container\n```bash\nsudo docker run -d \\\n  -v ${HOME_ITERATOR_DATA}:${DOCKER_ITERATOR_DATA} \\\n  # If Terrafom modules are not in the data directory\n  -v ${HOME_ITERATOR_TERRAFORM_MODULES}:${DOCKER_ITERATOR_TERRAFORM_MODULES} \\\n  --name iterator cloudputation/iterator:latest\n```\n\n## Configuration\nBy default, Iterator looks for `/etc/iterator/config.hcl`\n\nHere is an example server config file\n```hcl\nserver {\n  data_dir  = \"/var/lib/iterator\"\n  log_dir   = \"/var/log/iterator\"\n  log_level = \"info\"\n  // Default port is 9595\n  listen    = \"9595\"\n  terraform_driver  = \"terraform\"\n  consul {\n    address = \"localhost:8500\"\n  }\n}\n\ntask {\n  name        = \"Task1\"\n  description = \"Manage infrastructure for web service\"\n  source      = \"/var/lib/iterator/terraform-data/moduleA\"\n  condition \"label-match\" {\n    // Set to false to prevent non-zero exit codes from this command, from notifying alertmanager that the command failed.\n    // Notifying alertmanager (HTTP 500) is likely to re-dispatch the alarm back to am-executor.\n    notify_on_failure = false\n    // Send a SIGUSR1 signal to the process if it's still running when the triggering alert resolves.\n    // Default signal when not specified is SIGKILL.\n    resolved_signal   = \"SIGUSR1\"\n    // Don't signal command if a matching 'resolved' message is\n    // sent from alertmanager while this command is still running.\n    ignore_resolved   = true\n    // User defined labels that match an alert\n    label {\n      alertname = \"my_cool_alert\"\n      severity  = \"warning\"\n    }\n  }\n}\n\ntask {\n  name        = \"Task2\"\n  description = \"Manage infrastructure for database service\"\n  source      = \"/var/lib/iterator/terraform-data/moduleB\"\n  condition \"label-match\" {\n    notify_on_failure = false\n    resolved_signal   = \"SIGUSR1\"\n    ignore_resolved   = true\n    label {\n      alertname = \"the_other_cool_alert\"\n      severity  = \"boiling_hot\"\n    }\n  }\n}\n```\n\n## Sawtooth Scheduling Mode\nIterator allows for a forward-only Terraform deployment mode which prevent it to destroy the resource when the corresponding alert is resolved. To destroy the resource, use the `release` subcommand.\n```bash\niterator release [alert name]\n```\nNote that the server address has to be configured in the config.hcl file.\n\n### Tip\nUser the `local-exec` or `remote-exec` provisioners to automated a release based on a second alert task configuration.\n```hcl\nprovisioner \"local-exec\" {\n  command = \"iterator release ${var.alert_name}\"\n}\n```\n\n## Consul Backend\nIterator can use Consul as storage backend.\n\n### Consul-Terraform-Sync integration\nWhen enabled, Iterator can serve as a bridge for CTS. Simply replace \u003calertname\u003e for the actual alert name. CTS can now also operate on alerts. Note that Iterator will still run the Terraform resource at the configured source. You need to make sure that the Terraform resource deploymed will not interfere with the resource deployed by CTS.\n```hcl\ntask {\n  name        = \"consul_kv_condition_task\"\n  description = \"execute on changes to Consul KV entry\"\n  module      = \"path/to/consul-kv-module\"\n  providers   = [\"my-provider\"]\n\n  condition \"consul-kv\" {\n    path                = \"iterator::Data/process/alerts/\u003calertname\u003e\"\n    recurse             = false\n    datacenter          = \"dc1\"\n    namespace           = \"default\"\n    use_as_module_input = true\n  }\n}\n```\nPlease review [CTS documentation](https://developer.hashicorp.com/consul/docs/nia/tasks#consul-kv-condition) to learn more about configuring tasks based on Consul's KV store.\n\n## Application Metrics\nBasic prometheus format metrics can be collected at http://iterator_address:9595/metrics\n\n`am_executor_errors_total`\u003cbr\u003e\n`am_executor_errors_total`\u003cbr\u003e\n`am_executor_errors_total`\u003cbr\u003e\n`am_executor_process_duration_seconds`\u003cbr\u003e\n`am_executor_process_duration_seconds`\u003cbr\u003e\n`am_executor_process_duration_seconds`\u003cbr\u003e\n`am_executor_process_duration_seconds`\u003cbr\u003e\n`am_executor_process_duration_seconds`\u003cbr\u003e\n`am_executor_process_duration_seconds`\u003cbr\u003e\n`am_executor_process_duration_seconds`\u003cbr\u003e\n`am_executor_process_duration_seconds_sum`\u003cbr\u003e\n`am_executor_process_duration_seconds_count`\u003cbr\u003e\n`am_executor_processes_current`\u003cbr\u003e\n`am_executor_signaled_total`\u003cbr\u003e\n`am_executor_signaled_total`\u003cbr\u003e\n`am_executor_signaled_total`\u003cbr\u003e\n`am_executor_skipped_total`\u003cbr\u003e\n`am_executor_skipped_total`\u003cbr\u003e\n`promhttp_metric_handler_errors_total`\u003cbr\u003e\n`promhttp_metric_handler_errors_total`\u003cbr\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudputation%2Fiterator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloudputation%2Fiterator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudputation%2Fiterator/lists"}