Variable Sets

class terrasnek.var_sets.TFCVarSets(instance_url, org_name, headers, well_known_paths, verify, log_level)

Variable Sets API Docs

add_var_to_varset(varset_id, payload)

POST varsets/:varset_external_id/relationships/vars

Variable Sets Add Variable API Doc Reference

Add Variable To Variable Set Sample Payload

apply_varset_to_project(varset_id, payload)

POST varsets/:varset_id/relationships/projects

Variable Sets Apply To Project API Doc Reference

Apply Variable Set to Project Sample Payload

apply_varset_to_workspace(varset_id, payload)

POST varsets/:varset_id/relationships/workspaces

Variable Sets Apply To Workspace API Doc Reference

Apply Variable Set to Workspace Sample Payload

create(payload)

POST organizations/:organization_name/varsets

Variable Sets Create API Doc Reference

Create Sample Payload

delete_var_from_varset(varset_id, var_id)

DELETE varsets/:varset_id/relationships/vars/:var_id

Variable Sets Delete Variable API Doc Reference

destroy(varset_id)

DELETE varsets/:varset_id

Variable Sets Destroy API Doc Reference

list_all_for_org()

This function does not correlate to an endpoint in the TFC API Docs specifically, but rather is a helper function to wrap the list endpoint, which enumerates out every page so users do not have to implement the paging logic every time they just want to list every workspace in an organization.

Returns an object with two arrays of objects.

list_all_for_workspace(workspace_id)

GET workspaces/:workspace_id/varsets

Variable Sets List For Workspace API Doc Reference

list_for_org()

GET organizations/:organization_name/varsets

Variable Sets List For Organization API Doc Reference

list_for_workspace(workspace_id)

GET workspaces/:workspace_id/varsets

Variable Sets List For Workspace API Doc Reference

list_vars_in_varset(varset_id)

GET varsets/:varset_id/relationships/vars

Variable Sets List In Variable Set API Doc Reference

remove_varset_from_project(varset_id, payload)

DELETE varsets/:varset_id/relationships/projects

Variable Sets Remove From Project API Doc Reference

Remove Variable Set From Project Sample Payload

remove_varset_from_workspace(varset_id, payload)

DELETE varsets/:varset_id/relationships/workspaces

Variable Sets Remove From Workspace API Doc Reference

Remove Variable Set From Workspace Sample Payload

required_entitlements()

Terraform Cloud Entitlements required for endpoint to work.

show(varset_id)

GET varsets/:varset_id

Variable Sets Show API Doc Reference

terraform_cloud_only()

Return True if this endpoint is only for Terraform Cloud, else False.

terraform_enterprise_only()

Return True if this endpoint is only for Terraform Enterprise, else False.

update(varset_id, payload)

PUT/PATCH varsets/:varset_id

Variable Sets Update API Doc Reference

Update Sample Payload

update_var_in_varset(varset_id, var_id, payload)

PATCH varsets/:varset_id/relationships/vars/:var_id

Variable Sets Update Variable API Doc Reference

Update Variable In Variable Set Sample Payload