All Projects → awslabs → Tecli

awslabs / Tecli

Licence: apache-2.0
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.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Tecli

Terrahub
Terraform Automation and Orchestration Tool (Open Source)
Stars: ✭ 148 (-6.33%)
Mutual labels:  terraform, devops, continuous-integration, continuous-delivery
Piplin
📤 An open source self-hosted continuous integration and deployment system - QQ群: 656868
Stars: ✭ 1,044 (+560.76%)
Mutual labels:  devops, continuous-integration, continuous-delivery
Agola
Agola: CI/CD Redefined
Stars: ✭ 783 (+395.57%)
Mutual labels:  devops, continuous-integration, continuous-delivery
Syncd
syncd是一款开源的代码部署工具,它具有简单、高效、易用等特点,可以提高团队的工作效率.
Stars: ✭ 2,065 (+1206.96%)
Mutual labels:  devops, continuous-integration, continuous-delivery
Terraform Aws Eks
Deploy a full EKS cluster with Terraform
Stars: ✭ 125 (-20.89%)
Mutual labels:  amazon-web-services, terraform, devops
Devops Readme.md
What to Read to Learn More About DevOps
Stars: ✭ 398 (+151.9%)
Mutual labels:  devops, continuous-integration, continuous-delivery
Variable Injector
Continuous Integration Tool for Swift Projects
Stars: ✭ 63 (-60.13%)
Mutual labels:  devops, continuous-integration, continuous-delivery
Cds
Enterprise-Grade Continuous Delivery & DevOps Automation Open Source Platform
Stars: ✭ 3,677 (+2227.22%)
Mutual labels:  devops, continuous-integration, continuous-delivery
Dyn365 Ce Vsts Tasks
VSTS Extension for Dynamics 365 Customer Engagement
Stars: ✭ 94 (-40.51%)
Mutual labels:  devops, continuous-integration, continuous-delivery
Orkestra
Functional DevOps with Scala and Kubernetes
Stars: ✭ 102 (-35.44%)
Mutual labels:  devops, continuous-integration, continuous-delivery
Flint
Fast and configurable filesystem (file and directory names) linter
Stars: ✭ 115 (-27.22%)
Mutual labels:  devops, continuous-integration, continuous-delivery
Jx
Jenkins X provides automated CI+CD for Kubernetes with Preview Environments on Pull Requests using Cloud Native pipelines from Tekton
Stars: ✭ 4,041 (+2457.59%)
Mutual labels:  devops, continuous-integration, continuous-delivery
Hygieia
CapitalOne DevOps Dashboard
Stars: ✭ 3,682 (+2230.38%)
Mutual labels:  devops, continuous-integration, continuous-delivery
Gaia
Build powerful pipelines in any programming language.
Stars: ✭ 4,534 (+2769.62%)
Mutual labels:  devops, continuous-integration, continuous-delivery
Jenkins
Jenkins automation server
Stars: ✭ 18,225 (+11434.81%)
Mutual labels:  devops, continuous-integration, continuous-delivery
Origin
Conformance test suite for OpenShift
Stars: ✭ 8,046 (+4992.41%)
Mutual labels:  devops, continuous-integration, continuous-delivery
Rocket
Automated software delivery as fast and easy as possible 🚀
Stars: ✭ 217 (+37.34%)
Mutual labels:  devops, continuous-integration, continuous-delivery
Circleci Cli
Use CircleCI from the command line
Stars: ✭ 297 (+87.97%)
Mutual labels:  devops, continuous-integration, continuous-delivery
Dyn365 Ce Devops
DevOps for Dynamics 365 Customer Engagement (CE) is becoming a popular topic. The goal of this project is to help Dynamics 365 CE solution builders understand and accelerate their implementation of DevOps practices with Dynamics CE and VSTS.
Stars: ✭ 82 (-48.1%)
Mutual labels:  devops, continuous-integration, continuous-delivery
Lastbackend
System for containerized apps management. From build to scaling.
Stars: ✭ 1,536 (+872.15%)
Mutual labels:  devops, continuous-integration, continuous-delivery

Photo by Gabriel Menchaca on Unsplash

Photo by Gabriel Menchaca on Unsplash

GitHub issuesGitHub forksGitHub starsGitHub licenseTwitter

