1. Terraform driver Common¶
1.1. Introduction¶
1.2. Overview¶
1.2.1. Terraform¶
1.2.2. Terrform driver¶

図 1.82 ITA system overview¶
- Terraform Cloud/EP driverAllows users to Create Organizations, Workspaces, execute operations (Plan/PolicyCheck/Apply) to Terraform Cloud and Terraform Enterprises registered to ITA and fetch operation logs.For more information, see "Terraform Cloud/EP driver".
- Terraform CLI driverAllows users to execute operations (Plan/Apply) to and fetch operation logs from Terraform systems installed on the same environment as ITA.For more information, see "Terraform CLI driver".
1.3. Handling Variables¶
1.3.1. Variable types¶
1.3.2. Extracting Variables and registering Specific values,¶
1.3.3. Types of variables¶
type |
Details |
Member variable target
※1
|
Substitute order target
※2
|
type description example |
default description example |
---|---|---|---|---|---|
string |
String type |
× |
× |
string |
ABC |
number |
Number type |
× |
× |
number |
123 |
bool |
Boolean type (True or false). |
× |
× |
bool |
true |
list |
Array type. |
× |
〇 |
list(string) |
["A", "B", "C"] |
set |
Array type. Asks for unique values.
ITA does not check if the specific value is unique or not.
|
× |
〇 |
set(number) |
[1, 2, 3] |
tuple |
Array type.The user must decide what number is what type in beforehand.
The value's input number is decided, meaning that they can be selected from pulldown selections as Member variables.
|
〇 |
× |
tuple([string, number]) |
["ABC", 2023] |
map |
key-value (associative array) type. If a type containing more map types on ITA, the key value cannot be specified from the type information, meaning that the HCL settings must be set to ON if the user is using substitute value auto registration settings.
For more information regarding HCL settings, see "Substitute value auto registration settings".
|
× |
× |
map(string) |
{"test_key" = "test_value"} |
object |
key-value (associative array) type. in ITA, the key name is handled as Member variables. the key name cannot contain Japanese characters.
|
〇 |
× |
object({test_key = string}) |
{"test_key" = "test_value"} |
any |
A type that fits everything. however, it will be handled the same way as string types on ITA. |
× |
× |
any |
ABC |
No description |
If no type is described, it will be handled the same way as string types on ITA. |
× |
× |
ABC |
- ※1 …Member variable targetIf the variable is a key-value type, it will be a key name..If the variable type is object, <KEY> = <TYPE>'s <KEY> will be member variable.If the variable type is tuple, the variables defined within the tuple will be numbered from [0],[1],[2]… and become Member variables.If the Variable type is registered to the Variable nest management menu, they will be numbered from [0],[1],[2]… and become Member variables based on the maximum cycle number.For more information regarding variable nests, see "Terraform Cloud/EP driver -> Variable nest management" and "Terraform CLI driver -> Variable nest management".
- Example: When variable type is object
- tf file and registration values
variable "VAR_hoge" { type = object({ NAME = string, IP = string }) default = { “NAME” = “machine_01”, “IP” = “127.0.0.1” } }
- Substitute value example(Substitute value auto registration settings)
Item number
Variable name
Member variable
Substitute order
Parameter sheet input value
1
VAR_hoge
NAME
No input
my_machine
2
VAR_hoge
IP
No input
192.168.100.1
- Value sent to Terraform
{ NAME = "my_machine" IP = "192.168.100.1" }
- Example: When Variable type is tuple
- tf file and registration value
variable "VAR_hoge" { type = tuple([string,number]) default = ["abc",2023] }
- Substitute value example(Substitute value auto registration settings)
Item number
Variable name
Member variable
Substitute order
Parameter sheet input value
1
VAR_hoge
[0]
No input
def
2
VAR_hoge
[1]
No input
2024
- Value sent to Terraform
["def", 2024]
- Example: When variable type is nest management target
- tf file and registration value
variable "VAR_hoge"{ type = list(set(string)) default = [ ["aaa","bbb"] ["ccc","ddd"] ] }
- Substitute value example(Substitute value auto registration settings)
Item number
Variable name
Member variable
Substitute order
Parameter sheet input value
1
VAR_hoge
[0]
1
AAA
2
VAR_hoge
[0]
2
BBB
3
VAR_hoge
[1]
1
CCC
4
VAR_hoge
[1]
2
DDD
- Value sent to Terraform
[ ["AAA", "BBB"], ["CCC", "DDD"] ]
- ※2 …Substitute order targetThe substitute order is the order of which specific values are set to variables (starting from top).If the variable type (or the type for the lowest variable in a hierarchy configuration) is "list" or "set", they can be configured in the "Terraform Cloud/EP driver -> Substitute value auto registration settings" and "Terraform CLI driver -> Substitute value auto registration settings menus.
- Example: When Variable type is list
- tf file and registration value
variable "VAR_hoge" { type = list(string) }
- Substitute value example(Substitute value auto registration settings)
Item number
Variable name
Member variable
Substitute order
Parameter sheet input value
1
VAR_hoge
Input not required
1
ABC
2
VAR_hoge
Input not required
2
DEF
- Value sent to Terraform
["ABC","DEF"]
- Example: When the Hierarchy variable's lowest variable type is "set"
- tf file and registration value
variable "VAR_hoge" { type = object({ key = set(number) }) }
- Substitute value example(Substitute value auto registration settings)
Item number
Variable name
Member variable
Substitute order
Parameter sheet input value
1
VAR_hoge
key
1
1
2
VAR_hoge
key
2
2
- Value sent to Terraform
{ key = [1,2] }
1.4. Describing construction code¶
1.4.1. Describing Module¶
1.4.2. Describing Policy¶
1.5. Appendix¶
1.5.1. Module file "Variable block" input/register example¶
This section contains substitute value auto registration settings registration examples and "Variable block" description examples for each variable type.
1.5.2. Variable nest management flow example¶
This section contains examples on operating the Variable nest management menu.