{"id":18300016,"url":"https://github.com/chorusone/saltstack-module-tfstate","last_synced_at":"2026-05-08T17:40:28.681Z","repository":{"id":103107569,"uuid":"139229776","full_name":"ChorusOne/saltstack-module-tfstate","owner":"ChorusOne","description":"Saltstack module to use contents of Terraform's tfstate file to use in pillar","archived":false,"fork":false,"pushed_at":"2018-10-12T13:48:23.000Z","size":15,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":24,"default_branch":"master","last_synced_at":"2025-04-09T09:32:12.781Z","etag":null,"topics":["module","saltstack","terraform"],"latest_commit_sha":null,"homepage":null,"language":"Python","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/ChorusOne.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2018-06-30T07:44:29.000Z","updated_at":"2018-10-12T13:48:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"44844286-14a7-4d08-b93b-89711ad10014","html_url":"https://github.com/ChorusOne/saltstack-module-tfstate","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ChorusOne/saltstack-module-tfstate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChorusOne%2Fsaltstack-module-tfstate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChorusOne%2Fsaltstack-module-tfstate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChorusOne%2Fsaltstack-module-tfstate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChorusOne%2Fsaltstack-module-tfstate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ChorusOne","download_url":"https://codeload.github.com/ChorusOne/saltstack-module-tfstate/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChorusOne%2Fsaltstack-module-tfstate/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32791190,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"ssl_error","status_checked_at":"2026-05-08T08:22:45.650Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["module","saltstack","terraform"],"created_at":"2024-11-05T15:11:08.197Z","updated_at":"2026-05-08T17:40:28.659Z","avatar_url":"https://github.com/ChorusOne.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# saltstack-module-tfstate\nSaltstack module to access attributes of dynamically created assets directly from Terraform's tfstate file for use in pillar.\n\n## Installation \n\n1. To use this module, you must ensure that it is available from your master's fileserver root; the easiest way to acheive this is to utilize `gitfs` by adding the following to your /etc/salt/master file:\n```\nfileserver_backends:\n  - root\n  - gitfs\n  \ngitfs_remotes:\n  - https://github.com/ChorusOne/saltstack-module-tfstate.git\n```\n\n2. and in the same file, for s3 backend:\n\n```\nmytfstate:  ##\n  driver: terraform\n  backend: s3\n  bucket: my-bucket-name\n  key: my-tfstate-file.tfstate\n```\n\n   or, for file-based:\n```\nmytfstate:\n  driver: terraform\n  backend: file\n  tfstatefile: /opt/terraform/tfstate.tfstate\n```\n\n3. Restart `salt-master`\n4. Run `sudo salt-run fileserver.update`\n5. Run `sudo salt-run saltutil.sync_all`, and look for `sdb.terraform` in the output.\n\nYou are ready to use the `sdb://\u003cprofile\u003e/\u003cresource_type\u003e.\u003cresource_name\u003e/\u003cattribute\u003e` syntax in your pillar:\n```\n  ...\n  ip: sdb://mytfstate/aws_instance.host/public_ip # for resources created in the environment root\n  ...\n  ip: sdb://mytfstate/module.my_module.aws_instance.host/private_ip # for resources created by a module\n  ...\n  {% if salt['sdb.get']('sdb://mytfstate/aws_instance.host/public_ip') == '10.0.0.1' %}\n  ...\n  {% endif %}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchorusone%2Fsaltstack-module-tfstate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchorusone%2Fsaltstack-module-tfstate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchorusone%2Fsaltstack-module-tfstate/lists"}