data

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 20, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CancelRun

func CancelRun(c *client.TfxClient, runID string) error

CancelRun cancels a run by ID

func CreateConfigurationVersion

func CreateConfigurationVersion(c *client.TfxClient, orgName, workspaceName, directory string, speculative bool) (*tfe.ConfigurationVersion, error)

CreateConfigurationVersion creates a new configuration version in a workspace and uploads code from a directory

func CreateGPGKey

func CreateGPGKey(c *client.TfxClient, registryName tfe.RegistryName, namespace string, publicKeyPath string) (*tfe.GPGKey, error)

CreateGPGKey creates a new GPG key

func CreateOfficialTerraformVersion

func CreateOfficialTerraformVersion(c *client.TfxClient, version string, enabled bool, beta bool) (*tfe.AdminTerraformVersion, error)

CreateOfficialTerraformVersion creates a Terraform version from the official HashiCorp releases

func CreateRegistryModule

func CreateRegistryModule(c *client.TfxClient, orgName, name, provider string) (*tfe.RegistryModule, error)

CreateRegistryModule creates a new module in the private registry

func CreateRegistryModuleVersion

func CreateRegistryModuleVersion(c *client.TfxClient, orgName, name, provider, version, directory string) (*tfe.RegistryModuleVersion, error)

CreateRegistryModuleVersion creates a new module version and uploads the directory

func CreateRegistryProvider

func CreateRegistryProvider(c *client.TfxClient, orgName, name string) (*tfe.RegistryProvider, error)

CreateRegistryProvider creates a new provider in the private registry

func CreateRegistryProviderPlatform

func CreateRegistryProviderPlatform(c *client.TfxClient, orgName, name, version, os, arch, shasum, filename string) (*tfe.RegistryProviderPlatform, error)

CreateRegistryProviderPlatform creates a provider platform record

func CreateRegistryProviderVersion

func CreateRegistryProviderVersion(c *client.TfxClient, orgName, name, version, keyID string) (*tfe.RegistryProviderVersion, error)

CreateRegistryProviderVersion creates a provider version

func CreateRun

func CreateRun(c *client.TfxClient, orgName, workspaceName, message, configurationVersionID string) (*tfe.Run, error)

CreateRun creates a run for a workspace, optionally using a specific configuration version

func CreateStateVersionFromFile

func CreateStateVersionFromFile(c *client.TfxClient, orgName, workspaceName, filename string) (*tfe.StateVersion, error)

CreateStateVersionFromFile reads a state file and creates a new state version

func CreateTerraformVersion

func CreateTerraformVersion(c *client.TfxClient, version string, url string, sha string, official bool, enabled bool, beta bool) (*tfe.AdminTerraformVersion, error)

CreateTerraformVersion creates a new Terraform version

func CreateVariable

func CreateVariable(c *client.TfxClient, workspaceID string, opts tfe.VariableCreateOptions) (*tfe.Variable, error)

CreateVariable creates a new variable in a workspace

func CreateVariableSet added in v0.2.1

func CreateVariableSet(c *client.TfxClient, orgName string, params VariableSetCreateParams) (*tfe.VariableSet, error)

CreateVariableSet creates a new variable set in the given organization.

func CreateVariableSetVariable added in v0.4.0

func CreateVariableSetVariable(c *client.TfxClient, variableSetID string, opts tfe.VariableSetVariableCreateOptions) (*tfe.VariableSetVariable, error)

CreateVariableSetVariable creates a new variable in a variable set.

func DeleteGPGKey

func DeleteGPGKey(c *client.TfxClient, namespace string, registryName tfe.RegistryName, keyID string) error

DeleteGPGKey deletes a GPG key

func DeleteRegistryModule

func DeleteRegistryModule(c *client.TfxClient, orgName, name, provider string) error

DeleteRegistryModule deletes a module by name and provider

func DeleteRegistryModuleVersion

func DeleteRegistryModuleVersion(c *client.TfxClient, orgName, name, provider, version string) error

DeleteRegistryModuleVersion deletes a module version

func DeleteRegistryProvider

func DeleteRegistryProvider(c *client.TfxClient, orgName, name string) error

DeleteRegistryProvider deletes a provider

func DeleteRegistryProviderPlatform

func DeleteRegistryProviderPlatform(c *client.TfxClient, orgName, name, version, os, arch string) error

DeleteRegistryProviderPlatform deletes a provider platform

