https://github.com/tedivm/tfc_version
Terraform Cloud CLI for Managing Workspace Terraform Versions
https://github.com/tedivm/tfc_version
terraform terraform-cloud tfc tfcloud
Last synced: 2 months ago
JSON representation
Terraform Cloud CLI for Managing Workspace Terraform Versions
- Host: GitHub
- URL: https://github.com/tedivm/tfc_version
- Owner: tedivm
- License: mit
- Created: 2021-12-21T20:35:56.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-12-08T13:14:21.000Z (over 2 years ago)
- Last Synced: 2024-05-01T21:37:44.946Z (about 1 year ago)
- Topics: terraform, terraform-cloud, tfc, tfcloud
- Language: Python
- Homepage: https://blog.tedivm.com/
- Size: 23.4 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Terraform Cloud Version Manager
This tiny script makes it easy to update the Terraform Version on all of the Workspaces inside Terraform Cloud. It will load a list of Workspaces for an Organization and set their versions to either the latest Terraform version or whatever is specified.
## Installation
```bash
git clone [email protected]:tedivm/tfc_version.git
cd tfc_version
poetry install
```## Authentication
This project uses the same credentials file as `terraform` itself. If you haven't already run `terraform login` before using this tool.
You can also set the `TFC_TOKEN` environment variable.
To use a custom install of Terraform Enterprise set the environment variable TFC_DOMAIN to the domain of your instance (just the domain without the `http` portion of the URL or any trailing slashes, ie `app.terraform.io`).
## Usage
If you used Poetry to install replace `tfc_version` with `poetry run tfc_version`.
### List Workspaces
```bash
tfc_version list ORGANIZATION_NAME
```### Upgrade to Latest
```bash
tfc_version set-version ORGANIZATION_NAME
```### Upgrade to Specific Version
```bash
tfc_version set-version ORGANIZATION_NAME 1.1.2
```### List Terraform Versions
```bash
tfc_version list-available-verions
```### Get Lastest Version
```bash
tfc_version get-latest-version
```