https://github.com/miteshsharma/terraformexec
Execute terraform command through go code with Postgres as backend
https://github.com/miteshsharma/terraformexec
exec git go postgres terraform
Last synced: 2 months ago
JSON representation
Execute terraform command through go code with Postgres as backend
- Host: GitHub
- URL: https://github.com/miteshsharma/terraformexec
- Owner: MiteshSharma
- Created: 2021-08-08T11:38:43.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-08-08T13:14:58.000Z (almost 5 years ago)
- Last Synced: 2025-02-16T18:34:25.631Z (over 1 year ago)
- Topics: exec, git, go, postgres, terraform
- Language: Go
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# TerraformExec
This project is used to run terraform files using go code. We have git module which clone repository in a given directory. Using cli exec command, go code execute terraform files cloned using git.
We need a git repository to download tf code and directory where it needs to be downloaded. We are using postgres as terraform backend, so we need to provide a connection staring for this.
Go to main.go, replace repository, directory, any variables to be added and postgres connection string.
Actions performed:
1. Init
2. Plan
3. Apply
4. Output: Returns map of type map[string]interface{} which can be used to fetch output parameters.
5. Destroy
For more details around terraform: https://www.terraform.io/
Requirement:
terraform cli must be downloaded on system and must be executable.