Skip to main content

Make Terraform Cloud API calls for common platform administration tasks.

Project description

Overview

Make Terraform Cloud API calls for common platform administration tasks.

Reference

Terraform Cloud API Documentation

Available Functions

  • Show organization details

  • List teams

  • List projects

  • Get project ID from project name

  • List workspaces in a project

  • Get workspace ID from workspace name

  • Move workspace into a project

Examples

import sys
import tfc_admin

# List all teams in an organization.
teams_list = []
page_number = 1

# Iterate through all pages of teams.
while True:
   teams = tfc_admin.get_teams(
      sys.argv[1],  # token
      sys.argv[2],  # organization
      page_number
   )
   if not teams['data']:
      break
   for team in teams['data']:
      teams_list.append(team['attributes']['name'])
   page_number += 1

# Print the list of teams.
print(teams_list)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tfc_admin-1.1.0.tar.gz (2.3 kB view details)

Uploaded Source

Built Distribution

tfc_admin-1.1.0-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

Details for the file tfc_admin-1.1.0.tar.gz.

File metadata

  • Download URL: tfc_admin-1.1.0.tar.gz
  • Upload date:
  • Size: 2.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.10.12 Linux/5.4.109+

File hashes

Hashes for tfc_admin-1.1.0.tar.gz
Algorithm Hash digest
SHA256 31160740c4c241fdc58ff21f92b0ab02bc44e7504c327099be41678c707f0a66
MD5 e910fca233ec6b3b7d98684a1f5ea74a
BLAKE2b-256 1f70c86076f29e98597e54969e57e86a07b62376d75feb858b4a01c92e4e8011

See more details on using hashes here.

File details

Details for the file tfc_admin-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: tfc_admin-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.10.12 Linux/5.4.109+

File hashes

Hashes for tfc_admin-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8708dfa3ec252410ab022906698f2a3fe38cca15ae8df064a7a50a53d8acfa7d
MD5 07052faeb07b6dafea83f20ae9939e1a
BLAKE2b-256 d00d92b6b42a72b89f05caea72a46601ed0efe2276fdeeeb3e02abc97bae28ff

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page