Git Product home page Git Product logo

tfe-cli's Introduction

tfe-cli

CLI client for Terraform Enterprise.

Installation

For Linux/OSX, run the following command from a terminal to get the latest version:

bash <(curl -sSfL https://raw.githubusercontent.com/rgreinho/tfe-cli/master/extras/tfe-cli-installer.sh)

For Windows, download the binary from the release page.

Environment variables

  • TFE_TOKEN: Terraform Enterprise API token
  • TFE_ORG: Terraform Enterprise organization
  • TFE_LOG_LEVEL: Logging level (valid values are debug, info, warn, error, fatal, panic)
  • TFE_ADDRESS: Terraform Enterprise API address
  • TFE_BASEPATH: Base path on which the Terraform Enterprise API is served.

Some of these values can also be specified on the command line. In this case, the environment variables are ignored.

Management commands

By default, tfe-cli does not display anything if a command succeeds (unless a result is expected, like listing the workspaces for instance). The verbosity can be adjusted by setting the log level accordingly.

Workspaces

Manage workspaces for an organization.

Create

Create a new TFE workspace.

The format of the VCS option is string of colon sperated values: <OAuthTokenID>:<repository>:<branch>.

Examples

Create a new workspace with default values:

tfe-cli workspace create my-new-workspace

Setup the VCS Repository:

tfe-cli workspace create my-new-workspace --vcsrepository ot-8Xc1NTYpjIQZIwIh:organization/repository:master

Delete

Delete an exisiting workspace.

Example
tfe-cli workspace delete my-new-workspace

List

List existing workspaces in the organization.

Example
tfe-cli workspace list

Variables

Manage variables for a workspace.

Create

Examples

Create a new variable into a specific workspace:

tfe-cli variable create exisiting-workspace --var akey=a_value

Update an existing variable in a specific workspace:

tfe-cli variable create my-exisiting-workspace -f --var akey=another_value

When creating/updating variables, several of them of can be specified at the same time:

tfe-cli variable create my-exisiting-workspace \
  --var akey=a_value \
  --svar bkey=b_secure_value \
  --hvar hclkey=hcl_value \
  --var-file stage.tfvars \

Delete

Example

Delete a variable:

tfe-cli variable delete my-workspace backend_port

List

List exisitng variables for a specific workspace.

Example

List variables:

tfe-cli variable list my-workspace

Notifications

List

List TFE notifications for a specific workspace.

Example
tfe-cli notification list my-workspace

Create

Creates or update a notification.

Example

Create a Slack notification for the created and errored events:

tfe-cli notification create my-workspace \
  my-notification \
  --type slack \
  --url https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX \
  --triggers run:created \
  --triggers run:errored

Delete

Deletes a notification by its name, in a specific workspace.

Example
tfe-cli notification delete my-workspace my-notification

tfe-cli's People

Contributors

dependabot[bot] avatar rgreinho avatar ss-remygreinhofer avatar cbowman0 avatar jeremygaither avatar k2patel avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.