- Download the appropriate release for your machine
- Unzip the release
chmod +x tfc- Move the binary into your PATH
If you run into an error like "Apple can’t check app for malicious software", run xattr -d com.apple.quarantine /path/to/file
Store the following env vars in a file that you source before using this tool:
TFC_DEFAULT_VARIABLE_SET_ID(if creating workspaces)- This is a comma-separated list of variable set IDs to share with workspaces
TFC_OAUTH_TOKEN_ID(if adding workspaces)TFC_ORG_NAMETFC_TOKENif you don't want to runterraform loginor if you want to test against a specific account
Command: apply
Flags:
--prefix/-p: apply all workspaces with this prefix. Cannot be an empty string--auto-approve/-a: Don't prompt for approval before starting applies--force: Forcefully apply the most recent run in the workspace--timeout/-t: Number of seconds to wait for a given run to apply--workers/-w: Number of workers to boot up--gated/-g: Apply runs one-at-a-time, prompting forybefore moving on. This can be used to give yourself a chance to manually check the outcome of an apply--skip: A list of . Can be used multiple times, e.g.--skip prd --skip pre
Example:
tfc apply --prefix aws-ipam-latam
Example skipping:
tfc apply --prefix aws-ipam-latam --skip prd --skip pre
Command: create
Relevant Flags:
--prefix/-p: Prefix for workspace names--suffix/-s: Suffix for workspace names--repo/-r: Repository where Terraform code lives in the form of<Organization>/<Repository name>--oauth-token-id/-i: ID of the OAuth application used to connect to repo. Can be found under Settings > Providers--var-file-prefix/-x: Prefix of plan file names. Defaults to<suffix>.tfvars. For example,-pfp hello-worldwould yieldhello-world-dev.tfvars. Variable files must follow either naming scheme to be picked up correctly--path-to-var-files/-f: Path to variable files. Defaults to./var. Trailing/are removed--variable-set-ids/-v: A list of variable set IDs to share with each new workspaceskip-vars: Do not set theTF_CLI_ARGS_planenv var
Additionally, there are the following environment variables:
TFC_DEFAULT_VARIABLE_SET_ID: A comma-separated list of variable set IDs to share with each newly-created workspace- Example
TFC_DEFAULT_VARIABLE_SET_ID=varset-foo,varset-bar
- Example
TFC_OAUTH_TOKEN_ID: See--oauth-token-id. Should look something likeot-XU...