https://github.com/awslabs/tecli
In a world where everything is Terraform, teams use Terraform Cloud API to manage their workloads. TECLI increases teams productivity by facilitating such interaction and by providing easy commands that can be executed on a terminal or on CI/CD systems.
Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (14.5%) to scientific vocabulary
Keywords
Repository
In a world where everything is Terraform, teams use Terraform Cloud API to manage their workloads. TECLI increases teams productivity by facilitating such interaction and by providing easy commands that can be executed on a terminal or on CI/CD systems.
Basic Info
- Host: GitHub
- Owner: awslabs
- License: apache-2.0
- Language: Go
- Default Branch: main
- Homepage: https://github.com/awslabs/tecli
- Size: 1.86 MB
Statistics
- Stars: 213
- Watchers: 11
- Forks: 20
- Open Issues: 5
- Releases: 7
Topics
Metadata Files
README.md
TECLI - Terraform Enterprise/Cloud Command Line Interface
📖 Overview
TECLI is a powerful command-line interface designed to interact with Terraform Cloud API. It enhances team productivity by providing intuitive commands that can be executed in a terminal or integrated into CI/CD pipelines.
In a world where infrastructure as code is becoming the standard, TECLI bridges the gap between your workflows and Terraform Cloud, making it easier to manage workspaces, runs, variables, and more.
🚀 Features
- Workspace Management: Create, read, update, delete, and list Terraform workspaces
- Run Operations: Create, apply, and discard Terraform runs
- Plan & Apply Management: View logs for plan and apply operations
- Variable Management: Create, update, and delete Terraform and environment variables
- VCS Integration: Connect workspaces to version control repositories
- SSH Key Management: Manage SSH keys for private module access
- OAuth Client Management: Configure OAuth clients for VCS providers
📋 Table of Contents
- Installation
- Configuration
- Usage Examples
- Command Reference
- Common Workflows
- Screenshots
- Contributing
- References
- License
📥 Installation
Prerequisites
Before installing TECLI, ensure you have:
- A Terraform Cloud/Enterprise account
- Appropriate API tokens (user, team, or organization)
For more detailed prerequisites, visit our Pre-Requisites Wiki.
Installation Steps
- Download the latest release for your operating system and platform.
- Extract the binary to a location in your PATH.
- Verify the installation:
bash
tecli version
For more detailed installation instructions, visit our Installation Wiki.
⚙️ Configuration
TECLI requires configuration before use. You can configure it in two ways:
Using the Configure Command
bash
tecli configure create
This interactive command will guide you through setting up your profile with: - Organization name - User token - Team token - Organization token
Using Environment Variables
```bash
Linux/macOS
export TFCORGANIZATION=your-organization export TFCUSERTOKEN=your-user-token export TFCTEAMTOKEN=your-team-token export TFCORGANIZATION_TOKEN=your-organization-token
Windows (PowerShell)
$Env:TFCORGANIZATION="your-organization" $Env:TFCUSERTOKEN="your-user-token" $Env:TFCTEAMTOKEN="your-team-token" $Env:TFCORGANIZATION_TOKEN="your-organization-token" ```
🔍 Usage Examples
Basic Command Structure
bash
tecli <resource> <action> [flags]
List All Workspaces
bash
tecli workspace list --organization=your-organization
Find a Workspace by Name
bash
tecli workspace find-by-name --organization=your-organization --name=your-workspace-name
Create a Workspace
bash
tecli workspace create --organization=your-organization --name=your-workspace-name --allow-destroy-plan=true
Create a Workspace with VCS Repository
```bash
First, get the OAuth Token ID
tecli o-auth-token list --organization=your-organization
Then create the workspace with VCS connection
tecli workspace create \ --organization=your-organization \ --name=your-workspace-name \ --vcs-repo-oauth-token-id=your-oauth-token-id \ --vcs-repo-identifier=org/repo ```
Create and Apply a Run
```bash
Create a configuration version
tecli configuration-version create --workspace-id=your-workspace-id
Upload configuration files
tecli configuration-version upload --url=your-upload-url --path=./
Create a run
tecli run create --workspace-id=your-workspace-id --comment="Your comment"
Check run status
tecli run read --id=your-run-id
Apply the run
tecli run apply --id=your-run-id --comment="Apply comment" ```
Manage Variables
```bash
Create a sensitive Terraform variable
tecli variable create \ --key=your-variable-key \ --value=your-variable-value \ --workspace-id=your-workspace-id \ --category=terraform \ --sensitive=true
Create AWS environment variables
tecli variable create --key=AWSACCESSKEYID --value=your-access-key --workspace-id=your-workspace-id --category=env --sensitive=true tecli variable create --key=AWSSECRETACCESSKEY --value=your-secret-key --workspace-id=your-workspace-id --category=env --sensitive=true tecli variable create --key=AWSDEFAULTREGION --value=your-region --workspace-id=your-workspace-id --category=env --sensitive=true ```
📚 Command Reference
TECLI provides the following main commands:
Available Commands:
apply An apply represents the results of applying a Terraform Run's execution plan.
configuration-version A configuration version is a resource used to reference the uploaded configuration files.
configure Configures tecli settings
help Help about any command
o-auth-client An OAuth Client represents the connection between an organization and a VCS provider.
o-auth-token The oauth-token object represents a VCS configuration which includes the OAuth connection and the associated OAuth token.
plan A plan represents the execution plan of a Run in a Terraform workspace.
run A run performs a plan and apply, using a configuration version and the workspace's current variables.
ssh-key The ssh-key object represents an SSH key which includes a name and the SSH private key.
variable Operations on variables.
version Displays the version of tecli and all installed plugins
workspace Workspaces represent running infrastructure managed by Terraform.
For detailed information about a specific command:
bash
tecli [command] --help
🔄 Common Workflows
Complete Terraform Run Workflow
```bash
Create a workspace
tecli workspace create --organization=your-org --name=your-workspace
Create a configuration version
tecli configuration-version create --workspace-id=your-workspace-id
Upload configuration files
tecli configuration-version upload --url=your-upload-url --path=./
Create a run
tecli run create --workspace-id=your-workspace-id --comment="Initial run"
Monitor run status
tecli run read --id=your-run-id
View plan logs
tecli plan logs --id=your-plan-id
Apply the run
tecli run apply --id=your-run-id --comment="Applying changes"
View apply logs
tecli apply logs --id=your-apply-id ```
Monitoring and Waiting for Run Completion
```bash
Bash script to wait for run completion
while true; do STATUS=$(tecli run read --id=your-run-id | jq -r ".Status") if [ "${STATUS}" != "pending" ]; then break else echo "RUN STATUS:${STATUS}, IF 'pending' TRY DISCARD PREVIOUS PLANS. SLEEP 5 seconds" && sleep 5 fi done ```
📸 Screenshots
Click to expand screenshots
|  | | :-----------------------------------------------------: | | _How to configure_ | |  | | :---------------------------------------------------------------------: | | _How to create a workspace_ | |  | | :---------------------------------------------------------------------------------------------------: | | _How to create a workspace linked to a repository_ | |  | | :---------------------------------------------------------: | | _How to create a run_ | |  | | :----------------------------------------------------------: | | _How to read plan logs_ | |  | | :------------------------------------------------------------: | | _How to read apply logs_ | |  | | :---------------------------------------------------------------------: | | _How to delete a workspace_ |👥 Contributing
We welcome contributions to TECLI! Please read our Contributing Guidelines for details on how to submit pull requests, report issues, and suggest improvements.
Contributors
| Name | Email | Role | | :--: | :---: | :--: | | Silva, Valter | valterh@amazon.com | AWS Professional Services - Cloud Architect | | Dhingra, Prashit | | AWS Professional Services - Cloud Architect |
🔗 References
- Terraform Cloud - Terraform Cloud is an application that helps teams use Terraform together.
- Terraform Cloud/Enterprise Go Client - The official Go API client for Terraform Cloud/Enterprise.
- clencli - Cloud Engineer CLI
- terminalizer - Record your terminal and generate animated gif images or share a web player link terminalizer.com
📄 License
This project is licensed under the Apache License 2.0. For more information, please read LICENSE.
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
Photo by Gabriel Menchaca on Unsplash
Owner
- Name: Amazon Web Services - Labs
- Login: awslabs
- Kind: organization
- Location: Seattle, WA
- Website: http://amazon.com/aws/
- Repositories: 914
- Profile: https://github.com/awslabs
AWS Labs
GitHub Events
Total
- Release event: 2
- Watch event: 2
- Push event: 1
- Pull request event: 3
- Fork event: 2
- Create event: 2
Last Year
- Release event: 2
- Watch event: 2
- Push event: 1
- Pull request event: 3
- Fork event: 2
- Create event: 2
Committers
Last synced: 12 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Valter Silva | v****h@a****m | 192 |
| Jordan Liggitt | l****t@g****m | 1 |
| Prashit Dhingra | a****h@a****m | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 12 months ago
All Time
- Total issues: 6
- Total pull requests: 13
- Average time to close issues: 2 months
- Average time to close pull requests: 2 months
- Total issue authors: 6
- Total pull request authors: 3
- Average comments per issue: 1.17
- Average comments per pull request: 0.23
- Merged pull requests: 9
- Bot issues: 0
- Bot pull requests: 4
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- darkn3rd (1)
- simonavril (1)
- Rosalind-Fletcher (1)
- uturunku1 (1)
- robinbowes (1)
- mavogel (1)
Pull Request Authors
- valter-silva-au (8)
- dependabot[bot] (7)
- liggitt (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
- Total downloads: unknown
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 3
proxy.golang.org: github.com/awslabs/tecli
Copyright © 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
- Homepage: https://github.com/awslabs/tecli
- Documentation: https://pkg.go.dev/github.com/awslabs/tecli#section-documentation
- License: Apache-2.0
-
Latest release: v0.0.0-20230307015806-59f78f7c9a2c
published almost 3 years ago
Rankings
Dependencies
- github.com/hashicorp/go-retryablehttp v0.6.8
- github.com/hashicorp/go-slug v0.6.0
- github.com/hashicorp/go-tfe v0.15.0
- github.com/magiconair/properties v1.8.1
- github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e
- github.com/sirupsen/logrus v1.2.0
- github.com/spf13/afero v1.3.4
- github.com/spf13/cobra v1.0.0
- github.com/spf13/pflag v1.0.5
- github.com/spf13/viper v1.4.0
- github.com/stretchr/testify v1.6.1
- golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de
- golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1
- golang.org/x/time v0.0.0-20201208040808-7e3f01d25324
- gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f
- gopkg.in/yaml.v2 v2.2.8
- gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776
- 159 dependencies
- actions/checkout v2 composite
- actions/setup-go v2 composite
- actions/checkout v2 composite
- actions/create-release v1 composite
- actions/setup-go v2 composite
- actions/upload-release-asset v1 composite
- actions/checkout v2 composite
- actions/create-release v1 composite
- actions/setup-go v2 composite
- actions/upload-release-asset v1 composite
- ansible * development
- pre-commit * development