Command Line Interface for Terraform Enterprise/Cloud ( 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.

Table of Contents


Screenshots


Expand
how-to-configure
How to configure
how-to-create-a-workspace
How to create a workspace
how-to-create-a-workspace-linked-to-a-repository
How to create a workspace linked to a repository
how-to-create-a-run
How to create a run
how-to-read-plan-logs
How to read plan logs
how-to-read-apply-logs
How to read apply logs
how-to-delete-a-workspace
How to delete a workspace

Usage


Expand

tecli --help

Prerequisites


Expand

Installing


Expand

Look for the latest release published and download the binary according to your OS and platform. For more information, check the Installation Wiki page.

Commands

Command Line Interface for Terraform Enterprise/Cloud

Usage:
   [command]

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. This object is used when creating a workspace to identify which VCS connection to use.
  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. An organization can have multiple SSH keys available.
  variable              Operations on variables.
  version               Displays the version of tecli and all installed plugins
  workspace             Workspaces represent running infrastructure managed by Terraform.

Flags:
  -c, --config string          Override the default directory location of the application. Example --config=tecli to locate under the current working directory.
  -h, --help                   help for this command
  -l, --log string             Enable or disable logs (found at $HOME/.tecli/logs.json). Log outputs will be shown on default output. (default "disable")
      --log-file-path string   Log file path. (default "/Users/valterh/.tecli/logs.json")
  -o, --organization string    Terraform Cloud Organization name
  -p, --profile string         Use a specific profile from your credentials and configurations file. (default "default")
  -v, --verbosity string       Valid log level:panic,fatal,error,warn,info,debug,trace). (default "error")

Use " [command] --help" for more information about a command.

Top Commands

All the following commands require TEAM API TOKEN. You can run tecli configure create to configure TECLI options. Alternatively, you can export environment varibles.

To export environment variables:

# on Linux:
export TFC_TEAM_TOKEN=XXX

# on Windows (powershell):
$Env:TFC_TEAM_TOKEN="XXX"

To list all workspaces part of an organization:

tecli workspace list -o=${TFC_ORGANIZATION} -p=${PROFILE}

To find a workspace by name (instead of listing all workspaces and look for its ID):

tecli workspace find-by-name --organization=${TFC_ORGANIZATION} --name=${TFC_WORKSPACE_NAME}

To create a workspace and allow destroy plans:

tecli workspace create --organization=${TFC_ORGANIZATION} --name=${TFC_WORKSPACE_NAME} --allow-destroy-plan=true

To create a plan (if you want to upload your code to Terraform Cloud):

tecli configuration-version create --workspace-id=${WORKSPACE_ID}
tecli configuration-version upload --url=${CV_UPLOAD_URL} --path=./
tecli run create --workspace-id=${WORKSPACE_ID} --comment="${COMMENT}" 

To check the staus of a run:

tecli run read --id=${RUN_ID}

You combine some BASH scripting and check if your plan has finished:

while true; do STATUS=$(tecli run read --id=${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

To display the logs of a plan:

tecli plan logs --id=${PLAN_ID}

To leave a comment on a plan:

tecli run create --workspace-id=${WORKSPACE_ID} --comment="${COMMENT}" --is-destroy=true

To discard a run:

tecli run discard --id=${RUN_ID}

To discard all runs:

tecli run discard-all --workspace-id=${WORKSPACE_ID}

To apply a plan:

tecli run apply --id=${RUN_ID} --comment="${COMMENT}"

To display the apply logs:

tecli apply logs --id=${APPLY_ID}

To create a sensitive terraform variable:

tecli variable update --key=${VARIABLE_KEY} --value=${VARIABLE_VALUE} --workspace-id=${WORKSPACE_ID} --category=terraform --sensitive=true

To create a sensitive environment variable:

tecli variable create --key=${VARIABLE_KEY} --value=${VARIABLE_VALUE} --workspace-id=${WORKSPACE_ID} --category=env --sensitive=true

# AWS CLI ENVIRONMENT VARIABLES
tecli variable create --key=AWS_ACCESS_KEY_ID --value=${AWS_ACCESS_KEY_ID} --workspace-id=${WORKSPACE_ID} --category=env --sensitive=true
tecli variable create --key=AWS_SECRET_ACCESS_KEY --value=${AWS_SECRET_ACCESS_KEY} --workspace-id=${WORKSPACE_ID} --category=env --sensitive=true
tecli variable create --key=AWS_DEFAULT_REGION --value=${AWS_DEFAULT_REGION} --workspace-id=${WORKSPACE_ID} --category=env --sensitive=true

## IF YOU ALSO NEED TO EXPORT AWS_SESSION_TOKEN:
tecli variable create --key=AWS_SESSION_TOKEN --value=${AWS_SESSION_TOKEN} --workspace-id=${WORKSPACE_ID} --category=env --sensitive=true

To delete all variables (be careful):

tecli variable delete-all --workspace-id=${WORKSPACE_ID}

Contributors


Expand
Name Email Role
Silva, Valter [email protected] AWS Professional Services - Cloud Architect
Dhingra, Prashit AWS Professional Services - Cloud Architect

References


Expand

License


This project is licensed under the Apache License 2.0.

For more information please read LICENSE.

Copyright


Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].