func DeleteRegistryProviderVersion

func DeleteRegistryProviderVersion(c *client.TfxClient, orgName, name, version string) error

DeleteRegistryProviderVersion deletes a provider version

func DeleteTerraformVersion

func DeleteTerraformVersion(c *client.TfxClient, version string) error

DeleteTerraformVersion deletes a Terraform version

func DeleteVariable

func DeleteVariable(c *client.TfxClient, workspaceID string, variableID string) error

DeleteVariable deletes a variable from a workspace

func DeleteVariableSet added in v0.2.1

func DeleteVariableSet(c *client.TfxClient, variableSetID string) error

DeleteVariableSet deletes a variable set by ID.

func DeleteVariableSetVariable added in v0.4.0

func DeleteVariableSetVariable(c *client.TfxClient, variableSetID, variableID string) error

DeleteVariableSetVariable deletes a variable from a variable set.

func DiscardRun

func DiscardRun(c *client.TfxClient, runID string) error

DiscardRun discards a run by ID

func DownloadConfigurationVersion

func DownloadConfigurationVersion(c *client.TfxClient, configurationID string) ([]byte, error)

DownloadConfigurationVersion downloads the configuration version slug bytes

func DownloadRegistryModuleVersion

func DownloadRegistryModuleVersion(c *client.TfxClient, orgName, name, provider, version, directory string) (string, error)

DownloadRegistryModuleVersion downloads a module version and unpacks it to directory

func DownloadStateVersion

func DownloadStateVersion(c *client.TfxClient, stateID string) ([]byte, error)

DownloadStateVersion downloads the state version bytes

func DownloadTextFile

func DownloadTextFile(downloadURL string) (string, error)

DownloadTextFile fetches the content at downloadURL and returns it as a string

func FetchConfigurationVersion

func FetchConfigurationVersion(c *client.TfxClient, configurationID string) (*tfe.ConfigurationVersion, error)

FetchConfigurationVersion reads a configuration version with includes

func FetchConfigurationVersions

func FetchConfigurationVersions(c *client.TfxClient, orgName, workspaceName string, maxItems int) ([]*tfe.ConfigurationVersion, error)

FetchConfigurationVersions lists configuration versions for a workspace name with max-items

func FetchGPGKey

func FetchGPGKey(c *client.TfxClient, namespace string, registryName tfe.RegistryName, keyID string) (*tfe.GPGKey, error)

FetchGPGKey fetches a single GPG key by ID

func FetchGPGKeys

func FetchGPGKeys(c *client.TfxClient, namespace string) ([]*tfe.GPGKey, error)

FetchGPGKeys fetches all GPG keys for a given registry namespace Note: Currently only supports private registry

func FetchOrganization

func FetchOrganization(c *client.TfxClient, orgName string, options *tfe.OrganizationReadOptions) (*tfe.Organization, error)

FetchOrganization fetches a single organization by name

func FetchOrganizations

func FetchOrganizations(c *client.TfxClient, searchString string) ([]*tfe.Organization, error)

FetchOrganizations fetches all organizations using pagination with optional search Deprecated: Use FetchOrganizationsWithOptions instead

func FetchOrganizationsWithOptions

func FetchOrganizationsWithOptions(c *client.TfxClient, options *OrganizationListOptions) ([]*tfe.Organization, error)

FetchOrganizationsWithOptions fetches all organizations using pagination with options

func FetchPlan

func FetchPlan(c *client.TfxClient, planID string) (*tfe.Plan, error)

FetchPlan retrieves a plan by ID

func FetchPlanJSONOutput

func FetchPlanJSONOutput(c *client.TfxClient, planID string) ([]byte, error)

FetchPlanJSONOutput retrieves the JSON output for a plan by ID

func FetchPlanLogs

func FetchPlanLogs(c *client.TfxClient, planID string) ([]string, error)

FetchPlanLogs retrieves logs for a plan by ID

func FetchProject

func FetchProject(c *client.TfxClient, projectID string) (*tfe.Project, error)

FetchProject fetches a single project by ID

func FetchProjectByName

func FetchProjectByName(c *client.TfxClient, orgName string, projectName string) (*tfe.Project, error)

FetchProjectByName fetches a single project by name in the specified organization

func FetchProjects

func FetchProjects(c *client.TfxClient, orgName string, searchString string) ([]*tfe.Project, error)

FetchProjects fetches all projects for a given organization using pagination

