https://github.com/thomasvincent/github-to-terraform
https://github.com/thomasvincent/github-to-terraform
shell terraform
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/thomasvincent/github-to-terraform
- Owner: thomasvincent
- License: mit
- Created: 2024-06-06T06:17:01.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-21T00:25:38.000Z (about 2 years ago)
- Last Synced: 2024-06-22T17:34:16.079Z (about 2 years ago)
- Topics: shell, terraform
- Language: Shell
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# Terraform Import Automation Script
## Overview
`terraport.sh` is a shell script designed to automate the process of importing existing GitHub resources into Terraform. This script leverages the GitHub CLI (`gh`) to list repositories and generate the necessary `terraform import` statements for various GitHub resources. It also configures the directory for Terraform Cloud.
## Prerequisites
Before running the script, ensure you have the following:
1. **GitHub CLI**: Installed and authenticated. You can install it from [GitHub CLI](https://cli.github.com/).
2. **Terraform**: Installed. You can download it from [Terraform](https://www.terraform.io/downloads.html).
3. **Environment Variables**: Set the following environment variables:
- `GITHUB_USERNAME`: Your GitHub username.
- `GITHUB_TOKEN`: Your GitHub personal access token.
- `TFE_TOKEN`: Your Terraform Cloud API token.
- `TFE_ORG`: Your Terraform Cloud organization name.