Workspace Variable Commands
Managing Workspace Variables.
tfx workspace variable list
List all Workspace variables.
Example
$ tfx workspace variable list --name tt-workspaceUsing config file: /Users/tstraub/.tfx.hclList Variables for Workspace: tt-workspace╭──────────────────────┬───────────┬──────────────┬───────────┬───────┬───────────┬───────────────────────────────────╮│ ID │ KEY │ VALUE │ SENSITIVE │ HCL │ CATEGORY │ DESCRIPTION │├──────────────────────┼───────────┼──────────────┼───────────┼───────┼───────────┼───────────────────────────────────┤│ var-ALQUrgeMBDPE9wiy │ variable3 │ It is friday │ false │ false │ env │ I am environmental ││ var-zrX5efBRKdiRQuUN │ variable2 │ │ true │ false │ terraform │ I am sensitive ││ var-viy2a1iMKp6Hxgmn │ variable5 │ ./list.hcl │ false │ true │ terraform │ I am a list in a file ││ var-DmKBqRHJb34uTfmu │ variable4 │ ./string.hcl │ false │ true │ terraform │ I am a string in a file ││ var-XvP33JGaRQ3m7FP8 │ variable6 │ ./map.hcl │ false │ true │ terraform │ I am a map in a file ││ var-bNCzmaMNtUUDaSzN │ variable1 │ It is friday │ false │ false │ terraform │ some important info about this... │╰──────────────────────┴───────────┴──────────────┴───────────┴───────┴───────────┴───────────────────────────────────╯tfx workspace variable create
Create a Workspace variable, optionally the value can read from a filename.
Basic Example
$ tfx workspace variable create --name tt-workspace -k variable1 -v "It is friday" -d "some important info about this..."Using config file: /Users/tstraub/.tfx.hclCreate Variable for Workspace: tt-workspaceVariable Created: variable1ID: var-bNCzmaMNtUUDaSzNKey: variable1Value: It is fridaySensitive: falseHCL: falseCategory: terraformDescription: some important info about this...Sensitive Example
$ tfx workspace variable create --name tt-workspace -k variable2 -v "It is friday" -d "I am sensitive" --sensitiveUsing config file: /Users/tstraub/.tfx.hclCreate Variable for Workspace: tt-workspaceVariable Created: variable2ID: var-zrX5efBRKdiRQuUNKey: variable2Value:Sensitive: trueHCL: falseCategory: terraformDescription: I am sensitive.Environment Variable Example
$ tfx workspace variable create --name tt-workspace -k variable3 -v "It is friday" -d "I am environmental" --envUsing config file: /Users/tstraub/.tfx.hclCreate Variable for Workspace: tt-workspaceVariable Created: variable3ID: var-ALQUrgeMBDPE9wiyKey: variable3Value: It is fridaySensitive: falseHCL: falseCategory: envDescription: I am environmentalHCL String Example
$ tfx workspace variable create --name tt-workspace -k variable4 -v ./string.hcl -d "I am a string in a file" --hclUsing config file: /Users/tstraub/.tfx.hclCreate Variable for Workspace: tt-workspaceVariable Created: variable4ID: var-DmKBqRHJb34uTfmuKey: variable4Value: ./string.hclSensitive: falseHCL: trueCategory: terraformDescription: I am a string in a fileHCL List Example
$ tfx workspace variable create --name tt-workspace -k variable5 -v ./list.hcl -d "I am a list in a file" --hclUsing config file: /Users/tstraub/.tfx.hclCreate Variable for Workspace: tt-workspaceVariable Created: variable5ID: var-viy2a1iMKp6HxgmnKey: variable5Value: ./list.hclSensitive: falseHCL: trueCategory: terraformDescription: I am a list in a fileHCL Map Example
$ tfx workspace variable create --name tt-workspace -k variable6 -v ./map.hcl -d "I am a map in a file" --hclUsing config file: /Users/tstraub/.tfx.hclCreate Variable for Workspace: tt-workspaceVariable Created: variable6ID: var-XvP33JGaRQ3m7FP8Key: variable6Value: ./map.hclSensitive: falseHCL: trueCategory: terraformDescription: I am a map in a filetfx workspace variable update
Update an existing Workspace Variable, optionally the value can read from a filename.
Variables do not have an “upsert” functionality, so you either need to delete then recreate, or update.
Example
$ tfx workspace variable update --name tt-workspace -k variable1 -v "It is July" -d "(update) I made the mistakes"Using config file: /Users/tstraub/.tfx.hclUpdate Variable for Workspace: tt-workspaceVariable UpdatedID: var-bNCzmaMNtUUDaSzNKey: variable1Value: It is JulySensitive: falseHCL: falseCategory: terraformDescription: (update) I made the mistakestfx workspace variable show
Show details of a Workspace Variable.
Example
$tfx workspace variable delete
Delete a Workspace Variable.
Example
$ tfx workspace variable delete --name tt-workspace --key variable7Using config file: /Users/tstraub/.tfx.hclDelete Variable for Workspace: tt-workspaceVariable Deleted: variable7Status: Success