func FetchProjectsAcrossOrgs

func FetchProjectsAcrossOrgs(c *client.TfxClient, searchString string) ([]*tfe.Project, error)

FetchProjectsAcrossOrgs fetches projects across all organizations Deprecated: Use FetchProjectsWithOrgScope instead

func FetchProjectsWithOrgScope

func FetchProjectsWithOrgScope(c *client.TfxClient, orgName string, options *ProjectListOptions) ([]*tfe.Project, error)

FetchProjectsWithOrgScope fetches projects for either a single organization or across all organizations If allOrgs is true, it will fetch across all organizations. Otherwise it will fetch for the specified orgName.

func FetchRun

func FetchRun(c *client.TfxClient, runID string) (*tfe.Run, error)

FetchRun retrieves a run by ID with optional includes

func FetchRunPolicyDetails added in v0.3.0

func FetchRunPolicyDetails(c *client.TfxClient, runID string, fetchLogs bool) (*view.RunPolicyResult, error)

FetchRunPolicyDetails retrieves all policy check and evaluation details for a run. When fetchLogs is true, raw Sentinel log output is fetched for each policy check.

func FetchRunsForWorkspace

func FetchRunsForWorkspace(c *client.TfxClient, workspaceID string, maxItems int) ([]*tfe.Run, error)

FetchRunsForWorkspace lists runs for a workspace limited by maxItems

func FetchStateVersion

func FetchStateVersion(c *client.TfxClient, stateID string) (*tfe.StateVersion, error)

FetchStateVersion reads a state version with includes

func FetchStateVersions

func FetchStateVersions(c *client.TfxClient, orgName, workspaceName string, maxItems int) ([]*tfe.StateVersion, error)

FetchStateVersions lists state versions for a workspace name with max-items

func FetchTerraformVersion

func FetchTerraformVersion(c *client.TfxClient, version string) (*tfe.AdminTerraformVersion, error)

FetchTerraformVersion fetches a single Terraform version by version string Uses filter which returns exact match

func FetchTerraformVersions

func FetchTerraformVersions(c *client.TfxClient, filter string, search string) ([]*tfe.AdminTerraformVersion, error)

FetchTerraformVersions fetches all Terraform versions with optional filtering

func FetchVariable

func FetchVariable(c *client.TfxClient, workspaceID string, key string) (*tfe.Variable, error)

FetchVariable fetches a single variable by key in the specified workspace

func FetchVariableSetVariable added in v0.4.0

func FetchVariableSetVariable(c *client.TfxClient, variableSetID string, key string) (*tfe.VariableSetVariable, error)

FetchVariableSetVariable fetches a single variable by key in the specified variable set.

func FetchVariableSetVariables added in v0.4.0

func FetchVariableSetVariables(c *client.TfxClient, variableSetID string) ([]*tfe.VariableSetVariable, error)

FetchVariableSetVariables fetches all variables in a variable set using pagination.

func FetchVariables

func FetchVariables(c *client.TfxClient, workspaceID string) ([]*tfe.Variable, error)

FetchVariables fetches all variables for a given workspace using pagination

func FetchWorkspace

func FetchWorkspace(c *client.TfxClient, orgName string, workspaceName string) (*tfe.Workspace, error)

FetchWorkspace fetches a single workspace by name in the specified organization

func FetchWorkspaceMetrics

func FetchWorkspaceMetrics(c *client.TfxClient, orgName string, runSinceTime time.Time) ([]view.MetricsWorkspace, error)

FetchWorkspaceMetrics fetches metrics for all workspaces in an organization since a given time

func FetchWorkspaceRemoteStateConsumers

func FetchWorkspaceRemoteStateConsumers(c *client.TfxClient, workspaceID string) ([]*tfe.Workspace, error)

FetchWorkspaceRemoteStateConsumers fetches all remote state consumers for a workspace

func FetchWorkspaceTeamAccess

func FetchWorkspaceTeamAccess(c *client.TfxClient, workspaceID string, maxItems int) ([]*tfe.TeamAccess, error)

FetchWorkspaceTeamAccess fetches all team access for a workspace

func FetchWorkspaces

func FetchWorkspaces(c *client.TfxClient, orgName string, options *flags.WorkspaceListFlags) ([]*tfe.Workspace, error)

FetchWorkspaces fetches all workspaces for a given organization using pagination

func FetchWorkspacesAcrossOrgs

func FetchWorkspacesAcrossOrgs(c *client.TfxClient, options *flags.WorkspaceListFlags) ([]*tfe.Workspace, error)

FetchWorkspacesAcrossOrgs fetches workspaces across all organizations Deprecated: Use FetchWorkspacesWithOrgScope instead

func FetchWorkspacesWithOrgScope

func FetchWorkspacesWithOrgScope(c *client.TfxClient, orgName string, options *flags.WorkspaceListFlags) ([]*tfe.Workspace, error)

FetchWorkspacesWithOrgScope fetches workspaces for either a single organization or across all organizations If allOrgs is true, it will fetch across all organizations. Otherwise it will fetch for the specified orgName.

func FilterVersionsForDisable added in v0.4.0

func FilterVersionsForDisable(items []*tfe.AdminTerraformVersion, f TerraformVersionDisableFilter) []string

FilterVersionsForDisable returns version strings from items matching the given filter.

func FilterVersionsForEnable added in v0.4.0

func FilterVersionsForEnable(items []*tfe.AdminTerraformVersion, f TerraformVersionEnableFilter) []string

FilterVersionsForEnable returns version strings from items matching the given filter.

func GetLatestRunID

func GetLatestRunID(c *client.TfxClient, workspaceID string) (string, error)

GetLatestRunID returns the most recent run ID for a workspace

func GetTeamAccessNames

func GetTeamAccessNames(c *client.TfxClient, teamAccess []*tfe.TeamAccess) ([]interface{}, error)

GetTeamAccessNames retrieves team names from team access objects

func GetVariableID

func GetVariableID(c *client.TfxClient, workspaceID string, key string) (string, error)

GetVariableID retrieves the variable ID from a workspace by variable key

func GetVariableSetByName added in v0.4.0

func GetVariableSetByName(c *client.TfxClient, orgName string, scope VariableSetScope, name string) (*tfe.VariableSet, error)

GetVariableSetByName finds a variable set by exact name within the given scope.

func GetVariableSetVariableID added in v0.4.0

func GetVariableSetVariableID(c *client.TfxClient, variableSetID string, key string) (string, error)

GetVariableSetVariableID retrieves the variable ID from a variable set by variable key.

func GetWorkspaceID

func GetWorkspaceID(c *client.TfxClient, orgName string, workspaceName string) (string, error)

GetWorkspaceID retrieves the workspace ID from organization and workspace name

func ListRegistryModuleVersions

func ListRegistryModuleVersions(c *client.TfxClient, orgName, name, provider string) (*tfe.RegistryModule, error)

ListRegistryModuleVersions returns the module and its VersionStatuses

func ListRegistryModules

func ListRegistryModules(c *client.TfxClient, orgName string, maxItems int) ([]*tfe.RegistryModule, error)

ListRegistryModules lists modules in the private registry for an organization, up to maxItems

func ListRegistryProviderPlatforms

func ListRegistryProviderPlatforms(c *client.TfxClient, orgName, name, version string) ([]*tfe.RegistryProviderPlatform, error)

ListRegistryProviderPlatforms lists platforms for a provider version

func ListRegistryProviderVersions

func ListRegistryProviderVersions(c *client.TfxClient, orgName, name string) ([]*tfe.RegistryProviderVersion, error)

ListRegistryProviderVersions lists versions for a provider

func ListRegistryProviders

func ListRegistryProviders(c *client.TfxClient, orgName string, maxItems int) ([]*tfe.RegistryProvider, error)

ListRegistryProviders lists providers in the private registry for an organization, up to maxItems

func ListVariableSets added in v0.2.1

func ListVariableSets(c *client.TfxClient, orgName string, search string) ([]*tfe.VariableSet, error)

ListVariableSets lists all variable sets for an organization.

func ListVariableSetsForProject added in v0.4.0

func ListVariableSetsForProject(c *client.TfxClient, orgName, projectName, search string) ([]*tfe.VariableSet, error)

ListVariableSetsForProject lists variable sets applied to a project.

func ListVariableSetsForWorkspace added in v0.4.0

func ListVariableSetsForWorkspace(c *client.TfxClient, orgName, workspaceName, search string) ([]*tfe.VariableSet, error)

ListVariableSetsForWorkspace lists variable sets applied to a workspace.

func ListVariableSetsWithScope added in v0.4.0

func ListVariableSetsWithScope(c *client.TfxClient, defaultOrg string, scope VariableSetScope) ([]*tfe.VariableSet, error)

ListVariableSetsWithScope lists variable sets according to the given scope.

func ReadRegistryModule

func ReadRegistryModule(c *client.TfxClient, orgName, name, provider string) (*tfe.RegistryModule, error)

ReadRegistryModule reads a module by name and provider

func ReadRegistryProvider

func ReadRegistryProvider(c *client.TfxClient, orgName, name string) (*tfe.RegistryProvider, error)

ReadRegistryProvider reads a provider

func ReadRegistryProviderPlatform

func ReadRegistryProviderPlatform(c *client.TfxClient, orgName, name, version, os, arch string) (*tfe.RegistryProviderPlatform, error)

ReadRegistryProviderPlatform reads a provider platform

func ReadRegistryProviderVersion

func ReadRegistryProviderVersion(c *client.TfxClient, orgName, name, version string) (*tfe.RegistryProviderVersion, error)

ReadRegistryProviderVersion reads a provider version

func ReadVariableSet added in v0.2.1

func ReadVariableSet(c *client.TfxClient, variableSetID string) (*tfe.VariableSet, error)

ReadVariableSet reads a single variable set by ID, including its workspaces, projects, and variables.

func ResolveVariableSet added in v0.4.0

func ResolveVariableSet(c *client.TfxClient, defaultOrg string, scope VariableSetScope, name, id string) (*tfe.VariableSet, error)

ResolveVariableSet reads a variable set by ID or resolves it by name within the given scope.

func SetWorkspaceLock

func SetWorkspaceLock(c *client.TfxClient, orgName, workspaceName string, lockSet bool) (string, error)

SetWorkspaceLock locks or unlocks the workspace by name

func UpdateTerraformVersions

func UpdateTerraformVersions(c *client.TfxClient, versions []string, enabled bool) (map[string]string, error)

UpdateTerraformVersions enables or disables multiple Terraform versions

func UpdateVariable

func UpdateVariable(c *client.TfxClient, workspaceID string, variableID string, opts tfe.VariableUpdateOptions) (*tfe.Variable, error)

UpdateVariable updates an existing variable in a workspace

func UpdateVariableSetVariable added in v0.4.0

func UpdateVariableSetVariable(c *client.TfxClient, variableSetID, variableID string, opts tfe.VariableSetVariableUpdateOptions) (*tfe.VariableSetVariable, error)

UpdateVariableSetVariable updates an existing variable in a variable set.

func UploadBinary

func UploadBinary(uploadURL string, path string) error

UploadBinary performs a PUT of the file at path to the given pre-signed URL

func ValidateRunStatus

func ValidateRunStatus(s string) bool

ValidateRunStatus validates if the given run status is valid

Types

type OrganizationListOptions

type OrganizationListOptions struct {
	Search string
}

OrganizationListOptions holds options for listing organizations

type ProjectListOptions

type ProjectListOptions struct {
	Search string
	All    bool
}

ProjectListOptions holds options for listing projects

type StateFile

type StateFile struct {
	Version          int64  `json:"version"`
	TerraformVersion string `json:"terraform_version"`
	Serial           int64  `json:"serial"`
	Lineage          string `json:"lineage"`
}

StateFile mirrors key metadata from state for creation

type TerraformVersionDisableFilter added in v0.4.0

type TerraformVersionDisableFilter struct {
	Except     []string
	Before     string
	NotInUse   bool
	Deprecated bool
	Unofficial bool
	Official   bool
	Beta       bool
}

TerraformVersionDisableFilter selects which versions to disable in a bulk disable operation.

type TerraformVersionEnableFilter added in v0.4.0

type TerraformVersionEnableFilter struct {
	Include    []string
	Except     []string
	Unofficial bool
	Official   bool
	Beta       bool
}

TerraformVersionEnableFilter selects which versions to enable in a bulk enable operation.

type VariableSetCreateParams added in v0.4.0

type VariableSetCreateParams struct {
	Name, Description string
	Global, Priority  bool
	ProjectName       string // non-empty = project-owned (Parent.Project)
	WorkspaceName     string // non-empty = ApplyToWorkspaces after create
}

VariableSetCreateParams holds options for creating a variable set.

type VariableSetScope added in v0.4.0

type VariableSetScope struct {
	All              bool
	OrganizationName string
	ProjectName      string
	WorkspaceName    string
	Search           string
}

VariableSetScope selects which variable sets to list or resolve.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL